Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Creation two OOPS ALV with editable fields and saving the changes to the internal table in a single report
Steps in PBO.

 Step 1: Create a screen with two custom container with the name 'ALV_CONTAINER1' and  'ALV_CONTAINER2'. (Name is optional)

Step 2: Then define the container objects,

 

Error rendering macro 'code': Invalid value specified for parameter 'lang'
*Object1:
DATA: G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
         G_CUSTOM_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER
CREATE OBJECT G_CUSTOM_CONTAINER1
EXPORTING
CONTAINER_NAME = 'ALV_CONTAINER1'.
*OBJECT2:
CREATE OBJECT G_CUSTOM_CONTAINER2
EXPORTING
CONTAINER_NAME = 'ALV_CONTAINER2'.


 

Step 3: create grid objects,

Error rendering macro 'code': Invalid value specified for parameter 'lang'
DATA: G_EDITABLE_ALV1 TYPE REF TO CL_GUI_ALV_GRID,
          G_EDITABLE_ALV2 TYPE REF TO CL_GUI_ALV_GRID,
CREATE OBJECT G_EDITABLE_ALV1
EXPORTING
I_PARENT = G_CUSTOM_CONTAINER1.
CREATE OBJECT G_EDITABLE_ALV2
EXPORTING
I_PARENT = G_CUSTOM_CONTAINER2.


 

Step4: call the method set_table_for_first_display for display.

*Display of first table

Error rendering macro 'code': Invalid value specified for parameter 'lang'
CALL METHOD G_EDITABLE_ALV1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_FCATLAYO
IS_VARIANT = LS_VARIANT
I_SAVE = 'A'
CHANGING
IT_OUTTAB = ITAB1
IT_FIELDCATALOG = ITAB_FCAT1
*Making field editable in the field catalog
*please give this for the fields that needs to be editable.
ITAB_FCAT-EDIT = 'X'.
*Display of second table.
CALL METHOD G_EDITABLE_ALV2->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
    IS_LAYOUT       = GS_FCATLAYO
    IS_VARIANT      = LS_VARIANT
    I_SAVE          = 'A'
  CHANGING
    IT_OUTTAB       = ITAB2
    IT_FIELDCATALOG = ITAB_FCAT2.


 

Screen output:  
 

Steps in PAI:

Call the method check_changed_data to keep the changed data in the internal table.

  CALL METHOD g_editable_alv1->check_changed_data .

  CALL METHOD g_editable_alv2->check_changed_data .

  CALL METHOD cl_gui_cfw=>flush.

  CALL METHOD cl_gui_cfw=>dispatch.

Output after change: