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: 

LEAVE TO TRANSACTION sy-tcode

Former Member
0 Kudos

Hi,

From a function I have written, when everything I want to do is finished ( This function has a screen ) , when the user presses the back button I use:

LEAVE TO TRANSACTION sy-tcode

Which takes me back to the transaction I came from

ME22N - Purchase Order, but it does not show the purchase order I was looking at , but a previous one, or no Purchase order.

Is there an easy way to leave and go back to where you were exactly?

Thanks

6 REPLIES 6

Former Member
0 Kudos

Try using leave to screen xxx.

Venu

0 Kudos

Hi,

so it would be :

leave to screen 'ME22N'

is that correct, or do I look up the underlaying screen?

Thanks

Former Member
0 Kudos

underlaying screen.

0 Kudos

Hi,

I've just tried that, I went into ME22N , did a /H to turn on debugging, and pressed the back button, the screen is '0014'

When I put this in the function it dumps, saying the screen does not exist, itried it with 0014 and '0014',

same result each time.

Any Ideas?

Thanks.

0 Kudos

Another route you can take is this :

SET PARAMETER ID 'BES' FIELD '9999999999'.

call transaction 'ME22N'.

Hope that works.

0 Kudos

I've just managed to fix it, the solution is

leave to screen 0.

Thanks everyone