Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all articles
Browse latest Browse all 8768

OO ABAP 'SAVE' functionality

$
0
0

Hi Experts,

 

I have a ALV Grid screen program using OO concepts. Requirement is that the final ALV table has 10 fields, all are editable fields and will be blank for the first time. So, I am doing a DO.....ENDO for the first time so that the final ALV table is displayed with 10 fields and 10 records. I need to key in some information in these fields and try to insert this information in custom database table. My question here is I am able to enter the values in the ALV report. But, when I am trying to SAVE the entries entered into the ALV grid, my internal table is not updated with the entries entered on the ALV report. Appreciate if anybody could guide me in correct direction.

 

Below is the piece of my code.

 

   IF IT_FINAL[] IS INITIAL.

    DO 10 TIMES.
      WA_FINAL-SEPARATOR = '   '.
      APPEND WA_FINAL TO IT_FINAL.
      CLEAR: WA_FINAL.
    ENDDO.

*Create a custom container control for the ALV Control
    CREATE OBJECT CUSTOM_CONTAINER
      EXPORTING
        CONTAINER_NAME              = C1
      EXCEPTIONS
        CNTL_ERROR                  = 1
        CNTL_SYSTEM_ERROR           = 2
        CREATE_ERROR                = 3
        LIFETIME_ERROR              = 4
        LIFETIME_DYNPRO_DYNPRO_LINK = 5.

*Create an instance of ALV control
    CREATE OBJECT GRID1
      EXPORTING
        I_PARENT = CUSTOM_CONTAINER.

    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
        IS_LAYOUT            = IS_LAYOUT
        IS_VARIANT           = IS_VARIANT
        I_SAVE               = 'A'
        I_BYPASSING_BUFFER   = 'X'

      CHANGING
        IT_FIELDCATALOG      = IT_FIELDCAT
        IT_OUTTAB            = IT_FINAL.

 
  ENDIF.

 

   MODULE USER_COMMAND_0200 INPUT.

 

   CASE OKCODE.
    WHEN GC_SAVE.
      DATA : IS_VALID.

 

************TRIED THE BELOW COMMENTED CODE. BUT, NOT WORKING******************
*      IF GRID1 IS INITIAL.
*       CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
*         IMPORTING
*           E_GRID = GRID1.
*      ENDIF.
*      IF NOT GRID1 IS INITIAL.
*        CALL METHOD GRID1->CHECK_CHANGED_DATA .
*      ENDIF.

      LOOP AT IT_FINAL INTO WA_FINAL.        "Even though I have entries this table is blank


      ENDLOOP.

   ENDMODULE.

 

Thanks,

 

Nani


Viewing all articles
Browse latest Browse all 8768

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>