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: 

Problem in tabstrip

arindam_samanta
Participant
0 Kudos

Dear Experts,

I am facing one problem in tabstrip control. The module pool program is running. My initial active tab is first tab. I can switch from first tab to rest of tab. But I cant get back to first tab from others. OK_CODE dont have value while for others tab OK_CODE has corresponding value. It happens when I move back to first from others tab. Another thing, always active tab is first tab instead of I pressed others tab. Kindly advise how to resolve it.

My code is:

Main Program:

-------------------------------------------------------------------------------------------

REPORT  ztab_strip.

CONTROLS: tab1 TYPE TABSTRIP.

DATA: gv_subscreen TYPE char4,
       ok_code TYPE sy-ucomm.

*gv_subscreen = '1002'.
*tab1-activetab = 'TAB3'.
CALL SCREEN 1001.


*&---------------------------------------------------------------------*
*&      Module  STATUS_1001  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_1001 OUTPUT.
   SET PF-STATUS 'PF_1001'.
*  SET TITLEBAR 'xxx'.
   IF tab1-activetab IS INITIAL
     OR gv_subscreen IS INITIAL.
     tab1-activetab = 'TAB2'.
     gv_subscreen = '1002'.
     else.
       tab1-activetab = ' '.
   ENDIF.
ENDMODULE.                 " STATUS_1001  OUTPUT



*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_1001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_1001 INPUT.

   CLEAR ok_code.
   ok_code = sy-ucomm.
   CASE ok_code.
     WHEN '1ST'.
       tab1-activetab = 'TAB2'.
       gv_subscreen = '1002'.
     WHEN '2ND'.
       tab1-activetab = 'TAB3'.
       gv_subscreen = '1003'.

     WHEN '3RD'.
       tab1-activetab = 'TAB4'.
       gv_subscreen = '1004'.

     WHEN '4TH'.
       tab1-activetab = 'TAB5'.
       gv_subscreen = '1005'.

     WHEN 'EXITT'.
       LEAVE TO SCREEN 0.
     WHEN OTHERS.
   ENDCASE.

ENDMODULE.                 " USER_COMMAND_1001  INPUT

Screen flow logic

-------------------------------------------------------------------------------------------

PROCESS BEFORE OUTPUT.

   MODULE status_1001.
   CALL SUBSCREEN sub1 INCLUDING sy-repid gv_subscreen.
*
PROCESS AFTER INPUT.
   CALL SUBSCREEN sub1.
   MODULE user_command_1001.

Regards,

Arindam Samanta.

2 REPLIES 2

laurent_fournier2
Contributor
0 Kudos

Hi,

Have you assigned the correct ok_code value to the attributes of the first tab ?

0 Kudos

Hi Laurent,

Yes, I have assigned correct OK_CODE. I have changed the name of tabs. Now it is working. Something was wrong. Anyway it is working. Thanks for your reply.