Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Alv report

KK07
Contributor
0 Kudos

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?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

ok thanx

Former Member
0 Kudos

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.