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

Back button issue in module pool program.

pritam_baboo49
Participant
0 Likes
2,309

We have created a module pool program with 4 buttons. 2 out of 4 buttons when clicking on the button will navigate to custom tcodes and it is working fine, but when I click the back button from the custom tcodes it does not return to the 1st screen of the module pool, instead I have to click twice to come back to the first screen.

 CASE SY-UCOMM.
WHEN 'EXIT' OR 'BAC' OR 'CANCEL' OR 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CLE'.
CLEAR: wa_str-ebeln, wa_str-ebelp.
WHEN 'REP'.
CALL TRANSACTION 'ZMAT_DE'.
WHEN 'UPD'.
CALL TRANSACTION 'ZMAT_UPLOAD'.
WHEN 'SUB'.
SELECT SINGLE ebeln
ebelp FROM ekpo INTO it_str2 WHERE ebeln = wa_str-ebeln AND ebelp = wa_str-ebelp.


any help is appreciated.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
2,247

When you leave the Z-transaction, Abap will continue with the code following the CALL TRANSACTION (like for a CALL SCREEN) so in your case the flow continue after the ENDCASE, by default you don't change screen in the caller program.

  • If you want to leave the calling screen too, add a LEAVE TO SCREEN 0 after the CALL TRANSACTION (ot set 0 in the next screen attribute of the dynpro definition)

As sandra.rossi wrote, try to debug your program.

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
2,247

Please, do a debug and tell us where the code goes after clicking. Thanks.

Read only

0 Likes
2,247

Is the same happening with standard code also?

replace standard tcode with custom tcode and see.

if standard tcode is working fine, that means in custom tcode, see what written in standard tcode vs custom tcode for back button and replace accordingly.

Read only

RaymondGiuseppi
Active Contributor
2,248

When you leave the Z-transaction, Abap will continue with the code following the CALL TRANSACTION (like for a CALL SCREEN) so in your case the flow continue after the ENDCASE, by default you don't change screen in the caller program.

  • If you want to leave the calling screen too, add a LEAVE TO SCREEN 0 after the CALL TRANSACTION (ot set 0 in the next screen attribute of the dynpro definition)

As sandra.rossi wrote, try to debug your program.

Read only

Harish_Vatsa
SAP Champion
SAP Champion
2,247

Please try by adding a LEAVE TO SCREEN 0 after the CALL TRANSACTION. Best can be analyzed by debugging.