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: 

reg. module pool....have ur points..

Former Member
0 Kudos

Hi all,

In module pool programming, we see "MODULE CANCEL AT EXIT-COMMAND" in PAI. Pleas let me know the meaning of this in simple language.....

<b>n Have ur points.</b>

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Pradeep,

Let me explain this clearly to you.

Let us assume,U r using a Screen.

In this screen,U are using a back button i.e., GUI status for BACK,and this is of EXIT type(E).

and U have made a field on the screen as mandatory (using attributes in screen painter).

Now,when u try to go out of this screen using the back button.U will get an error message<b>(Fill in all required fields)</b>

Now,our module <b>ON EXIT COMMAND</b> comes into play.

If this module is prsent in our code.It overtakes control from the mandatory filed and allows U to move out of screen using the BACK button(coz it is of EXIT type)

Reward if useful,

Imran.

6 REPLIES 6

Former Member
0 Kudos

Hi,

AT EXIT-COMMAND, only checks for the function code which is marked as 'E' in PF-STATUS, and the module below that is executed whenever you press that key associated with the function code.

AT USER-COMMAND, works for all keys with function-code.

So if you press F3, which is BACK and is usually associated with 'E' , and if you have both AT EXIT-COMMAND and AT USER-COMMAND, module below AT EXIT-COMMAND will be executed.

MODULE

Syntax

MODULE mod [ AT {EXIT-COMMAND|CURSOR-SELECTION} ]

[ ON {CHAIN-INPUT|CHAIN-REQUEST} ].

... AT EXIT-COMMAND

Effect

Addition AT EXIT-COMMAND at the event PAI causes module mod to be called exactly if:

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

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.

Note

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.

reward if it helps..

Regards,

Omkar.

Former Member
0 Kudos

Hello Pradeerp,

when we need to leave from the screen then the module which you mentioned under "MODULE CANCEL AT EXIT-COMMAND" will get executed.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

Former Member
0 Kudos

HI,

In some cases, the user may have to enter a considerable amount of data merely in order to be able to leave the screen. To avoid this, you can use special function codes with a special module call, which calls the module regardless of what the user enters on the screen.

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.

Regards,

Padmam.

Former Member
0 Kudos

Hi Pradeep,

Let me explain this clearly to you.

Let us assume,U r using a Screen.

In this screen,U are using a back button i.e., GUI status for BACK,and this is of EXIT type(E).

and U have made a field on the screen as mandatory (using attributes in screen painter).

Now,when u try to go out of this screen using the back button.U will get an error message<b>(Fill in all required fields)</b>

Now,our module <b>ON EXIT COMMAND</b> comes into play.

If this module is prsent in our code.It overtakes control from the mandatory filed and allows U to move out of screen using the BACK button(coz it is of EXIT type)

Reward if useful,

Imran.

Former Member
0 Kudos

Suppose you have one screen ,in that screen you have 5 fields .

2 fields are mandatory ,if you do not enter anything on that fields ,you get error message . some times user want to go back to sap initial screen without enter mandatory values.

if he clicks on back button ,then he will get error message.

in order to avoid those situation ,we use at exit-command,if you use at exit-command ,even user did not enter any values ,he will go back to initial screen.

real example :

goto va01 -> enter order type as OR -> enter -> you will goto second screen.

here press back button -> now you get message like sold to party is missing.

here eventhough you want to come back,now press canc or exit button.

now you are able to come back since exit or canc are within a at exit-command.

Thanks

Seshu

Former Member
0 Kudos

Hi pradeep,

at exit-command is used for moving with out entering the values in the manadatory fields

whenever u have mandatory field u should enter the value and then continue if not it shows error message, so to move from the existing screen without entering the mandatory values this is used

regards

sandhya