‎2007 Aug 08 2:53 PM
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
‎2007 Aug 09 2:34 AM
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