‎2009 May 28 4:12 AM
Hi expert,
I need some help in creating my selection screen.
Right now i'm creating a tabbed selection screen as the code below follows.
PARAMETERS: p_test AS CHECKBOX USER-COMMAND testrun DEFAULT 'X'.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
PARAMETERS: p_offkdt TYPE sy-datum MODIF ID thr.
SELECT-OPTIONS: s_konfe FOR p0002-konfe.
SELECTION-SCREEN END OF SCREEN 100.
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN: BEGIN OF LINE,
COMMENT 1(20) text-005 MODIF ID yea
FOR FIELD p_lowdt,
POSITION POS_LOW.
PARAMETERS: p_lowdt TYPE begda MODIF ID yea,
p_updt TYPE endda MODIF ID yea.
SELECTION-SCREEN: END OF LINE.
PARAMETERS: p_keydt TYPE dats MODIF ID yea.
SELECTION-SCREEN END OF SCREEN 200.
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
PARAMETERS: p_lvdat TYPE dats MODIF ID lv.
SELECTION-SCREEN END OF SCREEN 300.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK prog_selection FOR 4 LINES,
TAB (20) button1 USER-COMMAND push1,
TAB (20) button2 USER-COMMAND push2,
TAB (20) button3 USER-COMMAND push3,
END OF BLOCK prog_selection.
Now as I'm using tab and subscreen, therefore i need to initialize the subscreen which i wanted to use which i did in the initialization event.
prog_selection-dynnr = 100.
prog_selection-activetab = 'PUSH1'.
With the above code, my default tab would be screen 100 which is the first tab.
My problem right now is, after i execute the program, and then i press the back button to go back to the selection screen, the default tab 100 is shown again while i wanted to show the last tab which was picked before the program was executed. Please kindly advise how can i solve this problem.
Many Thanks!
-Suwardi Nursalim-
‎2009 May 28 5:19 AM
Hi,
DATA: V_DYNNR TYPE SY-DYNNR VALUE '0100',
V_ACTIVETAB(4).
INITIALIZATION.
MOVE 'PUSH1' TO V_ACTIVETAB.
AT SELECTION-SCREEN OUTPUT.
prog_selection-dynnr = V_DYNNR.
prog_selection-activetab = V_ACTIVETAB.
When the user clicks each tab of the tab strip.*
CASE SY-UCOMM.
WHEN 'PUSH1'.
V_ACTIVETAB = 'PUSH1'.
(rest of your code).
WHEN 'PUSH2'.
V_ACTIVETAB = 'PUSH2'.
(rest of your code).
WHEN 'PUSH3'.
V_ACTIVETAB = 'PUSH3'.
(rest of your code).
ENDCASE.
Hope this will help you.
Regards,
Smart Varghese
‎2009 May 28 4:49 AM
Hi..
In the initialization part dont hardcode the Active tab as Push1.. Instead define a variable where you store the value of Pressed tab.. Say g_pressed_tab.. and in initialization part assign the value of active_tab to g_pressed_tab..
Hope this solves your problem...
Regards,
Kanchan
‎2011 Jan 21 4:47 AM
I am also facing same problem.
At initialization all the variables are initialized.
So how this variable be assigned?
‎2009 May 28 5:19 AM
Hi,
DATA: V_DYNNR TYPE SY-DYNNR VALUE '0100',
V_ACTIVETAB(4).
INITIALIZATION.
MOVE 'PUSH1' TO V_ACTIVETAB.
AT SELECTION-SCREEN OUTPUT.
prog_selection-dynnr = V_DYNNR.
prog_selection-activetab = V_ACTIVETAB.
When the user clicks each tab of the tab strip.*
CASE SY-UCOMM.
WHEN 'PUSH1'.
V_ACTIVETAB = 'PUSH1'.
(rest of your code).
WHEN 'PUSH2'.
V_ACTIVETAB = 'PUSH2'.
(rest of your code).
WHEN 'PUSH3'.
V_ACTIVETAB = 'PUSH3'.
(rest of your code).
ENDCASE.
Hope this will help you.
Regards,
Smart Varghese