Skip to Content
avatar image
Former Member

Tabstrip coding in report

Hai,

I want to use tabstrip(with 3 different subscreens) in my report.so could any one of you can send me the coding of this.

thanks in advance

kiran

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Jul 25, 2005 at 06:26 AM

    Hi,

    I have already posted a code sample using three tab,

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/alv grid/abap code sample for tab strip in alv.pdf

    Hope this will help u.

    Get back to me if u have any queries.

    Thanks & Regards,

    Judith.

    Kindly reward points if u find this helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 25, 2005 at 06:38 AM

    Hi,

    Check this.

    http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/content.htm

    According to the tab pressed,you can write the coding in PAI and display the output in PBO.

    Following is the sample code.I am using custom container.

    CONTROLS: main_tab TYPE TABSTRIP.
    
    DATA: BEGIN OF i_main_tab,
    subscreen LIKE sy-dynnr,
    prog LIKE sy-repid VALUE
    'ZZZ_TABSTRIP',
    pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
    END OF i_main_tab.
    
    MODULE status_9001 OUTPUT.
    
    SET PF-STATUS 'ZSTATUS'.
    SET TITLEBAR 'ZTITLE'.
    
    main_tab-activetab = i_main_tab-pressed_tab.
    CASE i_main_tab-pressed_tab.
    WHEN c_main_tab-tab1.
    IF o_custom_container1 IS INITIAL.
    * Creating Object
    PERFORM f9000_objects_create.
    * Building the field catalog
    PERFORM f9001_build_field_cat TABLES i_fcat
    USING 'ZZZ_GRID'.
    * For Layout
    PERFORM f9002_layout USING sy-title c_x c_a c_x.
    i_main_tab-subscreen = '9100'.
    * Displaying data
    CALL METHOD o_alvgrid1->set_table_for_first_display
    EXPORTING
    is_variant = w_variant
    i_save = c_a
    is_layout = w_layout
    CHANGING
    it_outtab = i_grid[]
    it_fieldcatalog = i_fcat[]
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4.
    IF sy-subrc <> 0.
    MESSAGE i005 WITH text-009."Error in ALV report display
    LEAVE LIST-PROCESSING.
    ENDIF.
    endif.
    when c_main_tab-tab2.
    
    if o_custom_container2 is initial.
    
    perform f9000_objects_create1 using:
    * create custom container
    'o_custom_container2' '' '' '',
    * Create splitter container
    'o_splitter' o_custom_container2 '2' '1',
    * Create event reciever
    'o_eventreceiver' '' '' ''.
    * Creating containers for the split grids
    call method o_splitter->get_container exporting row = 1
    column = 1
    receiving container = o_container1.
    
    call method o_splitter->get_container exporting row = 2
    column = 1
    receiving container = o_container2.
    * Set where the splits on the screen comes
    call method o_splitter->set_row_height
    exporting
    id = 1
    height = 45
    exceptions
    cntl_error = 1
    cntl_system_error = 2
    others = 3.
    if sy-subrc ne 0.
    perform f9003_error_handle using text-E04.
    endif.
    perform f9000_objects_create1 using:
    * Create the alv grids
    'o_alvgrid2' o_container1 '' '',
    'o_alvgrid3' o_container2 '' ''.
    set handler o_eventreceiver->handle_double_click for o_alvgrid2.
    
    perform f9001_build_field_cat tables i_fcat1
    using 'ZZZ_GRID1'.
    
    perform f9001_build_field_cat tables i_fcat2
    using 'ZZZ_GRID2'.
    * For Layout
    PERFORM f9002_layout USING sy-title c_x c_a c_x.
    i_main_tab-subscreen = '9200'.
    if not i_grid1[] is initial.
    call method o_alvgrid2->set_table_for_first_display
    exporting
    is_variant = w_variant
    i_save = c_a
    is_layout = w_layout
    CHANGING
    it_outtab = i_grid1[]
    it_fieldcatalog = i_fcat1[]
    exceptions
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    others = 4.
    if sy-subrc <> 0.
    message i005 with text-009."Error in ALV report display
    leave list-processing.
    endif.
    * Populate the GRID2 data
    read table i_grid1 into w_grid1 index 1.
    if sy-subrc = 0.
    if not i_grid2[] is initial.
    * Generate the grid2 data.
    call method o_alvgrid3->set_table_for_first_display
    exporting
    is_variant = w_variant
    i_save = c_a
    is_layout = w_layout
    CHANGING
    it_outtab = i_grid2[]
    it_fieldcatalog = i_fcat2[]
    exceptions
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    others = 4.
    endif.
    endif.
    else.
    * No data for the entered selection criteria
    message i005 with text-010.
    leave list-processing.
    endif.
    endif.
    WHEN OTHERS.
    * DO NOTHING
    ENDCASE.
    
    ENDMODULE. " STATUS_9001 OUTPUT
    
    *&---------------------------------------------------------------------*
    *& Module MAIN_TAB_ACTIVE_TAB_GET INPUT
    *&---------------------------------------------------------------------*
    * This is used to catch the pressed tab
    *----------------------------------------------------------------------*
    MODULE main_tab_active_tab_get INPUT.
    
    
    CASE sy-ucomm.
    WHEN c_main_tab-tab1.
    i_main_tab-pressed_tab = c_main_tab-tab1.
    i_main_tab-subscreen = '9100'.
    WHEN c_main_tab-tab2.
    i_main_tab-pressed_tab = c_main_tab-tab2.
    i_main_tab-subscreen = '9200'.
    WHEN OTHERS.
    * DO NOTHING
    ENDCASE.
    
    ENDMODULE. " MAIN_TAB_ACTIVE_TAB_GET INPUT
    *&---------------------------------------------------------------------*
    *& Module USER_COMMAND_9001 INPUT
    *&---------------------------------------------------------------------*
    * This is used for user command
    *----------------------------------------------------------------------*
    MODULE user_command_9001 INPUT.
    
    CASE sy-ucomm.
    WHEN 'BACK'.
    PERFORM exit_program.
    SET SCREEN '0'.
    WHEN 'EXIT' OR 'CANC'.
    PERFORM exit_program.
    LEAVE PROGRAM.
    ENDCASE.
    
    ENDMODULE. " USER_COMMAND_9000 INPUT
    
    * For screen 9001 we need to write Flow logic as below. For subscreens, Flow logic is 
    * not required.
    
    PROCESS BEFORE OUTPUT.
    
    MODULE STATUS_9001.
    CALL SUBSCREEN main_tab_sca
    INCLUDING i_main_tab-prog i_main_tab-subscreen.
    
    *
    PROCESS AFTER INPUT.
    
    MODULE user_command_9001.
    MODULE main_tab_active_tab_get.

    If you need it in selection screen,check this link.

    http://www.sapdevelopment.co.uk/reporting/selscr/selscr_tabstrip.htm

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Jayanthi Jayaraman

      Hi Jayanthi,

      I don't know if it had helped, but the post could have certainly been more readable if you had used the formatting for your code! When you make the post, there's a button called "Code" which will preserve the formatting of your code.

      Regards,

      Anand Mandalika.

  • Jul 25, 2005 at 06:41 AM

    check this demo program for tabstrip on report selection-screen.

    REPORT  Y_TEST_TABSTRIP.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    PARAMETERS: p1(10) TYPE c,
                p2(10) TYPE c,
                p3(10) TYPE c.
    SELECTION-SCREEN END OF SCREEN 100.
    
    SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
    PARAMETERS: q1(10) TYPE c,
                q2(10) TYPE c,
                q3(10) TYPE c.
    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.

    Regards

    Raja

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 25, 2005 at 06:51 AM

    Hi,

    Tabstrips on a selection screen

    *&----


    REPORT ztabstrip LINE-SIZE 120 NO STANDARD PAGE HEADING.

    TABLES: mara, lfa1, ekpo.

    ----


    selection screen

    ----


    • Define screen 101 as subscreen

    SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t00.

    SELECT-OPTIONS matnr FOR mara-matnr.

    SELECTION-SCREEN END OF BLOCK b1.

    SELECTION-SCREEN END OF SCREEN 101.

    • Define screen 102 as subscreen

    SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.

    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.

    SELECT-OPTIONS: kunnr FOR lfa1-kunnr.

    SELECTION-SCREEN END OF BLOCK b2.

    SELECTION-SCREEN END OF SCREEN 102.

    • Define screen 103 as subscreen

    SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.

    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.

    PARAMETERS werks LIKE ekpo-werks.

    SELECTION-SCREEN END OF BLOCK b3.

    SELECTION-SCREEN END OF SCREEN 103.

    • Define tab screen

    SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.

    SELECTION-SCREEN TAB (10) name1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.

    SELECTION-SCREEN TAB (20) name2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.

    SELECTION-SCREEN TAB (30) name3 USER-COMMAND ucomm3 DEFAULT SCREEN 103.

    SELECTION-SCREEN END OF BLOCK t1.

    INITIALIZATION.

    name1 = text-n01. "Material

    name2 = text-n02. "Vendor

    name3 = text-n03. "Plant

    I hope this will help. Folloew the same for the reports

    Regs,

    Venkat Ramanan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 25, 2005 at 07:55 AM

    Hi,

    Depending up on the tabstrip name u have selected, u can hadle the queries.

    Regs,

    Venkat

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 25, 2005 at 08:16 AM

    Hey,

    Did u get it or not ??.. Loop at the screen and check for the tab strip selected and do ur piece of coding there.

    It will work.

    Regs,

    Venkat

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 25, 2005 at 08:58 AM

    Hi,

    Loop through the screen and check the screen attribut name u have selected. If it matches the tab strip name u have selected, do the necessary coding there.

    What probs ??

    Regs,

    Venkat

    Add comment
    10|10000 characters needed characters exceeded