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

default screen in using tabstribs

Former Member
0 Likes
733

Hi,

i declare this:


SELECTION-SCREEN: BEGIN OF TABBED BLOCK MYTAB FOR 17 LINES,
                  TAB (20) T_ETI_MA USER-COMMAND PUSH_200
                                    DEFAULT SCREEN 200,
                  TAB (20) T_ETI_SD USER-COMMAND PUSH_300
                                    DEFAULT SCREEN 300,
                  TAB (20) T_ETI_KO USER-COMMAND PUSH_400
                                    DEFAULT SCREEN 400,
                  END OF BLOCK MYTAB.

and have defined the subscreens 200 300 and 400.

All is what i want, but if i execute on screnn 400 i will, that subscreen 400 is default, but after executing,

allways 200 is default? Same when i execute on screen 300.

How can i manage that the screen on which i execute stays as default.

Thanks.

regards, Dieter

Hi,

i declare this:


SELECTION-SCREEN: BEGIN OF TABBED BLOCK MYTAB FOR 17 LINES,
                  TAB (20) T_ETI_MA USER-COMMAND PUSH_200
                                    DEFAULT SCREEN 200,
                  TAB (20) T_ETI_SD USER-COMMAND PUSH_300
                                    DEFAULT SCREEN 300,
                  TAB (20) T_ETI_KO USER-COMMAND PUSH_400
                                    DEFAULT SCREEN 400,
                  END OF BLOCK MYTAB.

and have defined the subscreens 200 300 and 400.

All is what i want, but if i execute on screnn 400 i will, that subscreen 400 is default, but after executing,

allways 200 is default? Same when i execute on screen 300.

How can i manage that the screen on which i execute stays as default.

Thanks.

regards, Dieter

5 REPLIES 5
Read only

Sandra_Rossi
Active Contributor
0 Likes
687

the only reason I can imagine is that you changed mytab-dynnr = 200 during the PBO

Read only

0 Likes
687

Hi,

thanks for answer.

i have deguged and see, after executen (F8), the mytab-dynnr has changed from 0400 to 0200,

but i don't change structure mytab.

Any idea what happens or how can i avoid that changing?

Regards, Dieter.

Read only

0 Likes
687

ah okay, I think I understand now what you mean.

In fact, there is no error. You are just wondering why the program loses its last screen.

That's what happens after the end-of-selection event: the program is restarted (as if it was SUBMIT without AND RETURN). The global variables are also refreshed, except the selection screen fields.

So, you can put your processing inside AT SELECTION-SCREEN, and trigger a MESSAGE e... DISPLAY LIKE 'S' (any information message you want) so that to not trigger next events (especially start-of-selection).

Edited by: Sandra Rossi on Jun 29, 2010 5:52 PM

Read only

Former Member
0 Likes
687

YOu're correct in that SAP does initialize the screen number value when returning to the selection screen...you always end up on the first tabstrip.

I was able to overcome this in a report program I did back in 4.6c. As I recall, I set a memory id to the sy-dynnr the user was on upon execute choice (exported), and read (imported) that memory id back to return to the same screen when going back to selection (in "INITIALIZATION" event?? I remember something about needing to clear that memory id after it was read).

Unfortunately, I don't have a copy of that code...but perhaps you can figure out how to do the same by looking at the values of structure SYST or mytab after execute press and as SAP is returning to the selection screen (initialization or load-of-program events).

Read only

0 Likes
687

Hi Breakpoint,

thanks for your answer, you gave me the correct idea.

i solve it like this:


INITIALIZATION.
*
  IMPORT MYTAB  FROM MEMORY ID 'MYTAB'.
*
START-OF-SELECTION.
*
  EXPORT MYTAB  FROM MYTAB TO MEMORY ID 'MYTAB'.

Regards, Dieter