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: 

unable to switch to tabs in module pool.

Former Member
0 Kudos

i created one module pool program .when ever i click on tabs in screen it will go to default tab?

1 ACCEPTED SOLUTION

0 Kudos

I hope you have maintained function code for each tab , then  you would have handled the code in PAI section  .  

Please follow the below code ..

MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'TAB1'.

TABSTRIP-ACTIVETAB = 'TAB1'.

WHEN 'TAB2'.

TABSTRIP-ACTIVETAB = 'TAB2'.

WHEN 'TAB3'.

TABSTRIP-ACTIVETAB = 'TAB3'.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

Regards,

Amaresh

7 REPLIES 7

0 Kudos

I hope you have maintained function code for each tab , then  you would have handled the code in PAI section  .  

Please follow the below code ..

MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'TAB1'.

TABSTRIP-ACTIVETAB = 'TAB1'.

WHEN 'TAB2'.

TABSTRIP-ACTIVETAB = 'TAB2'.

WHEN 'TAB3'.

TABSTRIP-ACTIVETAB = 'TAB3'.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

Regards,

Amaresh

0 Kudos

THANKS FOR YOUR REPLY.

I CREATED 3 TABS, FIRST AND THIRD TAB IS WORKING BUT WHEN I SELECT SECOND TAB IT GOES TO THIRD TAB?

0 Kudos

Hi,

When you click on 2nd TAB, make sure to activate the 2nd TAB to tabstrip-activetab.

i think currently you would have set it to 3rd TAB hence it's picking 3rd one.

Regards,

Raghavendra

0 Kudos

Hi,

you are having 3 subscreen for tab strip ie. 9001,9002,9003,

and call them dynamically by provide the variable ile LV_DYNNR which holds screen number for the active tab.

TAB1  TAB2 TAB3 are name and Function code of Tabs in tabstrip :

check out this code :

IN PBO .

MODULE get_screen.

CALL SUBSCREEN <SUBSCREENAREA> INCLUDING sy-repid lv_dynnr . " variable which holds screen Number

MODULE GET_SCREEN_0100 OUTPUT.

CASE TABSTRIP-ACTIVETAB.

WHEN 'TAB1'.

LV_DYNNR = '9001'. " screen number

WHEN 'TAB2'.

LV_DYNNR = '9002. " screen number

WHEN 'TAB3'.

LV_DYNNR = '9003'. " screen number

WHEN OTHERS.

LV_DYNNR =9001." number this will be default screen of tabstrip.

ENDMODULE.

********************************IN PAI*******************************************

MODULE USER_COMMAND_0100 INPUT.

MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'TAB1'.

TABSTRIP-ACTIVETAB = 'TAB1'.

WHEN 'TAB2'.

TABSTRIP-ACTIVETAB = 'TAB2'.

WHEN 'TAB3'.

TABSTRIP-ACTIVETAB = 'TAB3'.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE.

thank you!!

former_member185116
Active Participant
0 Kudos

Hi ,

write the code as Amaresh said,

adding to that also check whether you defined the Functioncode for each tab or not

also call subscreen properly as shown,

follow these things you will not get any problem...

regards ,

vinay..

Chintu6august
Contributor
0 Kudos

Hi,

you are having 3 sub screens for tab strip ie. 9001,9002,9003,

and call them dynamically by provide the variable ile LV_DYNNR which holds screen number for the active tab.

TAB1  TAB2 TAB3 are name and Function code of Tabs in tabstrip :

check out this code :

IN PBO .

MODULE get_screen.

CALL SUBSCREEN <SUBSCREENAREA> INCLUDING sy-repid lv_dynnr . " variable which holds screen Number

MODULE GET_SCREEN_0100 OUTPUT.

CASE TABSTRIP-ACTIVETAB.

WHEN 'TAB1'.

LV_DYNNR = '9001'. " screen number

WHEN 'TAB2'.

LV_DYNNR = '9002. " screen number

WHEN 'TAB3'.

LV_DYNNR = '9003'. " screen number

WHEN OTHERS.

LV_DYNNR =9001." number this will be default screen of tabstrip.

ENDMODULE.

********************************IN PAI*******************************************

MODULE USER_COMMAND_0100 INPUT.

MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'TAB1'.

TABSTRIP-ACTIVETAB = 'TAB1'.

WHEN 'TAB2'.

TABSTRIP-ACTIVETAB = 'TAB2'.

WHEN 'TAB3'.

TABSTRIP-ACTIVETAB = 'TAB3'.

WHEN 'BACK'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE.

thank you!!

Former Member
0 Kudos

thanks for all your replies.Problem is solved as i entered function type as 'P' for all tabs.