Application Development 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: 

Return to same tabstrip on selection screen

Former Member
0 Kudos

Dear All,

I am facing problem when i click on back button, control always goes to first tabstrip.

I want if i select 2nd tabstrip on selection screen and press execute button, the report will be displayed. When click on back button, control goes to 2nd tabstrip.

Please find attached my source code:

report abc.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

PARAMETERS: p1 TYPE c LENGTH 10,

p2 TYPE c LENGTH 10,

p3 TYPE c LENGTH 10.

SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.

PARAMETERS: q1 TYPE c LENGTH 10,

q2 TYPE c LENGTH 10,

q3 TYPE c LENGTH 10.

SELECTION-SCREEN END OF SCREEN 200.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 10 LINES,

TAB (20) button1 USER-COMMAND push1,

TAB (20) button2 USER-COMMAND push2,

END OF BLOCK mytab.

INITIALIZATION.

button1 = 'Selection Screen 1'.

button2 = 'Selection Screen 2'.

mytab-prog = sy-repid.

mytab-dynnr = 100.

mytab-activetab = 'PUSH1'.

AT SELECTION-SCREEN.

CASE sy-dynnr.

WHEN 1000.

CASE sy-ucomm.

WHEN 'PUSH1'.

mytab-dynnr = 100.

WHEN 'PUSH2'.

mytab-dynnr = 200.

WHEN OTHERS.

...

ENDCASE.

...

ENDCASE.

start-of-selection.

write: p1.

write:/ q1.

Please let me know what needs to be done.

Best Regards,

Tarun

3 REPLIES 3

Former Member
0 Kudos

Hi,

clear ok_code after selecting any button.

Former Member
0 Kudos

Probably what you could do is save the tabstrip name in ABAP memory in start of selection event using EXPORT TO MEMORY statement..

Then in AT SELECTION-SCREEN OUTPUT, you could retrieve the name of selected tabstrip from memory using IMPORT FROM MEMORY statement and set the tabstrip accordingly..

~Piyush Patil

0 Kudos

Hi,

instead of export/import to memory you can store the last selected tabstrip in the hidden parameters. Such solution is in my opinion better, because you have no trouble with default tabstrip as in the export/import solution.

See the complete example here:

[http://www.kerum.pl/infodepot/00013]

regards,

Kris