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: 

How to exit from screen?

Former Member
0 Kudos
4,426

Hi Experts,

I am new to ABAP.Can anyone please clearly(step by step) explain how to exit from the screen without entering the value to mandatory field?

I just created one screen with two fields namely : I/O field(make it as mandatory) and pushbutton(Exit).

Without entering the value to I/O field, if I click the Exit button then it should leave the program.

Can anyone please explain how to do this?

Thanks in Advance,

Regards,

Raghu

7 REPLIES 7

Former Member
0 Kudos
1,255

Hi,

Go to PF Status, double click on the button, in the Function Attributes, assign "E" for "Functional Type" option. It means that it is an Exit Command.

Exit Commands will bypass the mandatory fields.

In PAI in OK Code write, "LEAVE SCREEN" or "LEAVE PROGRAM" based on your requirement.

Reward if answer is useful.

Regards,

Hema

0 Kudos
1,255

The missing bit is that in your screen flow you will need something like:

process after input.
  module at_exit_command at exit-command. "leave from here!

The "at exit-command" part tells SAP to check any "E" type exits before applying the mandatory screen validations.

Jonathan

Former Member
0 Kudos
1,255

HII

write a module in pai

module <b>exit</b> at exit command.

double click on exit.

write inside.

IF ok_code = 'EXIT'.

SET SCREEN 0.

LEAVE PROGRAM.

ENDIF.

REWARD IF HRLPFUL

VIVEKANAND

Former Member
0 Kudos
1,255

hi,

Double click on your button(EXit) , then there is a field FctType near FctCode

select there <b>E</b>

And in the PAI.

Write one new module,

<b>Module AT_EXIT_COMMAND at EXIT-COMMAND</b>.

and in this module's defination, write

<b>leave program</b>.

thanks

Dharmishta

0 Kudos
1,255

Hi,

Thanks for answering me.I liked your answer.I want to reward your answer.Can you please let me know how to reward your answer

Former Member
0 Kudos
1,255

hi,

Assign Function code 'E' to that button in pf-status.

Made one module in PAI.

<b>Module exit_0001 at EXIT_COMMAND.</b>

<b>Module exit_0001 Input.</b>

Leave program.

<b>Endmodule.</b>

Hope it would b helpful.

REward if useful.

Message was edited by:

Dhwani shah

Message was edited by:

Dhwani shah

Former Member
0 Kudos
1,255

Hi,

Yes, Jonathan is right.

I forgot to include At Exit Command Module. Sorry.

Regards,

Hema