3

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!

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

2 Answers2

4
  • 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.
  • Hey, I tried this but for some reason nothing is happening when I click the button. I am calling the module on the PAI part of the screen. And I'm also clearing the ok_code in the PBO part. Any ideas what the problem could be? Thanks! –  May 20 '11 at 00:20
  • what happens when you first enable the debuger (enter /h in the transaction field) and then click on the button? what's the value of the sy-ucomm variable? –  May 21 '11 at 19:26
  • I don't know what the issue was but it was on my end, your code works great. Thanks! –  May 21 '11 at 23:11
1

You must create a screen & perform CALL SCREEN inside that event. There's a concept called PAO & PBO. You may refer that too. Few links for your reference..

closebrace
  • 333
  • 1
  • 4