ALV Block Display with filet ............ Urget Please..............

Hello All,
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, the second block remains constant.
My requirment is like this if iam setting a filter for one field in first block, if the second block also have the same field, then filter should Automatically be setted to the second block based on the field.
Is this possible?????  Can any one Help me out form this issue.
Thanks,
Feroz.

If you are using ALV standard functionality then if you are sorting with field then it will consider only that field. but if the data for other field also same then it will sort based on first field only but it will look like it is consider second field also.
If you are using standard functionality then you can not impletement logic that first field get selected and sorted by second even if its values are same.
Rewards if useful..................
Minal

Similar Messages

  • Problem in ALV BLOCK Display

    HI,
    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 four 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 data for last item from txt file in one block and other items showing when I click back button .
    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.
    Declaration of parameters
    *SELECTION-SCREEN BEGIN OF BLOCK b2.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (8) FOR FIELD p_matnr.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_matnr LIKE mara-matnr OBLIGATORY .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (8) FOR FIELD p_werks.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_werks LIKE t001w-werks OBLIGATORY .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_albom.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_albom LIKE stko-stlal DEFAULT ' '.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_bomap.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_bomap(4) DEFAULT 'PP01'.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN END OF BLOCK b2.
    *DATA :anr_datuv LIKE aenr-datuv.
    *SELECTION-SCREEN BEGIN OF BLOCK b3.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s02 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s02 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s03 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN END OF BLOCK b3.
    *SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01 .
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_vfrom.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_vfrom LIKE stpo-datuv DEFAULT sy-datum.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD pm_aennr.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS pm_aennr LIKE aenr-aennr.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (17) FOR FIELD p_reqty.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_reqty LIKE stpo-menge DEFAULT '1' .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_assd.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_assd AS CHECKBOX.
    *SELECTION-SCREEN END OF LINE.
    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.
    *&      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.
    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.                    " 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.
    endform.                    " fldcat

    Hi ,
    plz check the below codeand suggest me why it not showing data.....
    i make changes according to you ...
    waiting for your reply
    *& 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.
    Declaration of parameters
    *SELECTION-SCREEN BEGIN OF BLOCK b2.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (8) FOR FIELD p_matnr.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_matnr LIKE mara-matnr OBLIGATORY .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (8) FOR FIELD p_werks.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_werks LIKE t001w-werks OBLIGATORY .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_albom.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_albom LIKE stko-stlal DEFAULT ' '.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_bomap.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS: p_bomap(4) DEFAULT 'PP01'.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN END OF BLOCK b2.
    *DATA :anr_datuv LIKE aenr-datuv.
    *SELECTION-SCREEN BEGIN OF BLOCK b3.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s02 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s02 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) text-s03 .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN END OF BLOCK b3.
    *SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01 .
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_vfrom.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_vfrom LIKE stpo-datuv DEFAULT sy-datum.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD pm_aennr.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS pm_aennr LIKE aenr-aennr.
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (17) FOR FIELD p_reqty.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_reqty LIKE stpo-menge DEFAULT '1' .
    *SELECTION-SCREEN END OF LINE.
    *SELECTION-SCREEN BEGIN OF LINE.
    *SELECTION-SCREEN COMMENT (15) FOR FIELD p_assd.
    *SELECTION-SCREEN POSITION 25 .
    *PARAMETERS p_assd AS CHECKBOX.
    *SELECTION-SCREEN END OF LINE.
    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.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program             = 'ZCS13'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
         i_callback_user_command        = 'USER_COMMAND'(001).
      IT_EXCLUDING                   =.
      DATA :int1(10) .
    PERFORM fldcat.
      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_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.                    " 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.
    ENDFORM.                    " fldcat

  • ALVs - Block display

    Hi,
    Could anyone tell me if it is possible to edit fields in ALV block display?
    Thanks in advance
    Radhika

    Just check it out in the function pool SLIS the following.
    TYPES: BEGIN OF SLIS_FIELDCAT_ALV_SPEC,
    KEY_SEL(1) TYPE C, " field not obligatory
    NO_SUM(1) TYPE C, " do not sum up
    SP_GROUP(4) TYPE C, " group specification
    REPREP(1) TYPE C, " selection for rep/rep
    *INPUT(1) TYPE C, " input*
    EDIT(1) TYPE C, " internal use only
    HOTSPOT(1) TYPE C, " hotspot
    END OF SLIS_FIELDCAT_ALV_SPEC.
    TYPES: BEGIN OF SLIS_FIELDCAT_ALV.
    INCLUDE TYPE SLIS_FIELDCAT_MAIN.
    INCLUDE TYPE SLIS_FIELDCAT_ALV_SPEC.
    TYPES: END OF SLIS_FIELDCAT_ALV.
    Regards,
    Sankar.

  • How to display print icon in alv block display

    hi all,
    in my alv block display i have to display some icons as print, print preview, find, sort,change layout e.t.c
    if any one knows do let me know, if possible send the code.
    i have searched the forum for this query but i could'nt get the answer.

    Hi,
    check the link.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/how%252bto%252bkeep%252ban%252beye%252bon%252baggregates%252bin%252byour%252bsystem
    Regards
    Rajesh Kumar

  • Alv Blocked Display

    Hi All,
    I want to display Blocked ALV.
    i know the function modules
    REUSE_ALV_BLOCK_LIST_INIT
    REUSE_ALV_BLOCK_LIST_APPEND
    REUSE_ALV_BLOCK_LIST_DISPLAY
    I want to display it with óut using this function modules.
    Is there anyway to do that.
    If so please let me know.
    Thanks

    hi
    just have a look at this thread
    Re: ALV Block list Display
    hope it helps
    regards
    Aakash Banga

  • REG :ALV BLOCK DISPLAY

    i have an existing report which displays the output in blocks.
    for this they have used ALV .
    they have used macros to build fieldcatalog for each block.
    the following is the macro for the field catalog.
    DEFINE m_alv_fieldcat.
      clear e_alv_fieldcat.
      add c_1 to w_col_pos.
      move: w_col_pos to e_alv_fieldcat-col_pos,
            &1        to e_alv_fieldcat-fieldname,
            &2        to e_alv_fieldcat-tabname,
            &3        to e_alv_fieldcat-ref_tabname,
            &4        to e_alv_fieldcat-key,
            &5        to e_alv_fieldcat-do_sum,
            &6        to e_alv_fieldcat-outputlen,
            &7        to e_alv_fieldcat-reptext_ddic,
            &8        to e_alv_fieldcat-cfieldname,
            &9        to e_alv_fieldcat-datatype.
      append e_alv_fieldcat to i_alv_fieldcat.
    END-OF-DEFINITION.
    and they have populated the macro as follows
    m_alv_fieldcat:
        c_usnam param_tab_hdr c_bkpf space space 0 space space space,
        c_belnr param_tab_hdr c_bkpf space space 0 space space space,
        c_cpudt param_tab_hdr c_bkpf space space 0 space space space,
        c_budat param_tab_hdr c_bkpf space space 0 space space space,
        c_blart param_tab_hdr c_bkpf space space 0 space space space,
        c_xblnr param_tab_hdr c_bkpf space space 0 space space space.
    now my requirement is  i have to add one more column in the block display.
    they have used place holders for macros.as place holders are only for 9 values.plz tell me how to add one more column to this fieldcatalog which is using Macros.
    thanks &regards

    As you need to add one more column, you will not face any problem with Place holders. Just add the last line of the below code to the existing  code:
    m_alv_fieldcat:
    c_usnam param_tab_hdr c_bkpf space space 0 space space space,
    c_belnr param_tab_hdr c_bkpf space space 0 space space space,
    c_cpudt param_tab_hdr c_bkpf space space 0 space space space,
    c_budat param_tab_hdr c_bkpf space space 0 space space space,
    c_blart param_tab_hdr c_bkpf space space 0 space space space,
    c_xblnr param_tab_hdr c_bkpf space space 0 space space space.
    C_EXTRACOL  param_tab_hdr c_bkpf space space 0 space space space.
    This will add one more column to the existing ALV list.
    Regards,
    Kiran Bobbala

  • ALV grid display with more than 1000 columns

    Hi Friends,
    I have to prepare a report output which have 1015 columns.
    User will give 100 weeks of data to retrieve. I have to display the output in day wise.
    100*7 + 315 = 1015 columns.
    I am using ALV grid display for this in 4.6C.
    My Question is, whether I have to declare the output table type with 1015 fields.?
    Is there any other way to do this, without declaring 1015 cloumns.
    Please guide me to solve this.
    Regards,
    Viji.

    I'm thinking when your End-user will press Ctrl + P feeding A4 size to printer
    Thomas:
    Maybe the functional consultant is pulling your leg?
    May be OP is pulling our legs or something further?
    Cheers

  • Pdf output problem in ALV Block Display

    Hi ,
    I have z custom report of ALV BLOCK LIST DISPLAY which creates Spool using ABAP submit statement and then this spool is feed to FM CONVERT_ABAPSPOOLJOB_2_PDF to create PDF file . PDF file generates but output is coming on two pages. I want to display output on same page(i.e. on first page only) .
    it's urgent, appriciate your help.
    Thanks & Regards
    MSI

    while displaying in the screen is it display in one screen and while converting in PDF is IT Does the same in Two Pages

  • ALV Hierarichal display with multiple line headings

    Hi,
          I have designed an ALV report with Hierarichal display with multiple line headings...
    When i change the layout of this report,the headings which we enter manually will not take effect.The column we can hide in the report using the layout management.But the heading remains the same since it was written manually in top of page.
    Is there any possiblity to work out the Manual headings based on the layout fields.

    Hi,
    Do you use REUSE_ALV_HIERSEQ_LIST_DISPLAY? Why do you write heading manually? You can use IT_FIELDCAT parameter for defining a field catalog.

  • Alv grid display with dynamic colums

    Hi,
    i have an alv grid program in which i have to display the 22 fields as rows and i want to freeze them.i also want to display data for the 22 fields for a variable date range i.e. if you consider i have colums A to Z then i have have this sort of display:
    Sel screen:
    year(select-options):
    alv output:
                   Year1 Year2 ...........................Year N
    A
    B
    C
    D
    E
    F
    Z
    Please help me.
    i tried using fieldcatalog-row_pos = my row numbers i.e. 1,2....22.
    Thanks,
    Anand.

    Hi Anand,
    U need to create a dynamic field catalog as well as internal table to handle the year select option and to display the grid.
    See the below code creating dynamic field catalogue and internal table.   The same requirement like urs.
        LOOP AT i_month.
          CASE i_month-date+4(2).
            WHEN '01'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JAN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JAN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '02'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual FEB-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With FEB-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '03'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '04'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual APR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With APR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '05'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAY-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAY-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '06'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '07'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUL-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUL-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '08'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual AUG-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With AUG-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '09'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual SEP-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With SEP-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '10'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual OCT-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With OCT-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '11'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual NOV-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With NOV-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '12'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual DEC-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With DEC-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
          ENDCASE.
          MODIFY i_month.
          IF i_month-tag = 'A'.
    Field for reference month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ELSE.
    Fields for Compared month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for indicator
            CONCATENATE 'I' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 1.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for difference surcharge
            CONCATENATE 'D' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = '18'.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ENDIF.                           " IF i_month-tag = 'A'.
        ENDLOOP.                           " LOOP AT i_month.
      ENDIF.                               " IF NOT i_month[] IS INITIAL.
    Method to create dynamic table.
      IF NOT i_fldcat[] IS INITIAL.
        CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fldcat[]
          IMPORTING
            ep_table                  = i_table
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2
        IF sy-subrc <> 0.
        ENDIF.                             " IF sy-subrc <> 0.
        ASSIGN i_table->* TO <i_output>.
        CREATE DATA fs_line LIKE LINE OF <i_output>.
        ASSIGN fs_line->* TO <fs_output>.
      ENDIF.                               " IF NOT i_fldcat[] IS INITIAL.

  • REGARDING ALV BLOCK DISPLAY AND GRID DISPLAY

    HI FRIENDS,
    I HAVE A TROUBLE IN DISPLAYNG TWO TABLES TOGETHER IN THE GRID DISPLAY, BUT I CAN DISPLAY USING BLOCKS. I DONT WANT TO  USE JOIN STATEMENT IN THE SELECT QUERY.
    HELP WITH BY DISPLAYING THE RESPECTIVE CODES FOR THAT.
    THANK U IN ADVANCE

    hi,
    type-pools  : slis,icon.
    data : gd_repid like sy-repid.
    data : d_fieldcat type slis_t_fieldcat_alv,
              d_fieldcat_wa type slis_fieldcat_alv.
    data : begin of itab_mara occurs 0,
             matnr like mara-matnr,
             ernam like mara-ernam,
            end of itab_mara.
    data : begin of itab_marc occurs 0,
             matnr like marc-matnr,
             werks like marc-werks,
             end of itab_marc.
    data : begin of itab_final occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              werks like marc-werks,
              end of itab_final.
    gd_repid = sy-repid.
    loop at itab_emp.
    itab_final-matnr = itab_emp-matnr.
    itab_final-ernam = itab_emp-ernam.
    append itab_emp.
    clear itab_emp.
    endloop.
    d_fieldcat_wa-fieldname = 'MATNR'.
    d_fieldcat_wa-seltext_l = 'material number'.
    d_fieldcat_wa-col_pos = 1.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    d_fieldcat_wa-fieldname = 'ERNAM'.
    d_fieldcat_wa-seltext_l = 'created by'.
    d_fieldcat_wa-col_pos = 2.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    d_fieldcat_wa-fieldname = 'WERKS'.
    d_fieldcat_wa-seltext_l = 'plant number'.
    d_fieldcat_wa-col_pos = 1.
    append d_fieldcat_wa to d_fieldcat.
    clear d_fieldcat_wa.
    call function module 'REUSE_ALV_GRID_DISPLAY'.
    Reward with points if helpful.

  • Can't remove second display with 8800 GT. please help! this is frustrating!

    I have dealt with this problem for a long time now, but having just bought a wacom tablet, I need to finally resolve it and I hope someone here can help because I am at my end with it. I just can't think of anything else.
    I have a 8800 GT video card in a Mac Pro. All software is updated.
    I have a 30inch apple cinema display, and was using it solo for a long time, then for a project, I hooked an old LCD monitor vida the VGA to DVI adapter to the second monitor slot on the card, and had both monitors running in the extended desktop mode. Everything worked fine.
    The problem is, now that I want to get rid of the other monitor, my cinema display does not want to run solo anymore. I have tried rebooting with only the cinema display plugged in, I have tried switching ports on the card (both with and without rebooting), and I have tried unplugging the unwanted monitor. When I do ANY of these, the cinema display goes blue, then black, and the light on the front blinks three times over and over.
    It is as tho the video card does not want to autodetect the displays, nor does it want to reset any settings and run without both monitors in extended mode. And since OSX does not give specific software for the video card, I am limited in displays to make any real changes. There is no option for turning off extended desktop, only mirroring the displays (which, yes, when I choose it then unplug the other display results in the same problem of no picture).
    My wacom tablet uses the tablet as being the screen from corner to corner, so obviously with the extended display, the center of the tablet is not the center of the monitor and it makes it impossible to use easily.
    Please, if anyone has any ideas for me, I am begging for help. This is frustrating to no end!!
    Thanks in advance.

    Buzz,
    thanks for the help. I especially want to thank you for being the first person to reply a post of mine on this subject ever (on multiple help boards as well).
    Unfortunately what you told me to do still didn't work.
    When I re-mirror and then un-mirror the displays it puts it back into extended mode. and when I unplug the second monitor, the HD display shuts down and goes black. it will not turn back on (even with a reboot) until I have something plugged into the other port, at which time it goes back to extended mode.
    This is really frustrating, and the first time I have felt helpless with my mac. I try support and they of course tell me they can not help me since the monitor's extended warranty ran out...even tho the computer's warranty is still up and this is of course a video card problem, not monitor.
    I'm about to give up and either reinstall EVERYTHING on this **** computer (which will result in me losing a lot of editing add-ons and other programs I bought but stupidly can't remember where I got them from) or just throw the whole thing in the trash. (heh yes, I am that frustrated). :/

  • ALV List Display With a Pushbutton in the basic list

    i have displayed the po details in teh basic list. I have used the double clicking functionality. It worked well. Now instead of double clicking, i will place the cursor on the po and click a push button. then it should show the other details.
    Can anyone please guide me how to create the pushbuttons on the basic list ?

    Hi,
       You create your own GUI status.Pass the name of GUI status to FM REUSE_ALV_GRID_DISPLAY.
    e.g.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-repid
          CALLBACKPF_STATUS_SET = 'PF'
          i_callback_user_command = 'USER_COMMAND'
          i_grid_title            = text-020
          is_layout               = wa_layout
          it_fieldcat             = it_fieldcat[]
        TABLES
          t_outtab                = it_basic
        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 PF.
    SET PF_STATUS 'P1'.
    ENDFORM.
    On pressing that button go to secondary list.

  • Problem with check box in ALV Grid Display

    I am Displaying Material Master Data in ALV Grid Display with Check Box for each record and if i checked check box then i am processing Update operation in Database,  my question is after perform update operation check box should be clear.
    Kindly help me!!!!

    Hello Raj
    Given the fact that you do not tell us the most important piece of information (namely whether you are using OO-based ALV or not) I assume you are using fm-based ALV lists.
    In this case you probably have defined a USER_COMMAND routine as described in the documentation of the fm.
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    * define local data
      DATA: ls_outtab  LIKE LINE OF gt_outtab,
                ld_idx       TYPE i.
      LOOP AT gt_outtab INTO ls_outtab
                     WHERE ( chkbox = 'X' ).
        ld_idx = syst-tabix.
        " Call your update function / method / perform
       ls_outtab-chkbox = space.
       MODIFY gt_outtab FROM ls_outtab INDEX ld_Idx
          TRANSPORTING chkbox.
      ENDLOOP.
    " And now trigger refresh of the ALV display:
      rs_selfield-refresh = 'X'.  " <<< !!!
    ENDFORM.
    Regards
      Uwe

  • 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.

Maybe you are looking for

  • PhotoSmart 6510 e All-IN-ONE Series HP Printer

    My HP Photosmart 6510 e-All- In -One printer suddenly stoped coping, and delivers blank pages.  When I print from my laptop the printer works but the quality is poor; printing faded out areas within the printed-out paper process.  I tries cleaning th

  • Is there a way to create a schema for this simple XML?

    Hi! A simple question. Suppose we have a XML that looks like that (simplified) <documents>   <total>2</total>   <doc_1>     <name>My document</name>     <code>1234</code>   </doc_1>   <doc_2>     <name>Another document</name>     <code>5678</code>  

  • JNDI Context Retrieval in EJB 3.0

    I have a doubt about JNDI context retrieval in EJB 3.0. I know that when I call a bean from another bean I can use this line: InitialContext ctx=new InitialContext(); But I'd like to know whether in a Client I am obliged to pass this parameter: Initi

  • New hard disk for HP Pavilion All-in-One MS228sc

    I need to get af new hard disk drive for my HP Pavilion All-in-One MS228sc. I have great difficulties in getting in touch with HP denmark since my product is out of waranty. My questions is if the PC can handle a disk larger than my current on on 500

  • My ipad is frozen, unresponsive and has a fuzzy screen

    I've tried restoring it but that work but then it crashed again, i can't do anything with it and i have never damaged it.