CL_FAGL_DATAC_CONTAINER - Data Container for Any Data

Fill RESBD Structure from EBP Component Structure   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Functionality

Instances of the class CL_DATA_CONTAINER can manage any data (except references) and store them on thedatabase. It does not matter whether the data consists of simple data elements, nested structures ofany depth, or tables. It is not necessary for the type on which the data is based to exist in the DDIC. The container is able to work with dynamically generated types.

For more information, see the ABAP keyword documentation under RTTS Run Time Type Services.

To access the ABAP keyword documentation:

  1. Start transaction SE80.
  2. Display any program code
  3. Position the cursor anywhere
  4. Call the F1 Help.
  5. Choose ABAP overview

To see the documentation, choose ABAP Keyword Documentation -> ABAPREFERENCE -> ABAP System Classes and Interfaces -> RTTS Run Time Type Services.

Relationships

The container was originally developed for the FPP (Framework for Parallel Processing) but can be used independently of it.

Example

Example

DATA: lcl_container TYPE REF TO CL_DATA_CONTAINER,

lv_data TYPE string.

TRY.

CREATE OBJECT lcl_container EXPORTING ev_guid = 'MY_CONTAINER'.

lv_data = 'This is a test'.

CALL METHOD lcl_cont->setdata EXPORTING iv_name = 'NUMMER1'

= lv_data.

CALL METHOD lcl_cont->save IMPORTING ev_guid = lv_guid.

COMMIT WORK.

CLEAR lcl_container.

CREATE OBJECT lcl_container EXPORTING ev_guid = 'MY_CONTAINER'.

CATCH cx_fpp_exception.

BREAK-POINT.

ENDTRY.

Notes

  • No identification of the container needs to be specified when an instance is generated. In this case an ID (GUID) is automatically assigned to the container when the constructor is called.
  • The SAVE method returns the ID of the container ("MY_CONTAINER" in the example).
  • If an instance is generated with an ID of a container that already exists on the database, the data of that container is loaded automatically.
  • There is no restriction on the volume of data that the container can handle.
  • When reading data, there are almost no restrictions regarding the target area. Only the generaltype (SIMPLE, STRUCTURE, TABLE) must match the stored data. The container then performs an extended MOVE-CORRESPONDING.
  • If the structure of the stored data changes due to modifications of the underlying DDIC elements,the container can still read the data as long as no fields are truncated (since that would result in loss of data). Deleting entire fields from structures and adding new fields is not a problem.
  • The container should not be used to store transaction data because internal data management uses XML serialization and data clusters, which is performance-intensive.

Further information



Vendor Master (General Section)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.


Length: 3437 Date: 20120526 Time: 124054     triton ( 133 ms )