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: 

What is AT Exit-Command in MPP

Former Member
0 Kudos
17,454

Hi all

What is AT Exit-Command in MPP...

1 ACCEPTED SOLUTION

Former Member
0 Kudos
3,470

Hi

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

code

Process After Inpt.

Module exit AT EXIT-COMMAND.

In module pool program.

Module exit.

Case Okcode.

When 'Exit'.

leave to screen 0.

3 REPLIES 3

Former Member
3,470

As a rule, type E functions should allow the user to leave the screen. Consequently, the function codes for Back (F3), Exit (Shift + F3), and Cancel (F12) usually have type E.

Calling a PAI Module for Type E Functions

When the user chooses a function with type E, the screen flow logic jumps directly to the following statement:

MODULE <mod> AT EXIT-COMMAND.

Regardless of where it occurs in the screen flow logic, this statement is executed immediately, and before the automatic checks for the field contents on the screen. Before the module <mod> is executed, the contents of the OK-CODE field are transported to the ABAP field with the same name. However, no other screen fields are transported to the program at this stage. If you have more than one MODULE statement with the AT EXIT-COMMAND addition, only the first is executed. If there are no MODULE statements with the AT EXIT-COMMAND statement, normal PAI processing resumes.

If the user chooses a function whose function code does not have type E, the MODULE <mod> AT EXIT-COMMAND statement is not executed.

The MODULE ... AT EXIT-COMMAND statement is normally used to leave the current screen without the automatic input checks taking place. You should therefore program it to contain an appropriate variant of the LEAVE statement, to leave the current screen, the call chain, or the entire program, as appropriate. If the module does not leave the screen, normal PAI processing resumes after it has finished, that is, the automatic field checks take place, and the normal PAI modules are called, with data being transported from the screen back to the program according to the sequence defined in the FIELDS statements.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm

Former Member
0 Kudos
3,470

Hi rohini,

The statement associated with at exit command is :

MODULE <module_name> AT EXIT-COMMAND.

Addition AT EXIT-COMMAND at the event PAI causes module <module_name> to be called exactly as if:

a)The function used to trigger event PAI has function type "E"

b )Into the input field of the standard toolbar, the user entered a character string starting with "E" and confirmed it using ENTER.

The dialog module is called before the automatic input checks defined in the system or in the ABAP Dictionary and independent of its position in the event block. The only screen field transported to the ABAP program is the OK field. If the function that triggered the PAI event does not fulfill any of the above prerequisites, the MODULE statement is not executed.

If several MODULE statements have the AT EXIT COMMAND addition, only the first one is executed. If no MODULE statement has the addition AT EXIT COMMAND, a normal PAI processing is executed: The predefined input checks are executed and then the PAI event block is processed sequentially. Provided the screen processing is not terminated in the dialog module mod, after the return from the dialog module, the complete PAI processing is executed. You must not use the addition AT EXIT COMMAND in connection with the statement FIELD.

The function type of a function is determined in the Screen Painter or Menu Painter. Usually those functions of the user interface are defined with function type "E" that are assigned to the icons Back, Exit and Cancel in the standard toolbar of the GUI status. Therefore, the called dialog module should terminate the screen processing and allow security checks, if required.

If you are talking about the on exit-command in report programming,

then the statement associated with it is

at selection-screen on exit-command.

Effect

This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.

Former Member
0 Kudos
3,471

Hi

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

code

Process After Inpt.

Module exit AT EXIT-COMMAND.

In module pool program.

Module exit.

Case Okcode.

When 'Exit'.

leave to screen 0.