ALV Block list report FILTERING

Hello All,
I am Working on ALV Block List Report. In that report i am having two Blocks.
if i set a filter for one block it is filtering that block.
My requirment is like this if iam setting a filter for one block, in the second block also have the same field, then filter should be setted to the second block aslo.
Is this possible, Can any one Help me out form this issue.
Thanks,
Feroz.

Hello All,
I am Working on ALV Block List Report. In that report i am having two Blocks.
if i set a filter for one block it is filtering that block.
My requirment is like this if iam setting a filter for one block, in the second block also have the same field, then filter should be setted to the second block aslo.
Is this possible, Can any one Help me out form this issue.
Thanks,
Feroz.

Similar Messages

  • Problem in ALV Block List

    Hi All,
    I am trying to displaying BOM explosion for materials in ALV Block list.
    I am taking the materials to be exploded from a local file. Taking the contents of the file in an internal table and then passing the parameters like material number bom application , alternative BOM to the function 'CS_BOM_EXPL_MAT_V2'
    Then I am calling the functions for ALV Block display for each material.
      But when I am displaying the data in the block display , only the BOM explosion for the last material is getting displayed.
    I am pasting the code also for ur reference.
    REPORT  zcs13                                   .
    TABLES:
            mara,
            stpo,
            t001w,
            stko.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_stb OCCURS 0.
            INCLUDE STRUCTURE zstpox.
    DATA:END OF it_stb.
    DATA: BEGIN OF it_matmaster OCCURS 0,
          matnr TYPE matnr,
          werks TYPE werks,
         stlal type stlal,
         capid type capid,
          emeng TYPE emeng,
          END OF it_matmaster.
    DATA : ievent TYPE slis_t_event.
    DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
    it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
    temp_cat TYPE slis_fieldcat_alv,
    sline TYPE slis_listheader,
    gt_list_top_of_page TYPE slis_t_listheader,
    gs_layout TYPE slis_layout_alv ,
    gt_events TYPE slis_t_event,
    gt_sort TYPE slis_t_sortinfo_alv,
    w_msg(255) TYPE c,
    int TYPE i VALUE 0.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    CONSTANTS c_x VALUE 'X'.
    DATA: w_topmat LIKE cstmat,
        fieldcat TYPE slis_t_fieldcat_alv,
         wa_fieldcat TYPE slis_fieldcat_alv.
    DATA:v_file TYPE string.
    *SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'ASC'
         has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      =  it_matmaster
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT it_matmaster.
        PERFORM explode_assembly.
       PERFORM f01_set_layo CHANGING gs_layout.
       PERFORM eventtab_build USING ievent.
    perform fldcat.
        PERFORM display_grid.
      ENDLOOP.
    PERFORM display_grid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
       i_interface_check             = 'x_print_layout'
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
    EXCEPTIONS
       program_error                 = 1
       OTHERS                        = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  EXPLODE_ASSEMBLY
          text
    FORM explode_assembly.
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          capid                 = 'BEST'
          cuols                 = c_x
          datuv                 = sy-datum
          emeng                 = it_matmaster-emeng
          knfba                 = c_x
          ksbvo                 = c_x
          mehrs                 = c_x
          mbwls                 = c_x
         mdmps                 = c_x
          mktls                 = c_x
         stlal                 = it_matmaster-stlal
         stlan                 = p_bomap
          mtnrv                 = it_matmaster-matnr
          werks                 = it_matmaster-werks
         svwvo                 = 'X'
         vrsvo                 = 'X'
        IMPORTING
          topmat                = w_topmat
        TABLES
          stb                   = it_stb
        EXCEPTIONS
          alt_not_found         = 1
          call_invalid          = 2
          material_not_found    = 3
          missing_authorization = 4
          no_bom_found          = 5
          no_plant_data         = 6
          no_suitable_bom_found = 7
          conversion_error      = 8
          OTHERS                = 9.
      IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO w_msg.
       WRITE: / w_msg.
       EXIT.
      ENDIF.
    ENDFORM.                    "explode_assembly
    *&      Form  display_grid
          text
    -->  p1        text
    <--  p2        text
    form display_grid .
    *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program                = 'ZCS13'
    i_callback_top_of_page            = 'TOP_OF_PAGE_GRID'
      is_layout                         = gs_layout
        it_fieldcat                       = fieldcat
          IT_SORT                           = GT_SORT[]
           i_save                            = 'A'
         it_events                         = gt_events[]
       TABLES
         t_outtab                          = it_stb
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'ZALVTOTAL'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
       i_callback_user_command        = 'USER_COMMAND'(001)
      IT_EXCLUDING                   =
    *CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
       is_layout                        = gs_layout
       it_fieldcat                      = i_fieldcat
       i_tabname                        = 'IT_TAB[]'
       it_events                        = gt_events
      it_sort                          = gt_sort
      I_TEXT                           = ' '
    TABLES
       t_outtab                         = it_tab[]
    EXCEPTIONS
      program_error                    = 1
      maximum_of_appends_reached       = 2
      OTHERS                           = 3
    *IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = gs_layout
        it_fieldcat                      = fieldcat
        i_tabname                        = 'IT_STB[]'
        it_events                        = gt_events
       it_sort                          = gt_sort
      I_TEXT                           = ' '
      TABLES
        t_outtab                         = it_stb[]
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
       OTHERS                           = 3
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    clear it_stb[].
    endform.                    " display_grid
    *&      Form  fldcat
          text
    -->  p1        text
    <--  p2        text
    form fldcat .
    *DATA: wa_fieldcat TYPE slis_fieldcat_alv,
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = 'ZCS13'
      I_INTERNAL_TABNAME           = 'IT_STB'
         i_structure_name             = 'ZSTPOX'
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = 'ZCS13'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Pls Suggest
    Thanks.

    Hi All,
    I am trying to displaying BOM explosion for materials in ALV Block list.
    I am taking the materials to be exploded from a local file. Taking the contents of the file in an internal table and then passing the parameters like material number bom application , alternative BOM to the function 'CS_BOM_EXPL_MAT_V2'
    Then I am calling the functions for ALV Block display for each material.
      But when I am displaying the data in the block display , only the BOM explosion for the last material is getting displayed.
    I am pasting the code also for ur reference.
    REPORT  zcs13                                   .
    TABLES:
            mara,
            stpo,
            t001w,
            stko.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_stb OCCURS 0.
            INCLUDE STRUCTURE zstpox.
    DATA:END OF it_stb.
    DATA: BEGIN OF it_matmaster OCCURS 0,
          matnr TYPE matnr,
          werks TYPE werks,
         stlal type stlal,
         capid type capid,
          emeng TYPE emeng,
          END OF it_matmaster.
    DATA : ievent TYPE slis_t_event.
    DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
    it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
    temp_cat TYPE slis_fieldcat_alv,
    sline TYPE slis_listheader,
    gt_list_top_of_page TYPE slis_t_listheader,
    gs_layout TYPE slis_layout_alv ,
    gt_events TYPE slis_t_event,
    gt_sort TYPE slis_t_sortinfo_alv,
    w_msg(255) TYPE c,
    int TYPE i VALUE 0.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    CONSTANTS c_x VALUE 'X'.
    DATA: w_topmat LIKE cstmat,
        fieldcat TYPE slis_t_fieldcat_alv,
         wa_fieldcat TYPE slis_fieldcat_alv.
    DATA:v_file TYPE string.
    *SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'ASC'
         has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      =  it_matmaster
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT it_matmaster.
        PERFORM explode_assembly.
       PERFORM f01_set_layo CHANGING gs_layout.
       PERFORM eventtab_build USING ievent.
    perform fldcat.
        PERFORM display_grid.
      ENDLOOP.
    PERFORM display_grid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
       i_interface_check             = 'x_print_layout'
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
    EXCEPTIONS
       program_error                 = 1
       OTHERS                        = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *&      Form  EXPLODE_ASSEMBLY
          text
    FORM explode_assembly.
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          capid                 = 'BEST'
          cuols                 = c_x
          datuv                 = sy-datum
          emeng                 = it_matmaster-emeng
          knfba                 = c_x
          ksbvo                 = c_x
          mehrs                 = c_x
          mbwls                 = c_x
         mdmps                 = c_x
          mktls                 = c_x
         stlal                 = it_matmaster-stlal
         stlan                 = p_bomap
          mtnrv                 = it_matmaster-matnr
          werks                 = it_matmaster-werks
         svwvo                 = 'X'
         vrsvo                 = 'X'
        IMPORTING
          topmat                = w_topmat
        TABLES
          stb                   = it_stb
        EXCEPTIONS
          alt_not_found         = 1
          call_invalid          = 2
          material_not_found    = 3
          missing_authorization = 4
          no_bom_found          = 5
          no_plant_data         = 6
          no_suitable_bom_found = 7
          conversion_error      = 8
          OTHERS                = 9.
      IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO w_msg.
       WRITE: / w_msg.
       EXIT.
      ENDIF.
    ENDFORM.                    "explode_assembly
    *&      Form  display_grid
          text
    -->  p1        text
    <--  p2        text
    form display_grid .
    *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program                = 'ZCS13'
    i_callback_top_of_page            = 'TOP_OF_PAGE_GRID'
      is_layout                         = gs_layout
        it_fieldcat                       = fieldcat
          IT_SORT                           = GT_SORT[]
           i_save                            = 'A'
         it_events                         = gt_events[]
       TABLES
         t_outtab                          = it_stb
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'ZALVTOTAL'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
       i_callback_user_command        = 'USER_COMMAND'(001)
      IT_EXCLUDING                   =
    *CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
       is_layout                        = gs_layout
       it_fieldcat                      = i_fieldcat
       i_tabname                        = 'IT_TAB[]'
       it_events                        = gt_events
      it_sort                          = gt_sort
      I_TEXT                           = ' '
    TABLES
       t_outtab                         = it_tab[]
    EXCEPTIONS
      program_error                    = 1
      maximum_of_appends_reached       = 2
      OTHERS                           = 3
    *IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = gs_layout
        it_fieldcat                      = fieldcat
        i_tabname                        = 'IT_STB[]'
        it_events                        = gt_events
       it_sort                          = gt_sort
      I_TEXT                           = ' '
      TABLES
        t_outtab                         = it_stb[]
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
       OTHERS                           = 3
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    clear it_stb[].
    endform.                    " display_grid
    *&      Form  fldcat
          text
    -->  p1        text
    <--  p2        text
    form fldcat .
    *DATA: wa_fieldcat TYPE slis_fieldcat_alv,
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = 'ZCS13'
      I_INTERNAL_TABNAME           = 'IT_STB'
         i_structure_name             = 'ZSTPOX'
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = 'ZCS13'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Pls Suggest
    Thanks.

  • Check box in ALV BLOCK List

    Hi All,
    iam Using ALV BLOCK list to print the output along with check boxes, iam able to print the output along with the check boxes but when i select any of the check box and click button on application tool bar it is going to dump  and saying,
    FIELD SYMBOL HAS NOT YET BEEN ASSIGNED.
    i populated layout with following fields.
      w_layout-box_fieldname = 'BOX'.
      w_layout-box_tabname = 'T_FINAL2'.
    Plz Help me out.
    Thanks in Advance.
    Neha

    *& Report  BCALV_TEST_BLOCK_LIST
    report  bcalv_test_block_list.
    types: g_ty_t_carrid  type standard table of alv_tab,
           g_ty_t_connid  type standard table of alv_chck,
           g_ty_t_curr    type standard table of alv_cur,
           g_ty_s_sflight type alv_t_t2,
           g_ty_s_carrid  type alv_tab,
           g_ty_s_connid  type alv_chck,
           g_ty_s_curr    type alv_cur.
    constants: con_sflight type lvc_fname value 'ALV_T_T2',
               con_scarr   type lvc_fname value 'ALV_TAB',
               con_spfli   type lvc_fname value 'ALV_CHCK',
               con_scurx   type lvc_fname value 'ALV_CUR',
               con_event_01 type lvc_fname value 'PF_STATUS_SET',
               con_event_02 type lvc_fname value 'USER_COMMAND',
               con_event_03 type lvc_fname value 'CALLER_EXIT',
               con_event_04 type lvc_fname value 'LIST_MODIFY',
               con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',
               con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',
               con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',
               con_event_08 type lvc_fname value 'REPREP_MODIFY',
               con_event_09 type lvc_fname value 'TOP_OF_PAGE',
               con_event_10 type lvc_fname value 'END_OF_PAGE',
               con_event_11 type lvc_fname value 'TOP_OF_LIST',
               con_event_12 type lvc_fname value 'END_OF_LIST',
               con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',
               con_event_14 type lvc_fname value 'END_OF_COVERPAGE',
               con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',
               con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',
               con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE'.
    DATA                                                                 *
    tables: sscrfields.   " for processing the FCODEs in Selektion screens
    include <icon>.
    include <symbol>.
    type-pools: slis, kkblo.
    types: g_ty_t_icon  type standard table of icon,
           g_ty_t_icont type standard table of icont,
           begin of g_ty_s_plane,
             carrid    type g_ty_s_sflight-carrid,
             connid    type g_ty_s_sflight-connid,
             planetype type g_ty_s_sflight-planetype,
             seatsmax  type g_ty_s_sflight-seatsmax,
           end   of g_ty_s_plane,
           g_ty_t_plane type sorted table of g_ty_s_plane
                             with unique key carrid connid,
           begin of g_ty_s_fcat_curr,
             fieldname  type lvc_fname,
             cfieldname type lvc_fname,
             currency   type lvc_s_fcat-currency,
           end   of g_ty_s_fcat_curr,
           g_ty_t_fcat_curr type sorted table of g_ty_s_fcat_curr
                                 with unique key fieldname,
           begin of g_ty_s_sort.
    include type slis_sortinfo_alv.
    types: end   of g_ty_s_sort,
           g_ty_t_sort type sorted table of g_ty_s_sort
                            with unique key spos fieldname,
           begin of g_ty_s_test,
             list_amount              type num1,
             select_amount            type i,
             only_db_info             type char1,
             db_short                 type char1,
             excp_display             type char1,
             excp_condense            type char1,
             layo_title               type lvc_s_layo-grid_title,
             layo_zebra               type char1,
             layo_no_vert_lines       type char1,
             layo_no_horiz_lines      type char1,
             layo_cell_merge          type char1,
             layo_count               type char1,
             layo_box                 type char1,
             layo_no_colhead          type char1,
             layo_column_optimize     type char1,
             layo_keys_hotspot        type char1,
             layo_no_keyfix           type char1,
             layo_no_hotspot          type char1,
             layo_hotspot_rows        type i occurs 0,
             layo_hotspot_columns     type lvc_fname occurs 0,
             layo_no_scrolling        type char1,
             layo_no_authcheck        type char1,
             layo_no_min_linesize     type char1,
             layo_min_linesize        type sylinsz,
             layo_max_linesize        type sylinsz,
             layo_group_change_edit   type char1,
             layo_get_selinfo         type char1,
             layo_confirmation_prompt type char1,
             layo_f2code              type syucomm,
             layo_reprep              type char1,
             sum_before               type char1,
             sum_no_sumline           type char1,
             sum_no_sumchoice         type char1,
             sum_numc                 type char1,
             sum_no_unitsplit         type char1,
             sum_totals_only          type char1,
             sum_totals_text          type symsgli,
             sum_no_subtotals         type char1,
             sum_no_subchoice         type char1,
             sum_subtotals_text       type symsgli,
             prnt_print               type char1,
             prnt_reserve_lines       type lvc_s_prnt-reservelns,
             prnt_no_listinfo         type char1,
             prnt_no_selinfo          type char1,
             prnt_with_title          type char1,
             prnt_footline            type lvc_s_prnt-footline,
             prnt_printinfo           type char1,
             prnt_no_coverpage        type char1,
             prnt_no_new_page         type char1,
             prnt_no_change_print_params type char1,
             color_rows               type i occurs 0,
             color_fields_column      type lvc_fname occurs 0,
             color_fields_cell        type lvc_fname occurs 0,
             fcat_no_out_fields       type lvc_fname occurs 0,
             fcat_tech_fields         type lvc_fname occurs 0,
             fcat_fix_column_fields   type lvc_fname occurs 0,
             fcat_do_sum_fields       type lvc_fname occurs 0,
             fcat_no_sum_fields       type lvc_fname occurs 0,
             fcat_curr_fields         type g_ty_t_fcat_curr,
             curr_amount              type i,
             curr_space               type char1,
             t_sort                   type g_ty_t_sort,
             no_info_popup            type char1,
             info_popup_once          type char1,
             events_info_popup        type lvc_fname occurs 0,
             events                   type lvc_fname occurs 0,
             buffer_active            type char1,
             bypassing_buffer         type char1,
           end   of g_ty_s_test,
           begin of g_ty_s_outtab.
    include type g_ty_s_sflight.
    types:   list                 type num1,
             box                  type char1,
             count                type i,
             lights               type char1,
             checkbox             type char1,
             hotspot              type char1,
             color(4)             type c,
             tabcolor             type slis_t_specialcol_alv,
             price2               type g_ty_s_sflight-price,
             currency2            type g_ty_s_sflight-currency,
             char(10)             type c,
             string               type string,
             int1                 type int1,
             int2                 type int2,
             int4                 type int4,
             numc(10)             type n,
             dec(10)              type p decimals 2,
             fltp                 type f,
             dats                 type d,
             tims                 type t,
             icon                 type icon-id,
             icon_qinfo           type icon-name,
             symbol               type icon-id,
           end   of g_ty_s_outtab,
           g_ty_t_outtab type table of g_ty_s_outtab.
    constants: con_true         type char1 value 'X',
               con_ok   type sy-ucomm value 'OK',
               con_exit type sy-ucomm value 'EXIT',
               con_canc type sy-ucomm value 'CANC',
               con_back type sy-ucomm value 'BACK'.
    data: gt_outtab1 type g_ty_t_outtab,
          gt_outtab2 type g_ty_t_outtab,
          gt_outtab3 type g_ty_t_outtab,
          gt_outtab4 type g_ty_t_outtab,
          gt_outtab5 type g_ty_t_outtab,
          gt_outtab6 type g_ty_t_outtab,
          gt_outtab7 type g_ty_t_outtab,
          gt_outtab8 type g_ty_t_outtab,
          gt_outtab9 type g_ty_t_outtab.
    data: gt_outtab   type g_ty_t_outtab with header line,
          gs_test     type g_ty_s_test.
    data: g_repid     type sy-repid.
    data: g_field     type lvc_s_fcat-fieldname,
          g_int_field type i.
          CLASS random DEFINITION
    class random definition.
      public section.
        types:
          value(16) type p decimals 0,
          numcv(15) type n.
        constants:
          max type random=>value value 4294967295.
        class-methods:
      computes a random natural number from the set {0, ..., random=>max}.
          number returning value(rval) type random=>value,
      computes a random character from the set {A-Za-z0-9}
          c returning value(rval) type char01,
      computes a random string consisting of "len" random characters
          string importing len type i
                 returning value(rval) type string,
      computes a date
          dats returning value(rval) type d,
      computes a time
          time returning value(rval) type t,
      computes a random numc from the set {low, ..., high}
          numc importing low type random=>numcv high type random=>numcv
            returning value(rval) type random=>numcv,
      computes a random integer from the set {low, ..., high}
          i importing low type i high type i
            returning value(rval) type i,
      computes a random integer from the set {low, ..., high}
          int2 importing low type int2 high type int2
               returning value(rval) type int2,
      computes a random integer from the set {low, ..., high}
          int1 importing low type int1 high type int1
               returning value(rval) type int1,
      computes a random float from the interval [low ; high]
          f importing low type f high type f
            returning value(rval) type f,
      computes a random character from the set {A-F0-9}
          hex returning value(rval) type char01,
      computes a random character from the set {0-1}
          x returning value(rval) type char01,
      method "random=>class_constructor"
          class_constructor.
      private section.
        class-data:
      precomputed maximal index (= string length - 1) of "random=>chars"
      or of "random=>x_data".
          charsmax type i,
          xmax type i,
      random number seed value.
      (Used in method "random=>number".)
          seed type random=>value.
        constants:
      characters for class-method "random=>hex"
          hex_data(100) type c value 'ABCDEF' &
                                     '0123456789',
      characters for class-method "random=>x"
          x_data(100) type c value '01',
      characters for class-metshod "random=>c"
          chars(100) type c value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' &
                                  'abcdefghijklmnopqrstuvwxyz' &
                                  '0123456789'.
    endclass.                    "random DEFINITION
          CLASS random IMPLEMENTATION
    class random implementation.
    implementation of the methods for randomizing the values
      method x.
        data: ri type i.
        ri = random=>i( low = 0  high = random=>xmax ).
        move x_data+ri(1) to rval.
      endmethod.                    "x
      method hex.
        data: ri type i.
        ri = random=>i( low = 0  high = random=>charsmax ).
        move hex_data+ri(1) to rval.
      endmethod.                    "hex
      method number.
        constants:
          a(3) type p  value 67301,        " Coefficient
          c(1) type p  value 1,            " Increment
          m(6) type p  value 4294967296.   " Modulus 2**32
        random=>seed = ( a * random=>seed + c ) mod m.
        rval = random=>seed.
      endmethod.                    "number
      method c.
        data:
          ri type i.
        ri = random=>i( low = 0  high = random=>charsmax ).
        move chars+ri(1) to rval.
      endmethod.                    "c
      method string.
        data:
          char(1) type c.
        clear rval.
        do len times.
          char = random=>c( ).
          concatenate rval char into rval.
        enddo.
      endmethod.                    "string
      method dats.
        data: l_date      type sy-datum,
              l_day(2)    type n,
              l_month(2)  type n,
              l_year(4)   type n,
              l_value     type random=>numcv,
              l_low       type random=>numcv,
              l_high      type random=>numcv.
        l_year  = sy-datum+0(4).
        l_low   = l_year - 5.
        l_high  = l_year + 5.
        l_value = random=>numc( low = l_low high = l_high ).
        l_year  = l_value+11(4).
        l_value = random=>numc( low = 1 high = 12 ).
        l_month = l_value+13(2).
        case l_month.
          when 2.
            l_high = 28.
          when 4 or 6 or 9 or 11.
            l_high = 30.
          when others.
            l_high = 31.
        endcase.
        l_value = random=>numc( low = 1 high = l_high ).
        l_day   = l_value+13(2).
        l_date+0(4) = l_year.
        l_date+4(2) = l_month.
        l_date+6(2) = l_day.
        rval = l_date.
      endmethod.                    "dats
      method time.
        data: l_time      type t,
              l_hour(2)   type n,
              l_min(2)    type n,
              l_sec(2)    type n,
              l_value     type random=>numcv.
        l_value = random=>numc( low = 0 high = 60 ).
        l_sec   = l_value+13(2).
        l_value = random=>numc( low = 0 high = 60 ).
        l_min   = l_value+13(2).
        l_value = random=>numc( low = 1 high = 24 ).
        l_hour  = l_value+13(2).
        l_time+0(2) = l_hour.
        l_time+2(2) = l_min.
        l_time+4(2) = l_sec.
        rval = l_time.
      endmethod. "time
      method numc.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method i.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method int2.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method int1.
      Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
        data: l_dec(16)   type p,
              l_char(16)  type c.
        l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
               + '0.5'.
        subtract 1 from l_dec.
        add low to l_dec.
        data: lr_type_descr  type ref to cl_abap_typedescr,
              lr_elem_descr  type ref to cl_abap_elemdescr.
        lr_type_descr =
                 cl_abap_typedescr=>describe_by_data( rval ).
        lr_elem_descr ?= lr_type_descr.
        l_char = l_dec.
        shift l_char left deleting leading space.
        rval = l_char+0(lr_elem_descr->output_length).
      endmethod.                    "i
      method f.
      Go from {0,...,random=>max} to [low;high]
        rval = ( ( high - low ) * random=>number( ) ) / random=>max
               + low.
      endmethod.                    "f
      method class_constructor.
        charsmax = strlen( chars ) - 1.
        xmax = strlen( x_data ) - 1.
        seed = 1.
      endmethod.                    "class_constructor
    endclass.                    "random IMPLEMENTATION
    SELECTION-SCREEN                                                     *
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 30,
    p_dbinfo as checkbox,
    p_dbshrt as checkbox.
    selection-screen end of block gen.
    parameters:
    p_list type num1 default 3.
    selection-screen begin of block tit with frame title text-tit.
    parameters:
    p_tit01 type lvc_s_layo-grid_title default text-p01. "TITLE
    selection-screen end of block tit.
    selection-screen begin of block lay with frame title text-lay.
    parameters:
    p_lay01 as checkbox. "ZEBRA
    selection-screen skip.
    parameters:
    p_lay02 as checkbox, "NO HORIZONTAL LINES
    p_lay03 as checkbox. "NO VERTICAL LINES
    selection-screen skip.
    parameters:
    p_lay04 as checkbox. "NO SCROLLING
    selection-screen skip.
    parameters:
    p_lay06 type syucomm,                                       "F2CODE
    p_lay07 as checkbox. "CONFIRMATION PROMPT
    selection-screen end of block lay.
    selection-screen begin of block spa with frame title text-spa.
    parameters:
    p_spa01 as checkbox, "BOX
    p_spa02 as checkbox, "COUNT FELD
    p_spa03 as checkbox, "NO COLUMN HEADERS
    p_spa04 as checkbox. "COLUMN OPTIMIZE
    selection-screen begin of block hot with frame title text-hot.
    parameters:
    p_hot01 as checkbox. "NO HOTSPOT
    parameters:
    p_hot02 as checkbox. "Hotspot auf Zeilenebene
    select-options:
    p_hotf02 for g_int_field no intervals default 1.
    parameters:
    p_hot03 as checkbox.
    select-options:
    p_hotf03 for g_field no intervals.
    selection-screen end of block hot.
    selection-screen begin of block mrg with frame title text-mrg.
    parameters:
    p_mrg01 radiobutton group mrge, "Default
    p_mrg02 radiobutton group mrge, "kein Merge
    p_mrg03 radiobutton group mrge. "Merge
    selection-screen end of block mrg.
    selection-screen begin of block out with frame title text-out.
    parameters:
    p_out01 as checkbox.
    select-options:
    p_outf01 for g_field no intervals.
    selection-screen end of block out.
    selection-screen begin of block tec with frame title text-tec.
    parameters:
    p_tec01 as checkbox.
    select-options:
    p_tecf01 for g_field no intervals.
    selection-screen end of block tec.
    selection-screen begin of block fix with frame title text-fix.
    parameters:
    p_fix01 as checkbox.
    select-options:
    p_fixf01 for g_field no intervals.
    selection-screen end of block fix.
    selection-screen begin of block txt with frame title text-txt.
    selection-screen pushbutton /1(50) text-pb2 user-command pb02.
    selection-screen end   of block txt.
    selection-screen begin of block cur with frame title text-cur.
    parameters:
    p_curanz type i,
    p_curspc as checkbox default space.
    selection-screen skip.
    select-options:
    p_curf00 for g_field no intervals.
    parameters:
    p_cur01 radiobutton group cur default 'X',
    p_curf01 type lvc_s_fcat-fieldname.
    parameters:
    p_cur02 radiobutton group cur,
    p_curf02 type g_ty_s_sflight-currency.
    selection-screen end of block cur.
    selection-screen begin of block sort with frame title text-srt.
    selection-screen pushbutton /1(20) text-pb1 user-command pb01.
    selection-screen end   of block sort.
    selection-screen end of block spa.
    selection-screen begin of block key with frame title text-key.
    parameters:
    p_key01 as checkbox, "KEYFELDER ALS HOTSPOT
    p_key02 as checkbox. "NO KEY FIXIERUNG
    selection-screen end of block key.
    selection-screen begin of block exp with frame title text-exp.
    parameters:
    p_excp01 as checkbox, "EXCEPTION
    p_excp_c as checkbox. "EXCEPTION CONDENSE
    selection-screen end of block exp.
    selection-screen begin of block sum with frame title text-sum.
    parameters:
    p_sum01 as checkbox, "SUM BEFORE
    p_sum02 as checkbox, "NUMC
    p_sum03 as checkbox, "NO UNITSPLIT
    p_sum04 as checkbox, "TOTALS ONLY
    p_sum05 as checkbox, "NO SUMCHOICE
    p_sum06 as checkbox, "NO SUMLINE
    p_sum07 type sy-msgli, "TOTALS TEXT
    p_sum08 as checkbox, "NO SUBCHOICE
    p_sum09 as checkbox, "NO SUBTOTALS
    p_sum10 type sy-msgli. "SUBTOTALS TEXT
    selection-screen begin of block dos with frame title text-dos.
    parameters:
    p_dos01 as checkbox.
    select-options:
    p_dosf01 for g_field no intervals.
    selection-screen end of block dos.
    selection-screen begin of block nos with frame title text-nos.
    parameters:
    p_nos01 as checkbox.
    select-options:
    p_nosf01 for g_field no intervals.
    selection-screen end of block nos.
    selection-screen end of block sum.
    selection-screen begin of block col with frame title text-col.
    parameters:
    p_col01 as checkbox.
    select-options:
    p_colf01 for g_int_field no intervals default 1.
    parameters:
    p_col02 as checkbox.
    select-options:
    p_colf02 for g_field no intervals.
    parameters:
    p_col03 as checkbox.
    select-options:
    p_colf03 for g_field no intervals.
    selection-screen end of block col.
    selection-screen begin of block prn with frame title text-prn.
    parameters:
    p_lpr01 as checkbox default 'X'. "GROUP CHANGE EDIT
    selection-screen skip.
    parameters:
    p_lpr02 as checkbox. "GET SELINFO
    selection-screen skip.
    parameters:
    p_lpr03 as checkbox, "NO MIN LINESIZE
    p_lpr04 type sylinsz, "MIN LINESIZE
    p_lpr05 type sylinsz. "MAX LINESIZE
    selection-screen skip.
    parameters:
    p_prn01 as checkbox, "PRINT
    p_prn02 type lvc_s_prnt-reservelns, "RESERVE LINES
    p_prn03 as checkbox, "NO LISTINFO
    p_prn04 as checkbox, "NO SELINFO
    p_prn05 as checkbox, "TITEL
    p_prn06 type lvc_s_prnt-footline, "FOOTLINE
    p_prn07 as checkbox, "PRINT INFO
    p_prn08 as checkbox, "NO COVERPAGE
    p_prn09 as checkbox, "NO NEW PAGE
    p_prn10 as checkbox. "NO CHANGE PRINT PARAMS
    selection-screen end of block prn.
    selection-screen begin of block evt with frame.
    parameters:
    p_evt01 as checkbox, "PF_STATUS_SET
    p_evt02 as checkbox. "USER_COMMAND
    selection-screen skip.
    parameters:
    p_evt03 as checkbox, "CALLER_EXIT
    p_evt04 as checkbox, "LIST_MODIFY
    p_evt05 as checkbox, "BEFORE_LINE_OUTPUT
    p_evt06 as checkbox. "AFTER_LINE_OUTPUT
    selection-screen skip.
    parameters:
    p_evt07 as checkbox, "SUBTOTAL_TEXT
    p_evt08 as checkbox. "REPREP_SEL_MODIFY
    selection-screen skip.
    parameters:
    p_evt09 as checkbox, "TOP_OF_PAGE
    p_evt10 as checkbox, "END_OF_PAGE
    p_evt11 as checkbox, "TOP_OF_LIST
    p_evt12 as checkbox. "END_OF_LIST
    selection-screen skip.
    parameters:
    p_evt13 as checkbox, "TOP_OF_COVERPAGE
    p_evt14 as checkbox. "END_OF_COVERPAGE
    selection-screen skip.
    parameters:
    p_evt15 as checkbox, "FOREIGN_TOP_OF_PAGE
    p_evt16 as checkbox. "FOREIGN_END_OF_PAGE
    selection-screen skip.
    parameters:
    p_evt17 as checkbox. "GROUPLEVEL_CHANGE
    selection-screen end of block evt.
    INITIALIZATION                                                       *
    initialization.
      perform f01_f4_field using 'SUM' space changing p_dosf01-low.
      p_dosf01-option = 'EQ'.
      p_dosf01-sign   = 'I'.
      append p_dosf01.
      perform f01_f4_field using 'SUM' space changing p_nosf01-low.
      p_nosf01-option = 'EQ'.
      p_nosf01-sign   = 'I'.
      append p_nosf01.
      perform f01_f4_field using 'KEY' space changing p_outf01-low.
      p_outf01-option = 'EQ'.
      p_outf01-sign   = 'I'.
      append p_outf01.
      perform f01_f4_field using space space changing p_tecf01-low.
      p_tecf01-option = 'EQ'.
      p_tecf01-sign   = 'I'.
      append p_tecf01.
      perform f01_f4_field using space space changing p_fixf01-low.
      p_fixf01-option = 'EQ'.
      p_fixf01-sign   = 'I'.
      append p_fixf01.
      perform f01_f4_field using 'CURR' space changing p_curf00-low.
      p_curf00-option = 'EQ'.
      p_curf00-sign   = 'I'.
      append p_curf00.
      perform f01_f4_field using 'CUKY' space changing p_curf01.
      perform f01_f4_field using space space changing p_hotf03-low.
      p_hotf03-option = 'EQ'.
      p_hotf03-sign   = 'I'.
      append p_hotf03.
      perform f01_f4_field using space space changing p_colf02-low.
      p_colf02-option = 'EQ'.
      p_colf02-sign   = 'I'.
      append p_colf02.
      perform f01_f4_field using space space changing p_colf03-low.
      p_colf03-option = 'EQ'.
      p_colf03-sign   = 'I'.
      append p_colf03.
    AT SELECTION-SCREEN                                                  *
    at selection-screen.
      case sscrfields-ucomm.
        when 'PB01'.
          call screen 1001 starting at 1 1 ending at 80 20.
        when 'PB02'.
          call screen 1002 starting at 1 1 ending at 80 20.
      endcase.
    AT SELECTION-SCREEN ON VALUE-REQUEST                                 *
    at selection-screen on value-request for p_dosf01-low.
      perform f01_f4_field using 'SUM' 'X' changing p_dosf01-low.
    at selection-screen on value-request for p_nosf01-low.
      perform f01_f4_field using 'SUM' 'X' changing p_nosf01-low.
    at selection-screen on value-request for p_outf01-low.
      perform f01_f4_field using 'KEY' 'X' changing p_outf01-low.
    at selection-screen on value-request for p_tecf01-low.
      perform f01_f4_field using space 'X' changing p_tecf01-low.
    at selection-screen on value-request for p_fixf01-low.
      perform f01_f4_field using space 'X' changing p_fixf01-low.
    at selection-screen on value-request for p_curf00-low.
      perform f01_f4_field using 'CURR' 'X' changing p_curf00-low.
    at selection-screen on value-request for p_curf01.
      perform f01_f4_field using 'CUKY' 'X' changing p_curf01.
    at selection-screen on value-request for p_hotf03-low.
      perform f01_f4_field using space 'X' changing p_hotf03-low.
    at selection-screen on value-request for p_colf02-low.
      perform f01_f4_field using space 'X' changing p_colf02-low.
    at selection-screen on value-request for p_colf03-low.
      perform f01_f4_field using space 'X' changing p_colf03-low.
    at selection-screen on value-request for p_lay06.
      perform f01_f4_fcode using space
                                 space
                        changing p_lay06.
    START-OF-SELECTION                                                   *
    start-of-selection.
      g_repid               = sy-repid.
      gs_test-select_amount = p_amount.
      gs_test-only_db_info  = p_dbinfo.
      gs_test-db_short      = p_dbshrt.
      gs_test-list_amount = p_list.
      gs_test-layo_title               = p_tit01.
      gs_test-layo_zebra               = p_lay01.
      gs_test-layo_no_horiz_lines      = p_lay02.
      gs_test-layo_no_vert_lines       = p_lay03.
      gs_test-layo_no_scrolling        = p_lay04.
      gs_test-layo_f2code              = p_lay06.
      gs_test-layo_confirmation_prompt = p_lay07.
      gs_test-layo_box                 = p_spa01.
      gs_test-layo_count               = p_spa02.
      gs_test-layo_no_colhead          = p_spa03.
      gs_test-layo_column_optimize     = p_spa04.
      gs_test-layo_no_hotspot          = p_hot01.
      if p_hot02 eq con_true.
        loop at p_hotf02.
          if not p_hotf02-low is initial.
            append p_hotf02-low to gs_test-layo_hotspot_rows.
          endif.
        endloop.
      endif.
      if p_hot03 eq con_true.
        loop at p_hotf03.
          if not p_hotf03-low is initial.
            append p_hotf03-low to gs_test-layo_hotspot_columns.
          endif.
        endloop.
      endif.
      case con_true.
        when p_mrg01.
          gs_test-layo_cell_merge          = space.
        when p_mrg02.
          gs_test-layo_cell_merge          = 'N'.
        when p_mrg03.
          gs_test-layo_cell_merge          = 'Y'.
      endcase.
      if p_out01 eq con_true.
        loop at p_outf01.
          if not p_outf01-low is initial.
            append p_outf01-low to gs_test-fcat_no_out_fields.
          endif.
        endloop.
      endif.
      if p_tec01 eq con_true.
        loop at p_tecf01.
          if not p_tecf01-low is initial.
            append p_tecf01-low to gs_test-fcat_tech_fields.
          endif.
        endloop.
      endif.
      if p_fix01 eq con_true.
        loop at p_fixf01.
          if not p_fixf01-low is initial.
            append p_fixf01-low to gs_test-fcat_fix_column_fields.
          endif.
        endloop.
      endif.
      gs_test-curr_amount = p_curanz.
      gs_test-curr_space  = p_curspc.
      if p_cur01 eq con_true or p_cur02 eq con_true.
        data: ls_fcat_curr type g_ty_s_fcat_curr.
        loop at p_curf00.
          clear ls_fcat_curr.
          if not p_curf00-low is initial.
            ls_fcat_curr-fieldname = p_curf00-low.
            case con_true.
              when p_cur01.
                ls_fcat_curr-cfieldname = p_curf01.
              when p_cur02.
                ls_fcat_curr-currency   = p_curf02.
            endcase.
            append ls_fcat_curr to gs_test-fcat_curr_fields.
          endif.
        endloop.
      endif.
      gs_test-layo_keys_hotspot        = p_key01.
      gs_test-layo_no_keyfix           = p_key02.
      gs_test-excp_display             = p_excp01.
      gs_test-excp_condense            = p_excp_c.
      gs_test-sum_before               = p_sum01.
      gs_test-sum_numc                 = p_sum02.
      gs_test-sum_no_unitsplit         = p_sum03.
      gs_test-sum_totals_only          = p_sum04.
      gs_test-sum_no_sumchoice         = p_sum05.
      gs_test-sum_no_sumline           = p_sum06.
      gs_test-sum_totals_text          = p_sum07.
      gs_test-sum_no_subchoice         = p_sum08.
      gs_test-sum_no_subtotals         = p_sum09.
      gs_test-sum_subtotals_text       = p_sum10.
      if p_dos01 eq con_true.
        loop at p_dosf01.
          if not p_dosf01-low is initial.
            append p_dosf01-low to gs_test-fcat_do_sum_fields.
          endif.
        endloop.
      endif.
      if p_nos01 eq con_true.
        loop at p_nosf01.
          if not p_nosf01-low is initial.
            append p_nosf01-low to gs_test-fcat_no_sum_fields.
          endif.
        endloop.
      endif.
      gs_test-layo_group_change_edit   = p_lpr01.
      gs_test-layo_get_selinfo         = p_lpr02.
      gs_test-layo_no_min_linesize     = p_lpr03.
      gs_test-layo_min_linesize        = p_lpr04.
      gs_test-layo_max_linesize        = p_lpr05.
      gs_test-prnt_print                  = p_prn01.
      gs_test-prnt_reserve_lines          = p_prn02.
      gs_test-prnt_no_listinfo            = p_prn03.
      gs_test-prnt_no_selinfo             = p_prn04.
      gs_test-prnt_with_title             = p_prn05.
      gs_test-prnt_footline               = p_prn06.
      gs_test-prnt_printinfo              = p_prn07.
      gs_test-prnt_no_coverpage           = p_prn08.
      gs_test-prnt_no_new_page            = p_prn09.
      gs_test-prnt_no_change_print_params = p_prn10.
      if p_col01 eq con_true.
        loop at p_colf01.
          if not p_colf01-low is initial.
            append p_colf01-low to gs_test-color_rows.
          endif.
        endloop.
      endif.
      if p_col02 eq con_true.
        loop at p_colf02.
          if not p_colf02-low is initial.
            append p_colf02-low to gs_test-color_fields_column.
          endif.
        endloop.
      endif.
      if p_col03 eq con_true.
        loop at p_colf03.
          if not p_colf03-low is initial.
            append p_colf03-low to gs_test-color_fields_cell.
          endif.
        endloop.
      endif.
      if p_evt01 eq con_true.
        append con_event_01 to gs_test-events.
      endif.
      if p_evt02 eq con_true.
        append con_event_02 to gs_test-events.
      endif.
      if p_evt03 eq con_true.
        append con_event_03 to gs_test-events.
      endif.
      if p_evt04 eq con_true.
        append con_event_04 to gs_test-events.
      endif.
      if p_evt05 eq con_true.
        append con_event_05 to gs_test-events.
      endif.
      if p_evt06 eq con_true.
        append con_event_06 to gs_test-events.
      endif.
      if p_evt07 eq con_true.
        append con_event_07 to gs_test-events.
      endif.
      if p_evt08 eq con_true.
        append con_event_08 to gs_test-events.
      endif.
      if p_evt09 eq con_true.
        append con_event_09 to gs_test-events.
      endif.
      if p_evt10 eq con_true.
        append con_event_10 to gs_test-events.
      endif.
      if p_evt11 eq con_true.
        append con_event_11 to gs_test-events.
      endif.
      if p_evt12 eq con_true.
        append con_event_12 to gs_test-events.
      endif.
      if p_evt13 eq con_true.
        append con_event_13 to gs_test-events.
      endif.
      if p_evt14 eq con_true.
        append con_event_14 to gs_test-events.
      endif.
      if p_evt15 eq con_true.
        append con_event_15 to gs_test-events.
      endif.
      if p_evt16 eq con_true.
        append con_event_16 to gs_test-events.
      endif.
      if p_evt17 eq con_true.
        append con_event_17 to gs_test-events.
      endif.
      gs_test-buffer_active            = space.
      gs_test-bypassing_buffer         = space.
    END-OF-SELECTION                                                     *
    end-of-selection.
      perform f01_call_list.
    *&      Form  f01_call_list
          text
    form f01_call_list .
      data: ls_prnt   type slis_print_alv,
            lt_excl   type slis_t_extab,
            l_exit    type char1,
            ls_exit   type slis_exit_by_user,
            l_list    type num1.
      call function 'REUSE_ALV_BLOCK_LIST_INIT'
        exporting
          i_callback_program       = g_repid
          i_callback_pf_status_set = ' '
          i_callback_user_command  = ' '
          it_excluding             = lt_excl.
      do gs_test-list_amount times.
        add 1 to l_list.
        perform f01_append_list using l_list.
      enddo.
      perform f01_set_prnt changing ls_prnt.
      call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        exporting
          i_interface_check       = ' '
          is_print                = ls_prnt
          i_screen_start_column   = 0
          i_screen_start_line     = 0
          i_screen_end_column     = 0
          i_screen_end_line       = 0
        importing
          e_exit_caused_by_caller = l_exit
          es_exit_caused_by_user  = ls_exit
        exceptions
          program_error           = 1
          others                  = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " f01_call_list
    *&      Form  f01_append_list
          text
    form f01_append_list using value(i_list) type num1.
      data: ls_layo   type slis_layout_alv,
            lt_fcat   type slis_t_fieldcat_alv,
            lt_sort   type slis_t_sortinfo_alv,
            lt_evts   type slis_t_event,
            l_tabname type slis_tabname.
      field-symbols: <l_table> type any.
      perform f01_get_outtab using i_list.
      case i_list.
        when 1.
          gt_outtab1 = gt_outtab[].
        when 2.
          gt_outtab2 = gt_outtab[].
        when 3.
          gt_outtab3 = gt_outtab[].
        when 4.
          gt_outtab4 = gt_outtab[].
        when 5.
          gt_outtab5 = gt_outtab[].
        when 6.
          gt_outtab6 = gt_outtab[].
        when 7.
          gt_outtab7 = gt_outtab[].
        when 8.
          gt_outtab8 = gt_outtab[].
        when 9.
          gt_outtab9 = gt_outtab[].
      endcase.
      perform f01_set_layo changing ls_layo.
      perform f01_set_fcat changing lt_fcat.
      perform f01_set_evts changing lt_evts.
      concatenate 'LIST_' i_list into l_tabname.
      case i_list.
        when 1.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab1
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
        when 2.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab2
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
        when 3.
          call function 'REUSE_ALV_BLOCK_LIST_APPEND'
            exporting
              is_layout                  = ls_layo
              it_fieldcat                = lt_fcat
              i_tabname                  = l_tabname
              it_events                  = lt_evts
              it_sort                    = lt_sort
              i_text                     = 'Hello'              "#EC NOTEXT
            tables
              t_outtab                   = gt_outtab3
            exceptions
              program_error              = 1
              maximum_of_appends_reached = 2
              others                     = 3.
          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-ms

  • ALV Block List

    What is ALV Block List, anybody have documentation or sample programs, mail to [email protected]
    Regards
    Vijaya

    Hi,
    Herewith i am attaching the sample report for alv block list.
    Hope it will helps u.
    REPORT  YMS_ALVBLOCK.
    Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:SLIS.
    DATA:X_LAYOUT TYPE SLIS_LAYOUT_ALV,
    T_FIELD TYPE SLIS_T_FIELDCAT_ALV,
    *--field catalog
    X_FLDCAT LIKE LINE OF T_FIELD,
    *--to hold all the events
    T_EVENTS TYPE SLIS_T_EVENT,
    X_EVENTS TYPE SLIS_ALV_EVENT,
    T_SORT TYPE SLIS_T_SORTINFO_ALV,
    X_SORT LIKE LINE OF T_SORT ,
    *--Print Layout
    X_PRINT_LAYOUT TYPE SLIS_PRINT_ALV.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE ADD_CATALOG.
      CLEAR X_FLDCAT.
      X_FLDCAT-FIELDNAME = &1.
      X_FLDCAT-SELTEXT_M = &2.
      X_FLDCAT-OUTPUTLEN = &3.
      X_FLDCAT-TECH = &4.
      X_FLDCAT-COL_POS = &5.
      X_FLDCAT-NO_ZERO = 'X'.
      X_FLDCAT-DDICTXT = 'M'.
      X_FLDCAT-DATATYPE = &6.
      X_FLDCAT-DDIC_OUTPUTLEN = &7.
      IF &6 = 'N'.
        X_FLDCAT-LZERO = 'X'.
      ENDIF.
    *--build field catalog
      APPEND X_FLDCAT TO T_FIELD.
    END-OF-DEFINITION.
    *----- data declerations.
    DATA: V_REPID LIKE SY-REPID.
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ERNAM LIKE MARA-ERNAM,
    MEINS LIKE MARA-MEINS,
    END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    END OF JTAB.
    SELECT MATNR ERNAM MEINS
    UP TO 20 ROWS
    FROM MARA
    INTO TABLE ITAB.
    SELECT MATNR MAKTX
    UP TO 20 ROWS
    FROM MAKT
    INTO TABLE JTAB.
    V_REPID = SY-REPID.
    *DISPLAY alv
    Initialize Block
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM = V_REPID.
    *Block 1:
    *INITIALIZE
    REFRESH T_FIELD. CLEAR T_FIELD.
    REFRESH T_EVENTS.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    ADD_CATALOG:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events.
    X_EVENTS-FORM = 'TOP_OF_LIST1'.
    X_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
    APPEND X_EVENTS TO T_EVENTS.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                  = X_LAYOUT
        IT_FIELDCAT                = T_FIELD
        I_TABNAME                  = 'ITAB'
        IT_EVENTS                  = T_EVENTS
        IT_SORT                    = T_SORT
      TABLES
        T_OUTTAB                   = ITAB
      EXCEPTIONS
        PROGRAM_ERROR              = 1
        MAXIMUM_OF_APPENDS_REACHED = 2
        OTHERS                     = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    REFRESH T_FIELD. CLEAR T_FIELD.
    REFRESH T_EVENTS.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    ADD_CATALOG:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events.
    X_EVENTS-FORM = 'TOP_OF_LIST2'.
    X_EVENTS-NAME = SLIS_EV_TOP_OF_LIST.
    APPEND X_EVENTS TO T_EVENTS.
    Append table block.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                  = X_LAYOUT
        IT_FIELDCAT                = T_FIELD
        I_TABNAME                  = 'JTAB'
        IT_EVENTS                  = T_EVENTS
      TABLES
        T_OUTTAB                   = JTAB
      EXCEPTIONS
        PROGRAM_ERROR              = 1
        MAXIMUM_OF_APPENDS_REACHED = 2
        OTHERS                     = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    exporting
    is_print = x_print_layout
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  top_of_list1
          text
    FORM TOP_OF_LIST1.
      SKIP 1.
      WRITE: 10 'List 1',
      /5 '----
      SKIP 1.
      FORMAT RESET.
    ENDFORM.                    "top_of_list1
    *&      Form  top_of_list2
          text
    FORM TOP_OF_LIST2.
      SKIP 1.
      WRITE: 10 'List 2',
      /5 '----
      SKIP 1.
      FORMAT RESET.
    ENDFORM.                    "top_of_list2
    Thanks,
    Shankar

  • ALV blocked list- side by side

    Hi,
    I want to display ALV blocked list side by side. ie., one list on left side and the other list on right side. Is there any possibility to display this without using split container?
    because it should be displayed without any vertical or horizondal scroll bar, since need to display some other blocks all.
    The report should be as below,
    Block 1
    Block 2   Block 3
    block 4
    block 5
    block 6
    Except Block 2 and Block 3 all blocks are dynamic, so hight and width cannot be determined before hand.
    Thanks,
    Amal

    didnt get any solution..

  • Multiple Hotspots handling in ALV Block List

    Hello All,
    This is my fisrt thread in the SDN though I am wokring in SAP area from past 5 years.
    Some business background of te block list report.
    Mine reprot is completing the flow of SD .
    first block displays the SO items.
    second block displays the Billing Information
    Third Block displays the Shippinng Information.
    Now comes to the problem.
    I have come accross a strange situation in the ALV Block list hotspot handling.
    In the first report the i want to have the hotspot for two columns.
    1. SO Document (VBAK-VBELN) and Materials status(MARA-MSTAE).
    In the User_command problem is
    slis_selfield is not retruning the field name (slis_selfield-fieldname) please can any body tell about this.
    see why I need this information is
    based on the field I want to decide the flow.
    if it is Materialstatus(Mstae) I would like to take him to Mara related information.
    If it is Sales Order Document(vbeln) I would like to take him to SO related information.
    I hope I am clear my requirement.  if not please let me know.
    I am expecting some possible answers for it.
    Thanks and Regards,
    Shankar
    PS: It is returning the tablename but it doesnt solve the problem bcz both columns(or fields) belongs to the same row. so I really cant distinguish from where i have got the hotspot click.

    Can you debug why the fieldname is not returned? This is strange.
    Usually I use this code and it always works:
    FORM f_user_command USING f_ucomm     TYPE sy-ucomm         "#EC CALLED
                                                   i_selfield      TYPE slis_selfield.
      CHECK f_ucomm = '&IC1'.
      CLEAR wa_report.
      READ TABLE t_report
            INTO wa_report
           INDEX i_selfield-tabindex.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      CASE i_selfield-fieldname.
    *   Drill down to STR
        WHEN 'BANFN'.
          CHECK wa_report-banfn IS NOT INITIAL.
          SET PARAMETER ID 'BAN' FIELD wa_report-banfn.
          CALL TRANSACTION 'ME53N' AND SKIP FIRST SCREEN.
    *   Drill down to STO
        WHEN 'EBELN'.
          CHECK wa_report-ebeln IS NOT INITIAL.
          SET PARAMETER ID 'BES' FIELD wa_report-ebeln.
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
    ENDCASE.

  • Issue with Secondary list display in ALV BLocked List

    Hi all,
    I am using ALV Blocked List consissting of 3 blocks.
    For my requirement, in the 1st block, I need to make a colum clickable, for which I have used the User_Command Event.
    But this is not working. The second list is not gettin displayed.
    Here'z my code:
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
          EXPORTING
            i_callback_program             = v_repid
           i_callback_top_of_page       = 'TOP-OF-PAGE'            "see FORM
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      IT_EXCLUDING                   =
      REFRESH: it_events[].
      wa_events-name = slis_ev_top_of_list.
      wa_events-form = 'FIRST_HEADING'.
      APPEND wa_events TO it_events.
      wa_events-name = slis_ev_user_command.
      wa_events-form = 'USER_COMMAND'.
      APPEND wa_events TO it_events.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = v_layout
          it_fieldcat                      = it_disptab_field[]
          i_tabname                        = 'DISPTAB'
          it_events                        = it_events[]                  " Call 1st  BLOCK TO BE APPENDED For SALES ANALYSIS
      IT_SORT                          =
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_disptab
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 2
         OTHERS                           = 3.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
           READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.
           IF rs_selfield-fieldname = 'KUNAG'.
               WRITE:/1  'invoice',
                 10   'Quantity in Base Unit',
                 20   'Base Unit',
                 30   'Qty in KL',
                 40   'Price'.
          ENDIF.
       ENDCASE.
    ENDFORM.                    " USER_COMMAND
    Please Help..

    Hi Ganesh,
    Thanks for your reply. I have already used hotspot on the fieldcat of the clickable field.  But it seems that except for the hand cursor appearing only on that field, the other columns are also clickable.
    Moreover, only the fiirst block should be clickable but all the blocks are applying the user_command.
    This might be due to the REUSE_ALV_BLOCK_LIST_INIT Function Module, which applies to all the blocks.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
          EXPORTING
            i_callback_program             = v_repid
           i_callback_top_of_page       = 'TOP-OF-PAGE'            "see FORM
      I_CALLBACK_PF_STATUS_SET       = ' '
       i_callback_user_command        = 'USER_COMMAND'
      IT_EXCLUDING                   =
    In orser to avoid this, I am using the following code, which can be a temporary solution to the problem.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      DATA: row_count TYPE sy-lilli.
      CASE r_ucomm.
        WHEN '&IC1'.
          DESCRIBE TABLE it_disptab LINES row_count.
          READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.
          IF rs_selfield-tabindex LE row_count AND rs_selfield-tabindex ne 0 AND rs_selfield-tabname = 'DISPTAB'.
            PERFORM get_data.
            PERFORM build_fieldcat.
            PERFORM display_second_list.
          ELSE.
            EXIT.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND

  • Sving layout with ALV block list

    1) I am not able to save layout for alv block. How this can be done?
    2) Can this be saved for all blocks if the fields of all blocks are the same?

    Hi,
    1. not possible with the ALV BLOCK list.
    2. No option avaialble for this in case of Block list.
    for normal list you have variant option.
    Regards
    vijay

  • Events in ALV block list

    Hi,
    Im using ALV block list to display the output. In that one column is highlighted using HOT SPOT. I have to capture that event and display the information as pop-up.
    can anyone tell me how to do this?
    Thanks,
    Amal

    Hi
    Check with the Handling the Hot spot
    hot spot
    ALV GRID HOT Spot
    and the coming value populate to the function module....for the POP-UP.
    Regards!
    Edited by: Prasanth on Feb 26, 2009 8:12 PM

  • Printing issue in ALV Block List

    Hello,
    I had created an ALV Block List containing 2 blocks and it has a header also. When I print, each block is printed on separate papers. Moreover before printing a block, a block is printed saying Number of records passed which will also be printed on separate paper. Thus to print a single page I will get 4 page print out in Dotmatrix printer.
    Can anyone say how to avoid printing the Number of Records and also to print both blocks in a single page.
    Regards,
    Abijith

    Hi,
    DATA : IS_PRINT       TYPE  SLIS_PRINT_ALV.
      IS_PRINT-NO_PRINT_SELINFOS  = 'X'.
      IS_PRINT-PRINT              = 'X'.
      IS_PRINT-NO_PRINT_LISTINFOS = 'X'.
      IS_PRINT-NO_NEW_PAGE        = 'X'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
       IS_PRINT                      = IS_PRINT.
    Pass those values to the FM.
    Regards,
    Sri

  • Calling ALV Block List twice

    Hi all,
    I am calling ALV block list twice. In I block list user selects any record and then clicks on a button and then control goes to II block list. My problem is that when i come back from II to I list, and select any new record, the selected values in internal table passed in I list are not reflected in that table.
    I think this problem is because we are displaying different tables in these 2 lists. When we go to II list, the ALV block list is gettting reinitialized and on coming back, the above problem occurs.
    If you have any inputs, please let me know.
    Thanks in advance.
    Regards,
    Ridhima.

    Hi all,
    I am calling ALV block list twice. In I block list user selects any record and then clicks on a button and then control goes to II block list. My problem is that when i come back from II to I list, and select any new record, the selected values in internal table passed in I list are not reflected in that table.
    I think this problem is because we are displaying different tables in these 2 lists. When we go to II list, the ALV block list is gettting reinitialized and on coming back, the above problem occurs.
    If you have any inputs, please let me know.
    Thanks in advance.
    Regards,
    Ridhima.

  • ALV Block List Subtotal

    I have an ALV Block List and in the block list there are multiple currencies and amounts. When i use the subtotal button the expected output is to display calculated total amounts for each of the currencies.
    Whats actually happening is that the total is returning an X.
    Please note that i have used the field catalog field of cfieldname for the amount.
    I also noticed that this only happens when using ALV Block List but when the same thing is done in ALV List totals are being calculated by currency as expected.

    I am having the same problem. Does anyone have the answer?
    Regards,
    Greg

  • Displaying Average of Columns in ALV Blocked List Display

    Hi,
    I am using ALV Blocked List Display. For the 1st block, I need to display the average of certain columns.
    I am using the following code in the field catalog of the RATE column to display the average , but it is not displayed.
    wa_disptab_field-col_pos = 8.
      wa_disptab_field-fieldname = 'RATE''.
      wa_disptab_field-ref_tabname = 'IT_DISPTAB'.
      wa_disptab_field-seltext_m = 'RS PER KL'.
      wa_disptab_field-do_sum  =  'C'.
      wa_disptab_field-datatype  = 'QUAN'.
      append wa_disptab_field to it_disptab_field.
      clear wa_disptab_field.
    For the same column, the sum is displayed with the same code if I change this part:
    wa_disptab_field-do_sum  =  'C'.   To   wa_disptab_field-do_sum  =  'X'.
    Please Help..

    Hi Debarati,
    go For function/pattern [reuse_alv_grid_display_lvc]
    do the following as mentioned in the previous reply's.
    And  To find the Average of your requirement, pass the field names as per the requirement. 
    gs_sort-fieldname = 'RATE'.
    gs_sort-tabname = 'T_DISPTAB' "Final Internal table
    gs_sort-subtot = 'X'.
    APPEND gs_sort TO gt_sort.
    gs_sort-fieldname = 'RATE1'.
    gs_sort-tabname = 'T_DISPTAB' "Final Internal table
    gs_sort-subtot = 'X'.
    APPEND gs_sort TO gt_sort.
    gs_sort-fieldname = 'RATE2'.
    gs_sort-tabname = 'T_DISPTAB' "Final Internal table
    gs_sort-subtot = 'X'.
    APPEND gs_sort TO gt_sort.
    gs_sort-fieldname = 'RATE3'.
    gs_sort-tabname = 'T_DISPTAB' "Final Internal table
    gs_sort-subtot = 'X'.
    APPEND gs_sort TO gt_sort.
    CALL FUNCTION ' REUSE_ALV_GRID_DISPLAY_lvc'
       EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat              = wa_disptab
          it_events               = gt_events
          it_sort                   = gt_sort
          i_default               = 'X'
          i_save                  = 'U'
        TABLES
          t_outtab                = gt_final
       EXCEPTIONS
         program_error                  = 1
         OTHERS                         = 2
      IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    i think this will  workout.
    Thanks & Regards,
    Abhisek
    Edited by: Abhisek Pradhan on Sep 29, 2011 7:55 PM

  • Problem while using Alv Block List

    HI All,
    PLZ help me .
    By using this code I select data from TXT file and insert data in CS13 transaction then I want to show each material which present in TXT file as ALV BLOCK DISPLAY.
    Suppose txt file contain 4 material so report will show 4 list block .means data of every material showing in different blocks in the report.
    Code which I am using showing showing data only for last material which present in the table it_matmaster in every block.
    Please guide me what is the problem.
    I am pasting changed code for you.
    i am using below codes..........
    *& Report  ZCS13                                                       *
    REPORT  zcs13                                   .
    TABLES:
            mara,
            stpo,
            t001w,
            stko.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_stb OCCURS 0.
            INCLUDE STRUCTURE zstpox.
    DATA:END OF it_stb.
    DATA: BEGIN OF it_matmaster OCCURS 0,
          matnr TYPE matnr,
          werks TYPE werks,
         stlal type stlal,
         capid type capid,
          emeng TYPE emeng,
          END OF it_matmaster.
    DATA : ievent TYPE slis_t_event.
    DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
    it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
    temp_cat TYPE slis_fieldcat_alv,
    sline TYPE slis_listheader,
    gt_list_top_of_page TYPE slis_t_listheader,
    gs_layout TYPE slis_layout_alv ,
    gt_events TYPE slis_t_event,
    gt_sort TYPE slis_t_sortinfo_alv,
    w_msg(255) TYPE c,
    int TYPE i VALUE 0.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    CONSTANTS c_x VALUE 'X'.
    DATA: w_topmat LIKE cstmat,
        fieldcat TYPE slis_t_fieldcat_alv ,
         wa_fieldcat TYPE slis_fieldcat_alv.
    DATA:v_file TYPE string.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'ASC'
         has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      =  it_matmaster
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'ZCS13'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
       i_callback_user_command        = ''
      IT_EXCLUDING                   =
    PERFORM fldcat.
      LOOP AT it_matmaster.
        PERFORM explode_assembly.
        PERFORM fldcat.
        PERFORM append_blocklist.
       PERFORM alv_display_grid.
      ENDLOOP.
      PERFORM alv_display_grid.
    *&      Form  EXPLODE_ASSEMBLY
          text
    FORM explode_assembly.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
      EXPORTING
        capid                 = 'BEST'
        cuols                 = c_x
        datuv                 = sy-datum
        emeng                 = it_matmaster-emeng
        knfba                 = c_x
        ksbvo                 = c_x
        mehrs                 = c_x
        mbwls                 = c_x
         mdmps                 = c_x
        mktls                 = c_x
         stlal                 = it_matmaster-stlal
         stlan                 = p_bomap
        mtnrv                 = it_matmaster-matnr
        werks                 = it_matmaster-werks
         svwvo                 = 'X'
         vrsvo                 = 'X'
      IMPORTING
        topmat                = w_topmat
      TABLES
        stb                   = it_stb
      EXCEPTIONS
        alt_not_found         = 1
        call_invalid          = 2
        material_not_found    = 3
        missing_authorization = 4
        no_bom_found          = 5
        no_plant_data         = 6
        no_suitable_bom_found = 7
        conversion_error      = 8
        OTHERS                = 9.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO w_msg.
       WRITE: / w_msg.
       EXIT.
    ENDIF.
    ENDFORM.                    "explode_assembly
    *&      Form  fldcat
          text
    -->  p1        text
    <--  p2        text
    FORM fldcat .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = 'ZCS13'
      i_internal_tabname           = 'IT_STB'
         i_structure_name             = 'ZSTPOX'
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = 'ZCS13'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " fldcat
    *&      Form  alv_display_grid
          text
    -->  p1        text
    <--  p2        text
    FORM alv_display_grid .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         EXPORTING
           i_interface_check             = 'x_print_layout'
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
         EXCEPTIONS
           program_error                 = 1
           OTHERS                        = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " alv_display_grid
    *&      Form  append_blocklist
          text
    -->  p1        text
    <--  p2        text
    FORM append_blocklist .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = gs_layout
          it_fieldcat                      = fieldcat
          i_tabname                        = 'IT_STB[]'
          it_events                        = gt_events
         it_sort                          = gt_sort
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_stb[]
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 2
         OTHERS                           = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " append_blocklist

    Hi ,
    Use the upload function 'WS_UPLOAD' . Declare ITAB of type table of your choice.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME                = FILENAME( Has to specified by you )
                FILETYPE                = 'ASC'
           TABLES
                DATA_TAB                = ITAB
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                FILE_OPEN_ERROR         = 2
                FILE_READ_ERROR         = 3
                INVALID_TYPE            = 4
                NO_BATCH                = 5
                UNKNOWN_ERROR           = 6
                INVALID_TABLE_WIDTH     = 7
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
    LOOP AT ITAB.
    Use Split function to seperate the fields of the Internal table and append to a new Internal table of your choice.
    ENDLOOP.

  • ALV grid list  report when selected  from  selection screen

    Hi folks,
                I need to get ALV grid display in my list report when selected the interval values from  the selection screen. If I change the values in list of ALV grid it needs to be updated when I press UPDATE pushbutton. The output of list should be in ALV grid display.I need sorting ,flitering,totaling functionality in the list output.
    For example if I selected BUKRS = 100 and 200 in the selection screen ,I need to display the ALV grid list in below the selection screen as ALV grid display...
    Its urgent as  I am new to ALV grid functionality...
    Thanks in advance..

    hi raja,
    check with the folllowing code.
    REPORT zca0m_zca0fcstftop NO STANDARD PAGE HEADING
                                    MESSAGE-ID zcsv_usrtbl_maintain.
    Type pools                                                           *
    TYPE-POOLS : slis.                          " Used for ALV display
    Tables
    TABLES: zca0fcstftop,
            dd04t,                         "R/3 DD: Data element texts
            tactt.                         "Activities that can be protected
    internal tables
    DATA: BEGIN OF wa_zca0fcstftop .
            INCLUDE STRUCTURE zca0fcstftop.
    DATA: END OF wa_zca0fcstftop.
    DATA: t_zca0fcstftop LIKE STANDARD TABLE OF wa_zca0fcstftop.
    DATA: BEGIN OF i_fcode OCCURS 0,
            fcode LIKE sy-ucomm,
          END OF i_fcode.
    *Record for variant selection
    DATA : BEGIN OF ws_variant,
             selected TYPE c,
             variant  LIKE ltdx-variant,  "Variant name
             text     LIKE ltdxt-text,    "Variant description
           END OF ws_variant.
    *Table for variant selection
    data : itab_variant LIKE STANDARD TABLE OF ws_variant WITH HEADER LINE.
    Variant selection pop-up global variables
    DECLARATION OF TABLECONTROL 'VARIANT_CNTL' ITSELF
    CONTROLS: variant_cntl TYPE TABLEVIEW USING SCREEN 0200.
    LINES OF TABLECONTROL 'VARIANT_CNTL'
    DATA:     g_variant_cntl_lines  LIKE sy-loopc.
    DATA:grid1 TYPE REF TO  cl_gui_alv_grid ,
         g_custom_container TYPE REF TO cl_gui_custom_container.
    Work fields
    DATA: table_name LIKE dd02l-tabname,   "To store table name
          field_name LIKE dd03l-fieldname, "To Store Field Name
          act_auth LIKE tactz-actvt,       "To pass Activity ID
          tab_maint LIKE dd02l-tabname,    "To pass Table Name to be Maintd.
          wg_confirm_ind,                  "To trap User responses
          flag,                            "To trap changes made to an entry
          f_copy,                          "To Identify 'COPY' Command Use
          f_select,                        "To decide between Select-options
                                           " and Internal Table
          l_transaction_code LIKE tstc-tcode,
          v_langu LIKE sy-langu,
          v_repid LIKE sy-repid,
          s_variant TYPE disvariant.
    DATA: ok_code LIKE sy-ucomm.
    DATA:selected_rows TYPE lvc_t_row  ,
         sel_rows TYPE lvc_t_row WITH HEADER LINE.
    DATA:t_lines TYPE i.
    Constants                                                            *
    CONSTANTS :
               c_x TYPE c VALUE 'X',             " Constant 'X'.
               c_f TYPE c VALUE 'F'.             " Constant 'F'.
    Parameters and Selection Options
    *Selection Screen for table maintenance
    *Selection option for Plant
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-b01.
    PARAMETERS:  p_werks   LIKE zca0fcstftop-werks OBLIGATORY.
    SELECT-OPTIONS: s_prdfml  FOR zca0fcstftop-product_family,
                    s_bmach   FOR zca0fcstftop-base_machine,
                    s_factop FOR zca0fcstftop-factory_top,
                    s_optval  FOR zca0fcstftop-option_value,
                    s_week    FOR zca0fcstftop-week.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-b02.
    PARAMETERS     : p_varant LIKE ltdx-variant.          " ALV variant
    SELECTION-SCREEN END OF BLOCK block2.
    At selection screen                                                  *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varant.
      PERFORM alv_variant_f4 CHANGING p_varant.
    AT SELECTION-SCREEN ON p_werks .
    Validating Plant on the selection screen
      PERFORM validate_plant.
    Initialization
    INITIALIZATION.
    Check Authorization for the Transaction
    Authorization Check For T Code
      SELECT tcode
         INTO l_transaction_code
         FROM tstc UP TO 1 ROWS
         WHERE pgmna = sy-repid.
      ENDSELECT.
      AUTHORITY-CHECK OBJECT 'S_TCODE'
                          ID 'TCD' FIELD l_transaction_code.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH l_transaction_code.
      ENDIF.
      v_langu = sy-langu.                             " language
      v_repid = sy-repid .                            " abap Program name
    Start Of Selection
    START-OF-SELECTION.
      CALL SCREEN 0050.
    *&      Form  validate_plant                                           *
          Validating Plant on the selection screen                       *
    FORM validate_plant .
      DATA : l_werks LIKE t001w-werks.                          " Plant
      IF p_werks IS NOT INITIAL.
        SELECT SINGLE werks
            FROM t001w
            INTO l_werks
            WHERE werks EQ p_werks.
        IF sy-subrc NE 0.
          MESSAGE e100(ra) WITH text-001 .
        ENDIF.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'Z_PP_PLANT'
               ID 'ACTVT' FIELD '03'
               ID 'WERKS' FIELD p_werks
               ID 'TCD' FIELD l_transaction_code.
      IF sy-subrc NE 0.
        MESSAGE e000(oo) WITH 'No authorization for plant:'(e80) p_werks.
      ENDIF.
    ENDFORM.                    " validate_plant
    *&      Form  get_data                                                 *
          Get data                                                       *
    FORM get_data .
      SELECT * FROM zca0fcstftop
        INTO TABLE t_zca0fcstftop
        WHERE werks           = p_werks
          AND product_family IN s_prdfml
          AND base_machine   IN s_bmach
          AND factory_top    IN s_factop
          AND option_value   IN s_optval
          AND week           IN s_week.
    ENDFORM.                    " get_data
    *&      Form  fill_fcode
    FORM fill_fcode USING    value(p_0029).
      i_fcode-fcode = p_0029.
      APPEND i_fcode.
      CLEAR i_fcode.
    ENDFORM.                               " fill_fcode
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'UPDATE'.
      CLEAR flag.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  MODIFY_0100  OUTPUT
    MODULE modify_0100 OUTPUT.
      IF sy-ucomm = 'CHNG' OR
           sy-ucomm = 'PICK'.
        LOOP AT SCREEN.
          CHECK screen-group1 = 'CHG'.
          screen-required = '0'.
          screen-output   = '1'.
          screen-input    = '0'.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    Check if you are in create mode & if yes then set the screen elements
    as mandatory
      IF ok_code = 'CREA'.
        LOOP AT SCREEN.
          CHECK screen-group1 = 'CHG'.
          screen-required = '1'.
          screen-output   = '1'.
          screen-input    = '1'.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    ENDMODULE.                             " MODIFY_0100  OUTPUT
    *&      Module  Check_Exit  INPUT
          text
    MODULE check_exit INPUT.
      IF ( sy-ucomm = 'BACK' OR sy-ucomm = 'CANC' OR sy-ucomm = 'EXIT' ) AND
           ( flag = 'Y' ).
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
          EXPORTING
            defaultoption  = 'Y'
            textline1      = text-008
            textline2      = text-009
            titel          = text-004
            cancel_display = ' '
          IMPORTING
            answer         = wg_confirm_ind.
        CASE wg_confirm_ind.
          WHEN 'J'.                                             "Yes
            sy-ucomm = 'SAVE'.
            CLEAR flag.
          WHEN 'N'.                                             "No
            sy-ucomm = 'BACK'.
            CLEAR flag.
        ENDCASE.
      ENDIF.
    ENDMODULE.                             " Check_Exit  INPUT
    *&      Module  Exit_0100  INPUT
          text
    MODULE exit_0100 INPUT.
      SET SCREEN 0. LEAVE SCREEN.
    ENDMODULE.                             " Exit_0100  INPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'SAVE'.                       "Save
        Check to see if the user has the appropriate authorization
          IF p_werks NE zca0fcstftop-werks.
          could not update - not in selection
            MESSAGE e000(oo) WITH 'Entry not within selection'.
            SET SCREEN 0. LEAVE SCREEN.
            PERFORM get_data.
          ENDIF.
          IF f_copy = 'X'.
            INSERT zca0fcstftop.
            IF sy-subrc = 0.
              MESSAGE s004.
              PERFORM initialize.
              SET SCREEN 0. LEAVE SCREEN.
              PERFORM get_data.
            ELSE.
              MESSAGE w005.
            ENDIF.
          ELSE.
            MODIFY zca0fcstftop.
            IF sy-subrc = 0.
              MESSAGE s004.
              PERFORM initialize.
              SET SCREEN 0. LEAVE SCREEN.
              PERFORM get_data.
            ELSE.
              MESSAGE w005.
            ENDIF.
          ENDIF.
          PERFORM get_data.
        WHEN 'BACK'.                       "Back
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'CANC'.                       "Cancel
          SET SCREEN 0. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      COMMIT WORK.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  Initialize
    FORM initialize.
      CLEAR :   table_name,
                field_name,
                wg_confirm_ind,
                f_copy,
                flag,
                t_zca0fcstftop,
                zca0fcstftop,
                wa_zca0fcstftop,
                i_fcode.
      REFRESH: t_zca0fcstftop.
    ENDFORM.                               " Initialize
    *&      Form  alv_variant_f4
          text
         <--P_VARIANT  text
    FORM alv_variant_f4  CHANGING variant.
      DATA: rs_variant LIKE disvariant.
      DATA nof4 TYPE c.
      CLEAR nof4.
      LOOP AT SCREEN.
        IF screen-name = 'VARIANT'.
          IF screen-input = 0.
            nof4 = 'X'.
          ENDIF.
        ENDIF.
      ENDLOOP.
      rs_variant-report   = sy-repid.
      rs_variant-username = sy-uname.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = rs_variant
          i_save     = 'A'
        IMPORTING
          es_variant = rs_variant
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc = 0 AND nof4 EQ space.
        variant = rs_variant-variant.
      ENDIF.
    ENDFORM.                               " ALV_VARIANT_F4
    *&      Module  STATUS_0050  OUTPUT
          text
    MODULE status_0050 OUTPUT.
    In this module Initialize the container and put the grid in it
      DATA:grid_layout  TYPE lvc_s_layo,
           fieldcat TYPE lvc_t_fcat,
           wa_fieldcat LIKE LINE OF fieldcat.
      PERFORM set_auth.
      SET PF-STATUS 'UPD_0050' EXCLUDING i_fcode.
      SET TITLEBAR 'UPD_0050'.
      IF g_custom_container IS INITIAL .
        CREATE OBJECT g_custom_container
           EXPORTING
              container_name = 'FTDATA'.
        CREATE OBJECT grid1
           EXPORTING
            i_parent = g_custom_container.
      ELSE.
        CALL METHOD grid1->free.
        CALL METHOD g_custom_container->free.
        CREATE OBJECT g_custom_container
           EXPORTING
              container_name = 'FTDATA'.
        CREATE OBJECT grid1
           EXPORTING
            i_parent = g_custom_container.
      ENDIF.
    Every time refresh The variables
      PERFORM initialize.
      PERFORM get_data.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZCA0FCSTFTOP'
        CHANGING
          ct_fieldcat      = fieldcat.
      grid_layout-grid_title = text-t01.
      grid_layout-sel_mode = 'A'.
      grid_layout-stylefname = 'CT'.
      s_variant-report   = sy-repid.
      s_variant-username = sy-uname.
      s_variant-variant  = p_varant.
      CALL METHOD grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZCA0FCSTFTOP'
          is_layout        = grid_layout
          is_variant       = s_variant
          i_save           = 'A'
        CHANGING
          it_outtab        = t_zca0fcstftop
          it_fieldcatalog  = fieldcat.
      Create Object to receive events and link them to handler methods.
      When the ALV Control raises the event for the specified instance
      the corresponding method is automatically called.
    CREATE OBJECT event_receiver.
    SET HANDLER event_receiver->handle_button_click FOR grid1.
    ENDMODULE.                 " STATUS_0050  OUTPUT
    *&      Module  USER_COMMAND_0050  INPUT
    MODULE user_command_0050 INPUT.
      CALL METHOD grid1->get_selected_rows
        IMPORTING
          et_index_rows = selected_rows.
      DESCRIBE TABLE selected_rows LINES t_lines.
      IF t_lines > 1 .
        MESSAGE e048(zcsv_sfdr).
      ENDIF.
    Clear Header
      CLEAR wa_zca0fcstftop.
      sel_rows[] = selected_rows .
      READ TABLE sel_rows INDEX 1.
      READ TABLE t_zca0fcstftop INTO wa_zca0fcstftop INDEX sel_rows-index.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN 'CREA'.
          CLEAR zca0fcstftop.
          ok_code = sy-ucomm.
          zca0fcstftop-werks = p_werks.
          CALL SCREEN 100.
        WHEN 'COPY'.
          MOVE wa_zca0fcstftop TO zca0fcstftop .
          CLEAR wa_zca0fcstftop.
          f_copy = 'X'.
          CALL SCREEN 100.
        WHEN 'CHNG'.
          CHECK NOT wa_zca0fcstftop IS INITIAL.
          MOVE wa_zca0fcstftop TO zca0fcstftop .
          CLEAR wa_zca0fcstftop.
          ok_code = sy-ucomm.
          CALL SCREEN 100.
        WHEN 'DELE'.
          CHECK NOT wa_zca0fcstftop IS INITIAL.
          CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
            EXPORTING
              defaultoption  = 'N'
              textline1      = text-005
              textline2      = text-006
              titel          = text-007
              cancel_display = ' '
            IMPORTING
              answer         = wg_confirm_ind.
          IF wg_confirm_ind EQ 'J'.
            DELETE zca0fcstftop FROM wa_zca0fcstftop .
            IF sy-subrc EQ 0.
              MESSAGE s004.
            ELSE.
              MESSAGE e005.
            ENDIF.
          ELSEIF wg_confirm_ind EQ 'N'.
          ENDIF.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                 " USER_COMMAND_0050  INPUT
    *&      Form  exit_program
    FORM exit_program .
      CALL METHOD g_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      SET SCREEN 0.
      LEAVE SCREEN.
    ENDFORM.                    " exit_program
    *&      Form  set_auth
    FORM set_auth.
      REFRESH: i_fcode.
    Check authorization for change
      MOVE '02' TO act_auth.        "02 --> Change
      MOVE 'ZCA0FCSTFTOP' TO tab_maint.
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
        ID 'ACTVT' FIELD act_auth
        ID 'TABLE' FIELD tab_maint.
      IF sy-subrc NE 0.
        PERFORM fill_fcode USING 'CHNG'.
      ENDIF.
    Check for authorization for create
      MOVE '01' TO act_auth.        "01 --> Create
      MOVE 'ZCA0FCSTFTOP' TO tab_maint.
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
        ID 'ACTVT' FIELD act_auth
        ID 'TABLE' FIELD tab_maint.
      IF sy-subrc NE 0.
        PERFORM fill_fcode USING 'CREA'.
        PERFORM fill_fcode USING 'COPY'.
      ENDIF.
    Check for authorization for delete
      MOVE '06' TO act_auth.        "06 --> Delete
      MOVE 'ZCA0FCSTFTOP' TO tab_maint.
      AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
        ID 'ACTVT' FIELD act_auth
        ID 'TABLE' FIELD tab_maint.
      IF sy-subrc NE 0.
        PERFORM fill_fcode USING 'DELE'.
      ENDIF.
    ENDFORM.                    " set_auth
    *&      Module  check_change  INPUT
    MODULE check_change INPUT.
      flag = 'Y'.
    ENDMODULE.                 " check_change  INPUT
    regards,
    vikas.
    plz reward if helpful

Maybe you are looking for

  • DO NOT UPDATE TO iWEB 2.0.3 - I did and I can;t publish anymore!

    Ah, crap. I should have know never to download a new iWeb update before its been out for a few days. Ever since upgrading to 2.0.3 I get the dreaded "An unknown publishing error has occured." Once again, Apple f's up iWeb. What a joke.

  • OraFin 10.7 FSG Report to the Web

    Does anyone know a quick way to post OraFin 10.7 FSG reports to the web?

  • Variable

    Hi , I have created a dashboard of 2 pages .Actually i don't have hierarchy in my rpd level.I created 2 reports and place them into dashboard. my question is here one report is having 6 columns and other report is also having 8 columns. but here comm

  • Changing fonts in tables

    Hi, I want to change font in a table. It's the only item in the document. Selecting all, and changing font doesn't change anything. It does change any text I subsequently type outside the table, but not the table itself. Adding another row to the tab

  • Business Graphics, Gantt, and how to

    Hello Everyone, I am trying to use the UI Element Business Graphics in order to create a Gantt chart.  I am having trouble trying to determine how to set up the context and mapping for this.  I am basically trying to create a Gantt chart that is simi