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

Custom Functionality for UNDO button

Former Member
0 Likes
963

Hi,

I have created an ALV report with toolbar.For some buttons i have implemented custom functionality.

Issue:i have undo button in tool bar which is working for buttons with standard functionality but for custom button it is not working.

Can you provide how we can implement functionality for  custom undo button.i know how to add custom button and implement functionality but for undo button what functionality need to written.

Please suggest how to proceed with this case.

Thanks and Regards

sam

3 REPLIES 3
Read only

Former Member
0 Likes
780

Hello Sam,

Instead of creating a custom button and adding a code in it, I suggest to add your extra code in the standard. See below steps,

Modifying the ALV Grid Control Standard Functions

The standard functions are not designed for specific applications. So there may be times when you want to tailor a generic function — such as sorting by a specific column — for more efficient operation with a specific application. One way to do this is to hide the standard function you want to modify and then add your own implementation. While this approach will certainly work, but there is a more elegant way. Follow these 3 easy steps.

1. Define an event handler method for event BEFORE_USER_COMMAND. This event is triggered after the user has selected a function. This means that the ALV Grid Control passes control to the application before the function is executed. Using event parameter E_UCOMM, you can trap and restrict the function code to just the function you want to modify.

2. Implement your own code for the function within the event handler method. In this context, you can even call methods of the ALV Grid Control if you need too.

3. Reset the function code to ensure that the standard function is no longer executed. You can use code similar to the below:

CALL METHOD <instance of the ALV control>->set_user_command exporting I_UCOMM = SPACE.

For more details,

http://www.itpsap.com/blog/2012/09/09/a-guide-to-the-new-alv-grid-control-part-3/

Regards,

Sudhir Kothavale.

Read only

Former Member
0 Likes
780

hi,

go through these links for complete ALV reference and class CL_GUI_ALV_GRID,

Entire ALV functionality are explained briefly in this documents..

even your issues too..

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415...

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf

hope this helps,

Mathan R.,

Read only

Former Member
0 Likes
780

Did you find a solution for the issue?