Let’s Web Dynpro. Part VI

To some degree V, we figured out how we can show the even result in ALV with Part Utilization. In this post, Web Dynpro. Part VI, we would perceive how to add custom buttons automatically to the ALV yield apparatus bar/header.

Web Dynpro. Part VI, It is an extremely considered normal prerequisite as displayed beneath (if it’s not too much trouble, note these buttons are not standard UI components).

1

In the above figure: SELECTALL, DESELECTALL and RETRIEVEINFO are buttons which we have added at run time, programatically. They are not standard UI buttons.

How to achieve this functionality?

21

Whenever you have decided the information for the result, you tie it to the setting hub and call the strategy to SET the ALV Properties (for our model the technique is “ALV_SET_AVAIL_PLANT”. Here you characterize the button name and capability code.

Let us check the important lines related to the custom buttons in this method.

Make object, give the picture source (discretionary), Set the text of the button (discretionary), give the capability code and add/set the button.

241

Kindly snap the connection for complete code scrap for the ALV_SET_AVAIL_PLANT. You can involve this as your layout for all ALV properties. Simply change the field names of your table and you might possibly require the button parts (displayed in the above figure).

Give exceptional accentuation to the capability code. Ensure the instance of the letter sets. You really want to give the specific capability code to the Occasion Overseer technique as expressed beneath.

When the ALV Property is set, we really want to pronounce one more Occasion Overseer technique to catch the snaps on the ALV; for our model it is SELECT_DESELECT strategy.

22

In this technique we really want to distinguish the capability code and call relating strategy for activity/action you need to perform. If it’s not too much trouble, see the capability code in the occasion overseer technique and the ALV property strategy. They are the very same.

23

Say for activity ‘DESELECTALL’ we need to call strategy deselectall( ) to deselect all the really look at boxes. Likewise ‘RETRIEVEINFO’ activity would bring you the plant subtleties.

25

Please note, the method name can be different than the BUTTON or FUNCTION code name. In our example we have the same name for all three for simplicity.

Hope, with the above information, you would be able to add as many buttons you want and make your ALV more interactive. Please let us know, if we need to provide more information on this topic. We would be happy to add them in this post.

Thank you very much for your time!!

 

YOU MAY BE INTERESTED IN

Your Definitive Guide to Becoming a SAP ABAP Developer

Best Practices for SAP Cloud Platform Development: A Comprehensive Guide

10 Real-World SAP ABAP Programming Examples (with Code!)

 

X
WhatsApp WhatsApp us