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

method executing multiple times when BACK button is selected in custom container

former_member185116
Active Participant
0 Likes
2,372

hello all,

we have developed a Zreport with two custom containers(on screen 9001) as shown below,

when i click a record(hot spot click) on second container,

we are calling another screen 9002 with container3 as shown below,

however the issue is when i click BACK button on screen 9002 , it's not coming back to screen 9001 in one go,

i was forced to click the BACK button multiple times, how do i eliminate this...

my code when BACK...

MODULE USER_COMMAND_9002 INPUT.


  case sy-ucomm.

    when 'BACK' .

 
       LEAVE to SCREEN 0.

   ENDCASE.


ENDMODULE.                 " USER_COMMAND_9002  INPUT

i tried with

*      call METHOD custom3->free.
*      call METHOD grid3->free.
*      CALL METHOD cl_gui_cfw=>flush.
*
*      clear : custom3,grid3.

* free:custom3,grid3.


but did not work with this also..


any suggestions...


thanks in advance...

5 REPLIES 5
Read only

PeterJonker
Active Contributor
0 Likes
1,876

Maybe a silly question, but did you try

LEAVE TO SCREEN 9001.

??

Read only

0 Likes
1,876

i tried with LEAVE TO SCREEN 9001 also,

its not working...

Read only

Former Member
0 Likes
1,876

Hi Vinay,

Have you set pf-status in PBO of that screen. If not do so and under function keys for the back button write the fcode 'BACK'. This will solve the problem. And in PAI write the leave to screen statement for 'BACK' user command.

Regards,

Taiyeb

Read only

Former Member
0 Likes
1,876

Have a look at the statement that you use to display screens:

CALL Screen xxxx.

Generally when you call something (you call a function,  or your call a subroutine etc) the location of the call is pushed onto a stack.  When you exit that subroutine or function processing continues at the point immediately after the Call.

Screens are exactly the same.  mWhen you CALL a screen the current screen is pushed onto a stack.  When you specify that you wish to leave to screen 0, this is SAP convention for saying 'return to the previous screen',  which is popped off of the stack,  so to leave to another screen you need to specify that screen number.

I have found that the combined form of 'Leave To Screen xxxx' to be a bit flaky so I always use the two statements:


Set Screen 9001.

Leave Screen.

I would also make your third screen a window rather than a full screen,  either by using a docking container or by using the 'Starting At',  'Ending At' clauses of the call screen statement.

Regards

Rich

Read only

sidda1196
Explorer
0 Likes
1,876

Hi Vinay,

I have similar issue rn. Can you please guide if you found a fix?

Regards,
Sairam