Skip to Content

This document helps you add a button on to the ALV grid toolbar of a standard report – CO27 Picking list.

— The initial screen of ‘Picking list’ looks like this:

     /wp-content/uploads/2013/07/screen0_254720.jpg

— On entering input and executing the report, it displays a list of order and material details as shown below :

     /wp-content/uploads/2013/07/screen4_254722.jpg

Follow the steps given below to achieve this :

(1) We will need to write code for button functionality in the method of “handle_toolbar_set” event as we are going to add it on to the toolbar.

     /wp-content/uploads/2013/07/screen5_254726.jpg

(2) Since it is a standard SAP program , we will check for implicit enhancements to add this code in the method shown above.

     /wp-content/uploads/2013/07/screen6_254727.jpg

     /wp-content/uploads/2013/07/screen7_254728.jpg

     There exists an implicit enhancement point in the method and we shall create one implementation.

(3) Create an enhancement implementation in the method of “handle_toolbar_set” event.

     /wp-content/uploads/2013/07/screen8_254735.jpg


(4) Name the implementation and enter the short text.

     /wp-content/uploads/2013/07/screen9_254736.jpg

(5) Write the code for adding a button on the toolbar.

     /wp-content/uploads/2013/07/screen10_254737.jpg

     In this example, we are adding a function code ‘ZBTN’ for the button and also naming it as “New Custom Button.”

(6) Activate the enhancement and run the report.

     /wp-content/uploads/2013/07/screen12_254738.jpg

     And this is it! We can see the new button that we have added on the toolbar.

     We have also assigned a function code for this to handle the action.

     On clicking this new button, the function code ‘ZBTN’ would be captured and the necessary logic be performed.

(7)  Handle the action on button click : We will write the logic for handling the user action in the method of “handler_after_user_command” event.

     /wp-content/uploads/2013/07/screen13_254739.jpg


(8) This method has handled user action for few of the buttons that are already in place.

     /wp-content/uploads/2013/07/screen14_254740.jpg

(9) We will follow the same process from step 2 to 5. Check for implicit enhancement points and create an implementation in this method.

     /wp-content/uploads/2013/07/screen15_254742.jpg

(10)  Write logic to perform the necessary action on button click.

     /wp-content/uploads/2013/07/screen16_254747.jpg

     We are calling this BADI to get the user command. By checking for its value, we are writing code in the ‘handle_new_custom_button’ subroutine.


To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply