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: 

exit screen doesn't work

Former Member
0 Kudos

Hi everyone,

In screen painter there is the code:

WHEN 'EXIT'.

LEAVE PROGRAM.

But it doesn't exit the current screen. What's the problem? (leave screen doesn't work either.)

Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In your PAI add a module as follows

MODULE EXIT_XXXX AT EXIT-COMMAND.

MODULE EXIT_XXXX.

if ok_code = 'EXIT'.

LEAVE PROGRAM.

ENDIF.

ENDMODULE.

EXIT button on the toolbar has FUNCTION TYPE 'E' only function type's can enter a module with addition AT EXIT-COMMAND.

Regards,

Raj.

11 REPLIES 11

GauthamV
Active Contributor
0 Kudos

hi,

use this.

WHEN 'EXIT'.

leave to screen 0.

but if u have any manditory fields in screen then u have to use at-exit command module.

Former Member
0 Kudos

Hi,

Use At Exit-Command.

Regrads

Guru

Former Member
0 Kudos

check the OK_CODE in Element List tab in SE51.

regards

deva

Former Member
0 Kudos

Hi,

Make sure whether the function code and ok code is assigned or not. If yes then it should work properly.

Regards,

Sathish Reddy.

Former Member
0 Kudos

Hi,

In your PAI add a module as follows

MODULE EXIT_XXXX AT EXIT-COMMAND.

MODULE EXIT_XXXX.

if ok_code = 'EXIT'.

LEAVE PROGRAM.

ENDIF.

ENDMODULE.

EXIT button on the toolbar has FUNCTION TYPE 'E' only function type's can enter a module with addition AT EXIT-COMMAND.

Regards,

Raj.

former_member188685
Active Contributor
0 Kudos

First check in Debug mode what is the ok_code value, is it EXIT or is it different from EXIT check it.,

WHEN 'EXIT'.

LEAVE PROGRAM.

I feel you mentioned the different Ok code.

Former Member
0 Kudos

Thanks all of you. In fact I defined a field as required so when I exit there is a error message 'must input the required field'. So how to solve that?

Otherwise don't know much about AT EXIT-COMMAND module and I tried it but it doesn't work...

Thanks!

0 Kudos

Check this Program

DEMO_DYNPRO_AT_EXIT_COMMAND

0 Kudos

Hi,

use this.

Process After Input.

Module exit AT EXIT-COMMAND.

in program.

Case Okcode.

When 'Exit'.

leave to screen 0.

Automatic field checks can be avoided by AT EXIT-COMMAND, Which works exactly the same way as cancel works on application tols bar.

EXIT button on the toolbar has FUNCTION TYPE 'E' only function type's can enter a module with addition AT EXIT-COMMAND

0 Kudos

Thanks Gautham. I use your code in the programme but it says '. expected after exit' when active. Seems I can't add the module exit AT-EXIT COMMAND. What's wrong?

Thanks.

Former Member
0 Kudos

hi,

i think you have written wrong FCT code.

your FCT code should be 'EXIT' in caps.

check it.

hope it may help you.

thanks,

Sachin