Application Development 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: 

How to auto-press a button in MD48

Former Member
0 Kudos

There is a button in MD48 labeled "All Plants". We have made a slightly modified version of MD48 called ZD48. Since it is a 'Z' version, we can make custom changes. When the screen appears, the users would like the "All Plants" button to be automatically pressed. How would I trigger this button in the ABAP code? The sy-ucomm value is ''%GC 120 1". This is handled by some event handler which figures out the function code of 'PLALL'. I've gone through it in debug mode and see what is happening, but am unsure of how to trigger such an event in ABAP. Your suggestion would be greatly appreciated. Thanks. -Mark

1 REPLY 1

surajarafath
Contributor
0 Kudos

Hi, You can achieve this, just make this code and place it where you exactly want it,

try like this...

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
 EXPORTING
    FUNCTIONCODE                 =  'YOUR_FUNCTION_CODE'
EXCEPTIONS
  FUNCTION_NOT_SUPPORTED       = 1
  OTHERS                       = 2
          .