Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to capture an event after the list is displayed in an alv list


I added a Print button in the application toolbar using SE41 and called that in my Z program which displays data in an alv list.

Each record in the alv has a check box against it. And user has the option to select one/more checkboxes and push the print button , which should print the selected record details ( worked in background ).

I am not using SE51 transaction at all here. Now the issue is I am not able to trap the print button push event. The code that I am using is :-

Immediately after the functional module ALV_DISPLAY is executed ,






but its not working. Please advise or help what can be the missing point here from my side , which would solve the issue.

Thanks in advance


Former Member

Pass the name of a subrotine to handle your user commands to the fm parameter.


Then code for the user command function,

form user_command using r_ucomm type sy-ucomm.

case r_ucomm.

when '<FCODE of your button>'.

  • Code your logic....



To add your button using your own pf-status, you should copy a standard gui status and modify it.

To trigger this pf-status you should pass routine name to I_CALLBACK_PF_STATUS_SET.(I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS..)

form set_pf_status.

set pf-status 'ZSTAT'. "THis ZSTAT must be created by copying a STANDARD pf-status of say some std program like SAPLKKBL. and then modifying it.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question