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

selection screen tab

Former Member
0 Likes
1,677

Hi,

I have tabbed selection screen. When am in second tab if error occurs then first tab becomes as active tab, i want second as the active tab. Please advise on this.

Regards,

srikanth

9 REPLIES 9
Read only

Former Member
0 Likes
1,309

Hi,

if Screen-name = ' '.

Screen-tabactive = 0.

endif.

Read only

Former Member
0 Likes
1,309

hi shrikant,

kindly explain what u really want?

regards,

Sulabh

Read only

0 Likes
1,309

Hi,

I have a selection screen with 2 tabs, tab1 and tab2. Functin codes or tab1 is 'f1'

and for tab2 is 'f2'. Now i am in tab2, entered some selections and excuted. In screen

validation a error message raised. Now screen-ative tab automatically becomes 'f1', but

i want it to be 'f2'.

Regards,

srikanth

Read only

0 Likes
1,309

Hai,

I tried your scenario its working for me. use this code

IF SY-UCOMM = 'F1'. // fctcode of TAB1

TAB-activetab = 'F1' .

dynnr = '0002'.

ELSEIF SY-UCOMM = 'F2' .

TAB-activetab = 'F2' .

dynnr = '0003'.

ELSE.

TAB-activetab = 'F1'.

dynnr = '0002'.

ENDIF.

Read only

Former Member
0 Likes
1,309

hi,

kindly check this code.....

SELECTION-SCREEN BEGIN OF TABBED BLOCK tbl FOR 15 LINES.

SELECTION-SCREEN TAB (15) tbl_tab1 USER-COMMAND tab1 DEFAULT SCREEN 9001.

SELECTION-SCREEN TAB (15) tbl_tab2 USER-COMMAND tab2 DEFAULT SCREEN 9002.

SELECTION-SCREEN END OF BLOCK tbl.

SELECTION-SCREEN BEGIN OF SCREEN 9001 AS SUBSCREEN.

PARAMETERS: pa_test.

SELECTION-SCREEN END OF SCREEN 9001.

SELECTION-SCREEN BEGIN OF SCREEN 9002 AS SUBSCREEN.

SELECTION-SCREEN END OF SCREEN 9002.

PARAMETERS:

  • Hidden parameters to store the last selected tab strip

pa_dynnr LIKE tbl-dynnr NO-DISPLAY,

pa_acttb LIKE tbl-activetab NO-DISPLAY.

INITIALIZATION.

  • Descriptions of the tab strips

tbl_tab1 = 'First tab'.

tbl_tab2 = 'Second tab'.

AT SELECTION-SCREEN OUTPUT. " PBO

  • if the last choice is saved

IF NOT pa_dynnr IS INITIAL.

  • activate the last choice

tbl-dynnr = pa_dynnr.

tbl-activetab = pa_acttb.

  • clear the saved choice to make it only once

pa_dynnr = ''.

pa_acttb = ''.

ENDIF.

AT SELECTION-SCREEN. " PAI

  • if the list is started (F8)

IF sy-ucomm = 'ONLI'.

  • save the last choice

pa_dynnr = tbl-dynnr.

pa_acttb = tbl-activetab.

ENDIF.

START-OF-SELECTION.

WRITE: / tabstrip_tbl-activetab. " show which tabstrip is active

Read only

Former Member
0 Likes
1,309

Hai,

Try this code.

IF SY-UCOMM = 'FTAB1'. // fctcode of TAB1

TAB-activetab = 'FTAB1' .

dynnr = '0002'.

ELSEIF SY-UCOMM = 'FTAB2' .

TAB-activetab = 'FTAB2' .

dynnr = '0003'.

ELSE.

TAB-activetab = 'FTAB1'.

dynnr = '0002'.

ENDIF.

if your problem is not solved then paste your code i will tell where the problem occurs.

Read only

mayankmrai
Explorer
0 Likes
1,309

In the if clause whenever error comes set activetab as second tab and its done.

If you want a sample program message me

Read only

0 Likes
1,309

The problem here is in intialization event tab-activetab is getting set to default tab.

Read only

0 Likes
1,309

Thank you