Posted: Sat Sep 13, 2008 6:02 pm Post subject: Updating the Internal Table -After Edit in ALV
Author: Vijay Babu Dudla
Description:
In ALV Editable Grid using the Function module, the Editable content is not Transferred to Internal table. To update the Internal table with Updated content Function modue
GET_GLOBALS_FROM_SLVC_FULLSCR is useful. check the sample code for how to use that Function in the ALV programs.
Sample code.
Code:
REPORT zalv_edit.
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv.
data: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
kwmeng LIKE vbap-kwmeng,
END OF itab.
SELECT vbeln
posnr
kwmeng
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
FORM status USING p_extab TYPE slis_t_extab.
"Set the Button using the staus
"Copy the Standard status from the program SAPLKKBL status
" STANDARD using SE41, and use that here.
"Pf status
SET PF-STATUS 'STATUS' EXCLUDING p_extab.
ENDFORM. " STATUS
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: gd_repid LIKE sy-repid,
ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data .
ENDIF.
CASE r_ucomm.
WHEN 'SAVE'.
"Here you will get the data(along with modified rows/data)
"Filter the modified rows and update to DB using BAPI/BDC
"Accordingly
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "USER_COMMAND
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.