Application Development and Automation 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: 
Read only

LEAVE TO TRANSACTION sy-tcode

Former Member
0 Likes
1,793

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

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
Read only

Former Member
0 Likes
1,244

Try using leave to screen xxx.

Venu

Read only

0 Likes
1,244

Hi,

so it would be :

leave to screen 'ME22N'

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

Thanks

Read only

Former Member
0 Likes
1,244

underlaying screen.

Read only

0 Likes
1,244

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.

Read only

0 Likes
1,244

Another route you can take is this :

SET PARAMETER ID 'BES' FIELD '9999999999'.

call transaction 'ME22N'.

Hope that works.

Read only

0 Likes
1,244

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

leave to screen 0.

Thanks everyone