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: 

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 screen..how can i do it from a user exit. pls suggest me.

Thanks in advance,

Shyam.

6 REPLIES 6

Former Member
0 Kudos

Hii,

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.

Regards,

Srinivas!!!

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.

Thanks,

Shyam.

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..!!!

Regards,

Srinivas

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.

Thanks,

Shyam.

Former Member
0 Kudos

solved