1

my current screen-build looks like this:

current-program

But when i try to get back from Screen 250(called screen) to 100(the calling screen) it just leaves the program.

    CASE OK_CODE.
*Navigation back to the calling screen
    WHEN 'BACK'.
      SET SCREEN 0.

I hope you guys could help me out. Thanks!

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

4 Answers4

4

You might want to try LEAVE TO SCREEN 100 instead of SET SCREEN 0.

This post gives detailed infos about it.

Jagger
  • 10,350
  • 9
  • 51
  • 93
Tobsen
  • 41
  • 1
  • It seems like the ok-code value isnt changing after i press the Back-Button. –  Nov 08 '16 at 08:46
2

Solved

ok_code = sy-ucomm.
*updating the value of the ok_code
CASE OK_CODE.
*Navigation back to the calling screen
    WHEN 'BACK'.
         SET SCREEN 0.
*all not applicable conditions        
    WHEN OTHERS.
  ENDCASE.
ENDMODULE.

Had to set ok_code = sy-ucomm because the ok_code value didnt change.

  • 2
    An excellent example why **you should have posted the entire code** in the first place. How did you expect anyone to find this with the information you gave? – vwegert Nov 08 '16 at 09:17
  • I thought the problem would be inside the OK_CODE CASE. I'll do that from now on. –  Nov 08 '16 at 09:21
  • Mark this as answer, in case it is. – Suncatcher Nov 08 '16 at 09:22
  • I can only do that after 2 days, because it's my own answer. –  Nov 08 '16 at 09:24
  • Love those international comments. First `Navigation back to the calling screen` but then `Ansonsten Alternativaktion`. Who would have thought? One can learn foreign languages by learning someone else's code written in a programming language! – Jagger Nov 08 '16 at 11:21
  • I added the first comment in english because i posted it here. My bad. I write all my comments in german. Only when i post my problems i'll write them in english. I'll edit it, thanks –  Nov 08 '16 at 11:48
  • I bet the real problem is that you did not define an OK code in screen 250. In screen painter set the OK code in the screen (it's the bottom attribute with the type OK) to OK_CODE and your original code should work. – Gert Beukema Nov 08 '16 at 23:39
  • Oh, i see! Thank you very much. I tried it and it's working! –  Nov 09 '16 at 07:53
1

Assign the OK code field in screen 250 to OK_CODE. In screen painter set the OK code in the screen (it's the bottom attribute with the type OK) to OK_CODE and your original code should work.

Gert Beukema
  • 2,510
  • 1
  • 17
  • 18
0

leave to screen 0

or

set screen 0

both variants work to return to previous screen, but it is important that you called the subsequent screen with

call screen '1234'

so it behaves like a stack of screens.

instead of

set screen '1234'

(the latter would replace the current screen with the new screen, so no "pop from screen stack" is possible)

Hartmut Pfarr
  • 5,534
  • 5
  • 36
  • 42