Application Development and Automation 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: 
Read only

exit screen doesn't work

Former Member
0 Likes
2,052

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
Read only

Former Member
0 Likes
1,554

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
Read only

GauthamV
Active Contributor
0 Likes
1,554

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.

Read only

Former Member
0 Likes
1,554

Hi,

Use At Exit-Command.

Regrads

Guru

Read only

Former Member
0 Likes
1,554

check the OK_CODE in Element List tab in SE51.

regards

deva

Read only

Former Member
0 Likes
1,554

Hi,

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

Regards,

Sathish Reddy.

Read only

Former Member
0 Likes
1,555

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.

Read only

Former Member
0 Likes
1,554

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.

Read only

Former Member
0 Likes
1,554

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!

Read only

0 Likes
1,554

Check this Program

DEMO_DYNPRO_AT_EXIT_COMMAND

Read only

0 Likes
1,554

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

Read only

0 Likes
1,554

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.

Read only

Former Member
0 Likes
1,554

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