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

Stop and exit subroutine process without saving data, back to standard screen.

ethantew12
Participant
0 Likes
2,942

Hi,

Currently i am triggering a user exit in PM module.

Would like to stop it like how error message work by preventing the progress from Stage A to Stage B.

Question is what syntax in ABAP will allow the user exit to trigger the stop behavior and back to the main screen without saving any data?

I tried Exit & leave, somehow it stop, but still continue to save screen data, or it just leave the standard program.

Please help.

Thanks.

1 ACCEPTED SOLUTION
Read only

ethantew12
Participant
0 Likes
1,729

I actually found a way to solve the problem.

Where i go to the PBO of the main program and enhance from it.

Solved!

Hi,

Currently i am triggering a user exit in PM module.

Would like to stop it like how error message work by preventing the progress from Stage A to Stage B.

Question is what syntax in ABAP will allow the user exit to trigger the stop behavior and back to the main screen without saving any data?

I tried Exit & leave, somehow it stop, but still continue to save screen data, or it just leave the standard program.

Please help.

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
1,729

Hi, what is transaction code where you need to implement the exit?

Read only

0 Likes
1,729

IW22, there are stage "INIT" , "AWAP" etc. i was implementing my custom code in user exit and would like to stop the progress based on condition.

Read only

0 Likes
1,729

Hi,

you need to use this exit QQMA0014 (Checks before saving a notification).

insert your logic there.

if you dont want to save the data, use

LEAVE [PROGRAM].

It will stop the processing of current ABAP program.

LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].

It will stop the processing of current ABAP program and will process another program (specified with its transaction code).

Regards

Read only

0 Likes
1,729

Hi Miguel,

thanks for your reply.

But i dont think it work for me.

Because i was trying to implement a function module inside a user exit. LEAVE [PROGRAM]. will not suit to use in this case.

The value will be clear after PAI module.


Read only

Former Member
0 Likes
1,729

Hello,

Try the following:

MESSAGE 'Your Error Message' TYPE 'W' DISPLAY LIKE 'E'.

LEAVE TO SCREEN sy-dynnr.

Hope it helps.

Rgrds,

Sravan

Read only

ethantew12
Participant
0 Likes
1,730

I actually found a way to solve the problem.

Where i go to the PBO of the main program and enhance from it.

Solved!