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.
Showing results for 
Search instead for 
Did you mean: 

To stop the execution of the program from user exit

Former Member
0 Kudos

Hi folks,

I am using a user exit for the Tcode ME51N. I am displaying a pop up box for the user to confirm a decssion. There if they press 'YES' system will continue and the transaction is saved. if they press 'NO' user has to come out of the Program and Tcode completely.It mean the trasaction will be cancelled and the user will be SAP intial can i do it from a user exit. pls suggest me.

Thanks in advance,



Former Member
0 Kudos


When the user presses "No',

try calling : call transaction 'SESSION_MANAGER'

I guess you wrote a code when he selects 'YES',

similarly write in else loop, if he selcts 'No',

To come bak to the inital screen use/write this statement in the 'No' block : call transaction 'SESSION_MANAGER'.

This will come out of the transaction and ull get the initial SAP screen,

But make sure the exit is not called during the commit process.

Else ull get dump saying that the Normal committ process is halted.



Edited by: Srinivas Kalyan Chakravarthy on Sep 10, 2009 12:09 PM

0 Kudos

Hi Srinivas,

Thanks for your answer. But when i tried this, it saying there is no such function module.I am working in ECC 6.0 now.



0 Kudos

Its not a Function Module,

its the t-code for initial SAP screen,

Are u calling using call function ?? if yes... its not that but it is direct statement: call transaction 'SESSION_MANAGER'.

Just check this..

go to ur initial SAP screen,

go to system>status> check for transaction,

and simply use call this,

so from what evr transaction u use.. it simply calls 'SESSION_MANAGER',

check which transaction it is available in your system by the path i specified and simply call it using call transaction ' ' .!!

Check and let me know..!!!



Former Member
0 Kudos

in the user exit u ve to capture the user comand

case sy-ucomm .

when 'Yes' .

do the processing.

when 'no' .

leave transaction 'me51n' .

exit .

end case.

Hi Sachidananda, Thanks. Solved my problem. Actually i tried with LEAVE SCREEN option. it didnt work.when i used LEAVE TO TRANSACTION, it solved my problem.



Former Member
0 Kudos