Call screen on button click?

user393964 picture user393964 · May 19, 2011 · Viewed 18.7k times · Source

I have a mainscreen with a few buttons in it and I'm trying to assiciate each button with a screen call. I can't get it to work though. I created the button with the layout painter but I don't see how to make it functional.

Any ideas? Thanks!

Answer

user235064 picture user235064 · May 19, 2011
  • open the screen painter
  • double click on the button
  • enter a Function Code (the field is above "Context Menu Form")

now that your button has a function code it will fire this OK-Code and the dynpros "PROCESS AFTER INPUT" will be run. add a PAI module to the dynpro and in the module you could for example make the following coding:

case sy-ucomm. " the ok code

  when 'your_buttons_function_code_here'.
    call screen YOUR_SCREEN_NUMBER_HERE.

  when others. 
    " DO NOTHING

endcase.