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

Quit Transaction

Former Member
0 Likes
1,208

Hi Experts,

What is the syntax or code to quit or exit transaction just like the cancel functionality? Thanks!

Best Regards,

Kurrt

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,094

i am not sure what is your requirement exactly... but if you have to leave to another transaction then you can use LEAVE TO TRANSACTION <TCODE>.

or you can use LEAVE PROGRAM for leaving from the transaction.

regards

shiba dutta

Hi Experts,

What is the syntax or code to quit or exit transaction just like the cancel functionality? Thanks!

Best Regards,

Kurrt

3 REPLIES 3
Read only

Former Member
0 Likes
1,094

Hi,

EXIT in Loops

Basic form

EXIT.

Effect

Exits the current loop processing in loop structures such as:

DO ... ENDDO

WHILE ... ENDWHILE

LOOP ... ENDLOOP

SELECT ... ENDSELECT

Note

Outside loop structures, the system exits the current processing block (event block, dialog module, procedure). During report processing, that is, during the event blocks START-OF-SELECTION, GET, END-OF-SELECTION, the system goes to the basic list display.

SAP recommends that you use EXIT only in loops. To exit processing blocks, use the statement RETURN.

Example

DATA: SAP_COUNT TYPE I,

WA_T100 TYPE T100.

SELECT * FROM T100 INTO WA_T100 WHERE SPRSL = SY-LANGU AND

ARBGB = 'DS'.

WRITE / WA_T100-TEXT.

IF WA_T100-TEXT CS 'SAP'.

ADD 1 TO SAP_COUNT.

IF SAP_COUNT = 3.

EXIT.

ENDIF.

ENDIF.

ENDSELECT.

Note

If several loops are nested, EXIT only exits the current loop. The processing continues after the corresponding END... statement in the loop at the next higher level.

Use the Function

module TH_DELETE_MODE to close the session. If you have only one screen this will kill that

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,095

i am not sure what is your requirement exactly... but if you have to leave to another transaction then you can use LEAVE TO TRANSACTION <TCODE>.

or you can use LEAVE PROGRAM for leaving from the transaction.

regards

shiba dutta

Read only

Former Member
0 Likes
1,094

Hi Kurtt,

Even I was not able to get a clear picture of your requirement bit if you are talking about the 'Exit' button on the standard toolbar, then its Function code is 'I' and Functional Type is 'S' (ie System Function). However, I did not get why you need to know this because as far as I know, you need not implement th elogic behind standard toolbar.

SEcondly if you want to have an exit in your trnasaction, then you can give your own button with your own functio code either on the application toolbar or on the screen. You can also use the 'Leave program' or 'Leave to screen 0' statements according to your functionality or requirement in any of your case statements.