you can make it invisible during runtime.
At the event, AT SELECTION-SCREEN OUTPUT. you can turn attributes on and off for screen elements. In this case, invisible = 1, makes the element invisible, 0 makes is visible.
here is a short sample.
report zrich_0001. parameters: p_check type c. selection-screen pushbutton 40(20) gocfg user-command gocfg. at selection-screen output. loop at screen. if screen-name = 'GOCFG'. screen-invisible = '1'. modify screen. endif. endloop.
Regards,
Rich Heilman
As Rich suggested, that will make the button disappear but it would still allow the user to enter the function code. For example, if your button was assigned function code FUNC, the user could type =FUNC in the ok code and hit enter. Your AT SELECTION SCREEN event would be invoked and passed that function code.
If this is a concern, the simplist thing to do is set a flag that you have turned off that button/function code and respond accordingly in your AT SELECTION SCREEN event by doing nothing or giving a message.
Add a comment