Application Development and Automation 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: 
Read only

Event on Print Button

Former Member
0 Likes
719

Hello ABAPers,

I use an ALV in a screen, and use a copy of the standard status (from the function group SALV) STANDARD_FULLSCREEN, which contains the menu and ALV toolbars.

If the user chooses Print (fcode = $RNT) and executes the printing, I must execute some code (e. g. change some ALV data).

1) Is it possible to catch the event of clicking the Print menu button?

2) How could I implement my own user_command to handle the function codes (right now it goes to the standard user_command provided by the standard status)

Thanks in advance,

Ivson

Hello ABAPers,

I use an ALV in a screen, and use a copy of the standard status (from the function group SALV) STANDARD_FULLSCREEN, which contains the menu and ALV toolbars.

If the user chooses Print (fcode = $RNT) and executes the printing, I must execute some code (e. g. change some ALV data).

1) Is it possible to catch the event of clicking the Print menu button?

2) How could I implement my own user_command to handle the function codes (right now it goes to the standard user_command provided by the standard status)

Thanks in advance,

Ivson

2 REPLIES 2
Read only

Former Member
0 Likes
479

Hi Ivson,

Write a class which implements the method handle_user_command for the event user_command of class cl_gui_alv_grid.

In this method you have to handle the print.

Set handler for the alv.

Then the control goes to the method when the print button is selected on the alv toolbar.

check the program : BCALV_TEST_GRID_EVENTS

you can handle the event : user_command or before_user_command.

hope this helps you.

regards,

prasanth

  • reward all helpful points

Read only

Former Member
0 Likes
479

Thank you for your response, but for this particular case I cannot use ALV objects.

For my first question, I already solved the problem by filling the parameter I_CALLBACK_USER_COMMAND with the name of a form where commands are handled.

For the second point, I changed the name of the Print fcode in the pf status (originally "&RNT"); otherwise it would send me to the standard user_command.

Best regards,