FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
CALLl METHOD ref1->check_changed_data
CASE P_UCOMM.
WHEN 'SELECTALL'.
loop at itab.
itab-check = 'X'.
modify itab index sy-tabix.
endif.
ENDCASE.
P_SELFLD-REFRESH = 'X'.
ENDFORM.
GET_GLOBALS_FROM_SLVC_FULLSCR - Get referrer to object grid.
REUSE_ALV_FIELDCATALOG_MERGE - Create field catalog from dictionary structure or internal table
REUSE_ALV_LIST_DISPLAY -Output a simple list (single line or several lines)
Functionality
This module outputs an internal table with any structure as a formatted one-line or multiple-line list.
Principle:
Pass an internal table with the set of output information
Pass a structure with general list layout details
Pass a field catalog as an internal table
The field catalog describes the fields to be output in the list.
Code:
TYPE-POOLS : slis.
*-------------- Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
*--------- Select Data
SELECT * FROM t001 INTO TABLE itab.
LOOP AT gt_lvc_fcat INTO gl_lvc_fcat.
CASE gl_lvc_fcat-fieldname.
WHEN 'BWKEY'.
gl_lvc_fcat-no_out = 'X'.
WHEN 'KONTO'.
gl_lvc_fcat-hotspot = 'X'.
gl_lvc_fcat-fix_column = 'X'.
WHEN 'FLAG'.
gl_lvc_fcat-tech = 'X'.
ENDCASE.
MODIFY gt_lvc_fcat FROM gl_lvc_fcat.
ENDLOOP.
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.