user6814009
user6814009

Reputation:

Why is my Exitbutton in my screen disabled?

I read something about the ok-code but I cant really understand how it works and how I have to implement it.

I tried implementing a MODULE in the PAI for my Buttons but they are not working either.

MODULE test INPUT.
  case sy-ucomm.
    when 'BTN_01'.
      call screen 0.
  endcase.
ENDMODULE.

Thanks!

Upvotes: 0

Views: 1208

Answers (2)

user6814009
user6814009

Reputation:

SOLVED

MODULE status_9000 OUTPUT.
  SET PF-STATUS 'STATUS9000'.
  SET TITLEBAR 'TITLE9000'.
ENDMODULE.

I had to create a PF-STATUS for my screen (i named it 'STATUS9000'). Functionbuttons-> Symbols-> Set Exit-Button FNCT-CODE EXIT

MODULE user_command_9100 INPUT.
  ok_code = sy-ucomm.
CASE ok_code.
*now if you click the red exit-button (which we gave a fnct-code[exit]) the ok_code has 'EXIT' as his value.
  WHEN 'BACK'.
    LEAVE TO SCREEN 9000.
  WHEN 'EXIT'.
    LEAVE PROGRAM.
  WHEN OTHERS.
ENDCASE.
ENDMODULE.

ok-code = 'EXIT' after we pressed the exit-button, so we are going to leave the program.

Upvotes: 0

knut
knut

Reputation: 27875

There are not enough details to give a real answer, so my answer is kind of a guess.

In your title you mention a "Exitbutton". Has the button the function type "E"?

If yes, then maybe you better use

MODULE ... AT EXIT-COMMAND.

Another hint: To see what happens, you may enter /h in the OK-code field (activate debugging, 'Hoppelmodus' :) ). Then push your button and hopefully you can see step by step what happens.

Upvotes: 1

Related Questions