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

BADI Implementation

Former Member
0 Likes
329

Hi,

Can anyone help me in sorting out this issue in plmd_audit transaction.

A custom button has to be provided in an existing ALV toolbar in a particular screen.

Whenever user clicks on this custom button , a background process has to take place,i.e a corrective action program has to be generated, for all the questions that are marked "action required" and "noncompliance." and the corrective actions that is generated has to be assigned to respective persons.

i tried adding a button in the ALV , but it is appearing across all ALV's available for that transaction

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
285

Hello Keerthi

Neither do I have a system available with transaction plmd_audit nor have you mentioned the BAdI name. However, if you have defined your coding within an event handler method for event TOOLBAR (of class CL_GUI_ALV_GRID) please note that every event handler method has the optional IMPORTING parameter SENDER (= control instance that raised the event).

Assuming that the different ALV grids in your transaction belong to different grid instances (e.g. grid1 in screen 100, grid2 in screen 200, etc), then you could use the following coding:

METHOD handle_toolbar.  " handles event TOOLBAR

  CASE sender.
    WHEN grid1.
 "    add custom button to ALV toolbar
      ...

    WHEN others.
"     do nothing   OR:
"     suppress added custom button again
    ENDCASE.

ENDMETHOD.

However, this requires that the data definitions of the grid reference variables are known to your event handler method.

Alternatively, you may try to check for the screen (if possible):

METHOD handle_toolbar.  " handles event TOOLBAR

  CASE sy-dynnr.
    WHEN '0100'.
 "    add custom button to ALV toolbar
      ...

    WHEN others.
"     do nothing   OR:
"     suppress added custom button again
    ENDCASE.

ENDMETHOD.

Regards

Uwe