09-18-2008 12:54 PM
hi all,
i have a req. in which i should place two icons
for selecting all check boxes and another one for deselcting all.i did that the problem is where should i write the code to get that functionality?
i mean should i write in any event if yes.. in which event should i write?
09-18-2008 1:04 PM
Hi,
If you are using OO alv then in the event 'USER_COMMAND' you can write the code like below...
if sy-ucomm = '&ALL'.
call method SET_SELECTED_ROWS and no need to pass any other parameters.
endif.
If you are using FM to display alv then create set pf-status with these 2 buttons, then you need not to write any code for these 2 buttons because the standard sap functionality will apply to these buttons.
Rgds,
Bujji
09-18-2008 12:56 PM
Hi,
if its an ALV, the program would handle the select all or deselect all buttons automatically. for that you should not disturb the standard status. If in case you want to add another field then in
SE41->extras-> Adjust template-> alv status.
santhosh
09-18-2008 1:01 PM
You need to use two events...Event 'TOOLBAR' for adding the buttons to the toolbar (if buttons not added previously)..
and then the event 'USER_COMMAND' to handle the button click. this event will supply you with the function code which you can then check and provide your implementation here..ex. you can loop at your internal table and set all checkbox fields .
~Piyush
09-18-2008 1:04 PM
Hi,
If you are using OO alv then in the event 'USER_COMMAND' you can write the code like below...
if sy-ucomm = '&ALL'.
call method SET_SELECTED_ROWS and no need to pass any other parameters.
endif.
If you are using FM to display alv then create set pf-status with these 2 buttons, then you need not to write any code for these 2 buttons because the standard sap functionality will apply to these buttons.
Rgds,
Bujji
09-18-2008 1:13 PM
09-18-2008 1:20 PM
no need to write any code to get those functionality.
just copy the GUI interface of any standard alv report and call that interface in ur program.
eg..
FORM PFSTATUS01 USING UT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_USER_COMMAND = 'SAVE'
I_CALLBACK_PF_STATUS_SET = 'PFSTATUS01'
IT_FIELDCAT = GT_FIELDCAT01
IS_LAYOUT = GT_LAYOUT02
TABLES
T_OUTTAB = GT_FINAL02.