Alv block on seprate pages

Hi,
Can any one suggest how we can display ALV Block on seprate pages (i.e. New page).
thanks
bobby

I am not sure if you can do that.
Regards,
Ravi

Similar Messages

  • 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

  • ALV report on 2 pages

    Hi,
    I have a requirement in which i have to dispaly the output of a report using ALV's on two pages. The first page should display the summary categories of the costs being charged and the other pages will have details by G/L account of each of the cost categories on the first page. I am not sure how this will be done with ALV's.Please help.

    Hi,
    as u r not going to print, then uts not possible using reuse_alv_grid/list _display.
    But its possible to display in 2 seperate blocks (not  2 separate pages) . using the follwing fm" Reuse_alv_block_list_init, reuse_alv_block_list_append, resue_alv_blck_list_display'.
    the above 3 fm will display ur list in sepearet blocks.
    Revrt back if any issues,
    Reward if helpful.
    regards,
    Naveen

  • 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

  • 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 BLOCK REPORT

    please tell me the process how to create ALV block report with simple example

    Try this sample program:
    Program Name:   ALV Program                                          *
    Description:                                                         *
    Date/Author:    Selvapandian                                         *
                      M O D I F I C A T I O N   L O G                    *
      Date      Programmer    Task    #            Description           *
    REPORT  ZEXAMPLE
           NO STANDARD PAGE HEADING
           MESSAGE-ID ZSP.
    TYPE-POOLS:  SLIS.
    INCLUDE: .
                               T A B L E S                               *
    TABLES: SCARR,              "Airline
            SPFLI,              "Flight schedule
            SBOOK.              "Single Flight Booking
                        I N T E R N A L   T A B L E S                    *
    DATA: GT_SP_GROUPS TYPE SLIS_T_SP_GROUP_ALV WITH HEADER LINE,
          GT_ZSUM      TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
          GT_FILTER    TYPE SLIS_T_FILTER_ALV   WITH HEADER LINE,
          XHEADER      TYPE SLIS_T_LISTHEADER   WITH HEADER LINE.
    DATA: GT_EXTAB TYPE SLIS_T_EXTAB WITH HEADER LINE.
    DATA: GT_COLOR TYPE SLIS_T_SPECIALCOL_ALV WITH HEADER LINE.
    DATA: BEGIN OF XDATA OCCURS 1,
            CARRID      LIKE SCARR-CARRID,
            CARRNAME    LIKE SCARR-CARRNAME,
            CURRCODE    LIKE SCARR-CURRCODE,
            BLUBBER     LIKE LTDXT-TEXT,
            NUMC(3)     TYPE N,
            ICONS(30)   TYPE C,
            SYMBOLS(30) TYPE C,
            AMPEL(1)    TYPE C,
            BOX(1)      TYPE C,
            LISTINFO(3) TYPE C,
          END OF XDATA.
    DATA: BEGIN OF YDATA OCCURS 1.
            INCLUDE STRUCTURE SPFLI.
    DATA:   BLUBBER     LIKE LTDXT-TEXT,
            NUMC(3)     TYPE N,
            ICONS(30)   TYPE C,
            SYMBOLS(30) TYPE C,
            AMPEL(1)    TYPE C,
            BOX(1)      TYPE C,
            LISTINFO(3) TYPE C,
            COLINFO     TYPE SLIS_T_SPECIALCOL_ALV,
          END OF YDATA.
    DATA: BEGIN OF ZDATA OCCURS 1.
            INCLUDE STRUCTURE SBOOK.
    DATA:   BLUBBER     LIKE LTDXT-TEXT,
            NUMC(3)     TYPE N,
            ICONS(30)   TYPE C,
            SYMBOLS(30) TYPE C,
            AMPEL(1)    TYPE C,
            BOX(1)      TYPE C,
            LISTINFO(3) TYPE C,
            COLINFO     TYPE SLIS_T_SPECIALCOL_ALV,
          END OF ZDATA.
    DATA: HDATA LIKE XDATA OCCURS 0 WITH HEADER LINE,
          LDATA LIKE XDATA OCCURS 0 WITH HEADER LINE,
          IDATA LIKE YDATA OCCURS 0 WITH HEADER LINE.
    DATA: LFIELD TYPE SLIS_T_FIELDCAT_ALV,
          XFIELD TYPE SLIS_T_FIELDCAT_ALV,
          YFIELD TYPE SLIS_T_FIELDCAT_ALV,
          ZFIELD TYPE SLIS_T_FIELDCAT_ALV,
          HFIELD TYPE SLIS_T_FIELDCAT_ALV.
    DATA: AFIELD TYPE SLIS_FIELDCAT_ALV.
    DATA: GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
          X_LAYOUT  TYPE SLIS_LAYOUT_ALV,
          Y_LAYOUT  TYPE SLIS_LAYOUT_ALV,
          Z_LAYOUT  TYPE SLIS_LAYOUT_ALV,
          H_LAYOUT  TYPE SLIS_LAYOUT_ALV,
          L_LAYOUT  TYPE SLIS_LAYOUT_ALV.
    DATA: GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
    DATA: XISETAB TYPE SLIS_SELDIS_ALV.
    DATA: GT_XEVENTS TYPE SLIS_T_EVENT,
          GT_YEVENTS TYPE SLIS_T_EVENT,
          GT_ZEVENTS TYPE SLIS_T_EVENT,
          GT_HEVENTS TYPE SLIS_T_EVENT,
          GT_LEVENTS TYPE SLIS_T_EVENT,
          GT_PRINT TYPE SLIS_PRINT_ALV.
                                 D A T A                                 *
    DATA: OK_CODE     LIKE SY-UCOMM,
          FLG_EXIT(1) TYPE C,
          V_REPID       LIKE SY-REPID,
          G_EXIT,
          X_SAVE,
          DEFAULT,
          X_VARIANT LIKE DISVARIANT,
          XS_LAYOUT LIKE GS_LAYOUT,
          XS_EVENT  TYPE SLIS_ALV_EVENT,
          GT_SPFLI  LIKE SPFLI OCCURS 0 WITH HEADER LINE,
          G_VARIANT LIKE DISVARIANT.
              S E L E C T - O P T I O N S / P A R A M E T E R S          *
    SELECT-OPTIONS CARRID FOR SCARR-CARRID.
    SELECTION-SCREEN SKIP.
    PARAMETERS: PFSTATUS TYPE SLIS_FORMNAME DEFAULT 'PF_STATUS_SET',
                HIERSEQU AS CHECKBOX DEFAULT 'X',
                BOX_TABL(5) DEFAULT 'IDATA',
                MAX_DATA AS CHECKBOX DEFAULT ' '.
                       I N I T I A L I Z A T I O N                       *
    INITIALIZATION.
      V_REPID = SY-REPID.
                  A T   S E L E C T I O N - S C R E E N                  *
    AT SELECTION-SCREEN ON CARRID.
    IF NOT CARRID[] IS INITIAL.
      SELECT SINGLE * FROM SCARR
             WHERE CARRID IN CARRID.
            IF SY-SUBRC <> 0.
              MESSAGE E000 WITH 'Enter valid Carrier ID'(003).
            ENDIF.
    ENDIF.
                   S T A R T - O F - S E L E C T I O N                   *
    START-OF-SELECTION.
      PERFORM F_SELECTION.
      PERFORM XEVENTS.
      PERFORM YEVENTS.
      PERFORM HEVENTS.
      PERFORM FIELDS.
                     E N D - O F - S E L E C T I O N                     *
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
           EXPORTING
                I_CALLBACK_PROGRAM       = V_REPID
                I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
                I_CALLBACK_PF_STATUS_SET = PFSTATUS.
      X_LAYOUT-BOX_FIELDNAME = 'BOX'.
      X_LAYOUT-BOX_TABNAME   = 'XDATA'.
      X_LAYOUT-LIGHTS_FIELDNAME  = 'AMPEL'.
      X_LAYOUT-INFO_FIELDNAME = 'LISTINFO'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                IT_FIELDCAT = XFIELD
                IS_LAYOUT   = X_LAYOUT
                I_TABNAME   = 'XDATA'
                IT_EVENTS   = GT_XEVENTS
                I_TEXT      = TEXT-0B1
           TABLES
                T_OUTTAB    = XDATA.
      IF HIERSEQU = SPACE.
      y_layout-no_zebra = 'X'.
        Y_LAYOUT-BOX_FIELDNAME = 'BOX'.
        Y_LAYOUT-BOX_TABNAME   = 'YDATA'.
        Y_LAYOUT-INFO_FIELDNAME = 'LISTINFO'.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
             EXPORTING
                  IT_FIELDCAT = YFIELD
                  IS_LAYOUT   = Y_LAYOUT
                  I_TABNAME   = 'YDATA'
                  IT_EVENTS   = GT_YEVENTS
                  I_TEXT      = TEXT-0B2
             TABLES
                  T_OUTTAB    = YDATA.
      ELSE.
        H_LAYOUT-BOX_FIELDNAME = 'BOX'.
        H_LAYOUT-BOX_TABNAME   = BOX_TABL.
        H_LAYOUT-INFO_FIELDNAME = 'LISTINFO'.
        GS_KEYINFO-HEADER01 = 'CARRID'.
        GS_KEYINFO-ITEM01 = 'CARRID'.
        GS_KEYINFO-ITEM02 = 'CONNID'.
        CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_HS_APPEND'
             EXPORTING
                  IS_LAYOUT        = H_LAYOUT
                  IT_FIELDCAT      = HFIELD
                  IS_KEYINFO       = GS_KEYINFO
                  I_HEADER_TABNAME = 'HDATA'
                  I_ITEM_TABNAME   = 'IDATA'
                  IT_EVENTS        = GT_HEVENTS
                  I_TEXT           = TEXT-0B2
             TABLES
                  T_OUTTAB_HEADER  = HDATA
                  T_OUTTAB_ITEM    = IDATA.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                IT_FIELDCAT = ZFIELD
                IS_LAYOUT   = Z_LAYOUT
                I_TABNAME   = 'ZDATA'
                IT_EVENTS   = GT_ZEVENTS
                I_TEXT      = TEXT-0B3
           TABLES
                T_OUTTAB    = ZDATA.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                IT_FIELDCAT = LFIELD
                IS_LAYOUT   = L_LAYOUT
                I_TABNAME   = 'LDATA'
                IT_EVENTS   = GT_LEVENTS
                I_TEXT      = TEXT-0B4
           TABLES
                T_OUTTAB    = LDATA.
      GT_PRINT-RESERVE_LINES = 2.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
           EXPORTING
                IS_PRINT = GT_PRINT.
    *&      Form  SELECTION
    FORM F_SELECTION.
      DATA: L_TABIX  LIKE SY-TABIX,
            LT_SBOOK LIKE SBOOK OCCURS 1 WITH HEADER LINE,
            L_TABIX2 LIKE SY-TABIX.
      SELECT * FROM SCARR
               INTO CORRESPONDING FIELDS OF
               TABLE XDATA WHERE CARRID IN CARRID.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'No records in SCARR table'(001).
      ENDIF.
      IF NOT XDATA[] IS INITIAL.
        SELECT * FROM SPFLI
                 INTO TABLE GT_SPFLI
                 FOR ALL ENTRIES IN XDATA
                 WHERE CARRID = XDATA-CARRID.
        IF SY-SUBRC <> 0.
          MESSAGE S000 WITH 'No records in SPFLI table'(002).
        ENDIF.
      ENDIF.
    LOOP AT GT_SPFLI.
       YDATA-NUMC = SY-TABIX DIV 5.
       MOVE-CORRESPONDING GT_SPFLI TO YDATA.
       APPEND YDATA.
    ENDLOOP.
      LOOP AT XDATA.
        XDATA-NUMC = SY-TABIX DIV 4.
        L_TABIX = SY-TABIX.
        REFRESH GT_COLOR.
        CLEAR   GT_COLOR.
        IF L_TABIX  > 5.
          XDATA-AMPEL = '1'.
        ELSEIF XDATA-CURRCODE = 'USD'.
          XDATA-AMPEL = '2'.
        ELSE.
          XDATA-AMPEL = '3'.
        ENDIF.
        IF XDATA-CURRCODE = 'LIT'.
          GT_COLOR-FIELDNAME = 'CURRCODE'.
          GT_COLOR-COLOR-COL = 6.
          GT_COLOR-COLOR-INT = 0.
          APPEND GT_COLOR.
          XDATA-SYMBOLS = SYM_PLUS_CIRCLE.
        ELSEIF XDATA-CURRCODE = 'DEM'.
          GT_COLOR-COLOR-COL = 5.
          GT_COLOR-COLOR-INT = 0.
          APPEND GT_COLOR.
          XDATA-SYMBOLS = SYM_FILLED_SQUARE.
        ELSE.
          GT_COLOR-FIELDNAME = 'CURRCODE'.
          GT_COLOR-COLOR-COL = 7.
          GT_COLOR-COLOR-INT = 1.
          GT_COLOR-COLOR-INV = 1.
          APPEND GT_COLOR.
          XDATA-SYMBOLS = SYM_FILLED_DIAMOND.
        ENDIF.
        MODIFY XDATA.
      ENDLOOP.
      HDATA[] = XDATA[].
      LDATA[] = XDATA[].
      IDATA[] = YDATA[].
      SELECT * FROM SBOOK
               UP TO 50 ROWS.
        L_TABIX   = L_TABIX + 1.
        L_TABIX2  = L_TABIX2 + 1.
        MOVE-CORRESPONDING SBOOK TO ZDATA.
        IF L_TABIX > 20.
          ZDATA-CARRID = 'LH'.
          ZDATA-CONNID = '47'.
        ENDIF.
        IF L_TABIX > 14 AND L_TABIX <= 20 OR
           L_TABIX > 25.
          ZDATA-FLDATE = ZDATA-FLDATE + 1.
        ENDIF.
        IF L_TABIX2 > 7 AND L_TABIX <= 20.
          ZDATA-CONNID = 49.
        ELSEIF L_TABIX >= 26.
          ZDATA-CONNID = 51.
        ENDIF.
        IF L_TABIX2 >= 14 AND L_TABIX <= 20 .
          CLEAR L_TABIX2.
        ENDIF.
        APPEND ZDATA.
      ENDSELECT.
      LOOP AT ZDATA.
        L_TABIX = SY-TABIX.
        IF L_TABIX = 1.
          ZDATA-LOCCURAM = 520.
        ENDIF.
        REFRESH GT_COLOR.
        CLEAR   GT_COLOR.
        IF ZDATA-LOCCURAM < 500.
          ZDATA-AMPEL = '1'.
        ELSEIF ZDATA-LOCCURAM < 530.
          ZDATA-AMPEL = '2'.
        ELSE.
          ZDATA-AMPEL = '3'.
        ENDIF.
        IF ZDATA-LOCCURAM > 600.
          GT_COLOR-FIELDNAME = 'LOCCURAM'.
          GT_COLOR-COLOR-COL = 6.
          GT_COLOR-COLOR-INT = 0.
          APPEND GT_COLOR.
          ZDATA-SYMBOLS = SYM_PLUS_CIRCLE.
        ELSEIF ZDATA-LOCCURAM > 500.
          GT_COLOR-COLOR-COL = 5.
          GT_COLOR-COLOR-INT = 0.
          APPEND GT_COLOR.
          ZDATA-SYMBOLS = SYM_FILLED_SQUARE.
        ELSE.
          GT_COLOR-FIELDNAME = 'LOCCURAM'.
          GT_COLOR-COLOR-COL = 7.
          GT_COLOR-COLOR-INT = 1.
          GT_COLOR-COLOR-INV = 1.
          APPEND GT_COLOR.
          ZDATA-SYMBOLS = SYM_FILLED_DIAMOND.
        ENDIF.
        IF ZDATA-LUGGWEIGHT = 0.
          ZDATA-ICONS = ICON_INCOMPLETE.
          GT_COLOR-FIELDNAME = 'LUGGWEIGHT'.
          GT_COLOR-COLOR-COL = 4.
          GT_COLOR-COLOR-INT = 1.
          GT_COLOR-COLOR-INV = 1.
          APPEND GT_COLOR.
        ELSEIF ZDATA-LUGGWEIGHT < 45.
          ZDATA-ICONS = ICON_CHECKED.
          GT_COLOR-FIELDNAME = 'LUGGWEIGHT'.
          GT_COLOR-COLOR-COL = 6.
          GT_COLOR-COLOR-INT = 1.
          GT_COLOR-COLOR-INV = 1.
          APPEND GT_COLOR.
        ELSE.
          ZDATA-ICONS = ICON_FAILURE.
          GT_COLOR-FIELDNAME = 'LUGGWEIGHT'.
          GT_COLOR-COLOR-COL = 5.
          GT_COLOR-COLOR-INT = 1.
          GT_COLOR-COLOR-INV = 1.
          APPEND GT_COLOR.
        ENDIF.
        ZDATA-NUMC = ( L_TABIX DIV 10 ) * 10.
        ZDATA-COLINFO = GT_COLOR[].
        IF NOT ZDATA-LUGGWEIGHT IS INITIAL.
          MOVE '??' TO ZDATA-WUNIT.
        ENDIF.
        MODIFY ZDATA.
      ENDLOOP.
      IF MAX_DATA = 'X'.
        DO 100 TIMES.
          APPEND XDATA.
          APPEND YDATA.
          APPEND ZDATA.
        ENDDO.
      ENDIF.
    ENDFORM.                               " SELECTION
          FORM XEVENTS                                                  *
    FORM XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'XEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'XTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'XTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'XEND_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
    ENDFORM.
          FORM FIELDS                                                   *
    FORM FIELDS.
      DATA: L_COUNT TYPE I.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CARRID'.
      AFIELD-REF_TABNAME = 'SCARR'.
      AFIELD-KEY = 'X'.                    "define field as key
      APPEND AFIELD TO XFIELD.
      AFIELD-TABNAME = 'HDATA'.
      APPEND AFIELD TO HFIELD.
      AFIELD-TABNAME = 'LDATA'.
      APPEND AFIELD TO LFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CARRNAME'.
      AFIELD-REF_TABNAME = 'SCARR'.
      APPEND AFIELD TO XFIELD.
      AFIELD-TABNAME = 'HDATA'.
      APPEND AFIELD TO HFIELD.
      AFIELD-TABNAME = 'LDATA'.
      APPEND AFIELD TO LFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
    AFIELD-TABNAME = 'XDATA'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CURRCODE'.
      AFIELD-REF_TABNAME = 'SCARR'.
    AFIELD-INPUT    = INPUT.
      APPEND AFIELD TO XFIELD.
      AFIELD-TABNAME = 'HDATA'.
      APPEND AFIELD TO HFIELD.
      AFIELD-TABNAME = 'LDATA'.
      APPEND AFIELD TO LFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
    AFIELD-TABNAME = 'XDATA'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'NUMC'.
      AFIELD-DATATYPE  = 'NUMC'.
      AFIELD-REPTEXT_DDIC = TEXT-001.
    AFIELD-INPUT    = INPUT.
      AFIELD-DO_SUM = 'X'.
      APPEND AFIELD TO XFIELD.
      AFIELD-TABNAME = 'HDATA'.
      APPEND AFIELD TO HFIELD.
      AFIELD-TABNAME = 'LDATA'.
      APPEND AFIELD TO LFIELD.
      CLEAR AFIELD.
      L_COUNT = 0.
      L_COUNT = L_COUNT + 1.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-TABNAME = SPACE.
      AFIELD-FIELDNAME = 'CARRID'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-KEY = 'X'.                    "define field as key
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CONNID'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-KEY = 'X'.                    "define field as key
      AFIELD-KEY_SEL = 'X'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CITYFROM'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'AIRPFROM'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'CITYTO'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'AIRPTO'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'DEPTIME'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'ARRTIME'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'FLTIME'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-NO_OUT = 'X'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-FIELDNAME = 'FLTYPE'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-NO_OUT = 'X'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Ikonen
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-TABNAME = SPACE.
      AFIELD-FIELDNAME = 'ICONS'.
      AFIELD-REF_TABNAME = '    '.
      AFIELD-SP_GROUP = 'B'.
      AFIELD-REPTEXT_DDIC = 'Gpk?'(045).
      AFIELD-NO_OUT = 'X'.
      AFIELD-ICON = 'X'.
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '4'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Symbole
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-FIELDNAME = 'SYMBOLS'.
      AFIELD-REF_TABNAME = '    '.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-REPTEXT_DDIC = 'Prs?'(040).
      AFIELD-SP_GROUP = 'B'.
      AFIELD-NO_OUT = 'X'.
      AFIELD-SYMBOL = 'X'.
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '4'.
      AFIELD-JUST  = 'C'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Gepäckgewicht
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-SP_GROUP = 'A'.
      AFIELD-NO_OUT   = SPACE.
      AFIELD-FIELDNAME = 'DISTANCE'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-NO_SIGN = 'X'.
      AFIELD-QFIELDNAME = 'DISTID'.
      AFIELD-OUTPUTLEN  = '10'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Mengeneinheit
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      L_COUNT = L_COUNT + 1.
      AFIELD-TABNAME = SPACE.
      AFIELD-SP_GROUP = 'A'.
      AFIELD-NO_OUT   = SPACE.
      AFIELD-FIELDNAME = 'DISTID'.
      AFIELD-REF_TABNAME = 'SPFLI'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-OUTPUTLEN  = '4'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Numc
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-TABNAME = SPACE.
      AFIELD-FIELDNAME = 'NUMC'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-DO_SUM = 'X'.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-SELTEXT_S = 'NUMC'.
      AFIELD-SELTEXT_M = 'NUMC_U'.
      AFIELD-SELTEXT_L = 'NUMC_USER'(041).
      AFIELD-DATATYPE = 'NUMC'.
      AFIELD-OUTPUTLEN  = '10'.
      AFIELD-NO_OUT = SPACE.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Blubber
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-TABNAME = SPACE.
      AFIELD-FIELDNAME = 'BLUBBER'.
      AFIELD-REF_TABNAME = 'LTDXT'.
      AFIELD-REF_FIELDNAME = 'TEXT'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-HOTSPOT = 'X'.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-REPTEXT_DDIC = 'Kommentar'(043).
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '20'.
      AFIELD-NO_OUT = 'X'.
      APPEND AFIELD TO YFIELD.
      AFIELD-TABNAME = 'IDATA'.
      APPEND AFIELD TO HFIELD.
    Key
      L_COUNT = 0.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'CARRID'.
      AFIELD-OUTPUTLEN  = '3'.
      AFIELD-KEY = 'X'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
    AFIELD-OFFSET  = '4'.
      APPEND AFIELD TO ZFIELD.
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'FLDATE'.
      AFIELD-KEY = 'X'.
      AFIELD-KEY_SEL = 'X'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      APPEND AFIELD TO ZFIELD.
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'CONNID'.
      AFIELD-KEY = 'X'.
      AFIELD-KEY_SEL = 'X'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      APPEND AFIELD TO ZFIELD.
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'BOOKID'.
      AFIELD-KEY_SEL = 'X'.
      AFIELD-KEY = 'X'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      APPEND AFIELD TO ZFIELD.
    Ikonen
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'ICONS'.
      AFIELD-REF_TABNAME = '    '.
      AFIELD-SP_GROUP = 'B'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-REPTEXT_DDIC = 'Gpk?'(045).
      AFIELD-NO_OUT = 'X'.
      AFIELD-ICON = 'X'.
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '4'.
      APPEND AFIELD TO ZFIELD.
    Buchungsdatum
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'ORDER_DATE'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      APPEND AFIELD TO ZFIELD.
    Kundentyp
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'CUSTTYPE'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      APPEND AFIELD TO ZFIELD.
    Kundennummer
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'CUSTOMID'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-OUTPUTLEN  = '3'.
      APPEND AFIELD TO ZFIELD.
    Raucher
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'SMOKER'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      APPEND AFIELD TO ZFIELD.
    Flugklasse
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'CLASS'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      APPEND AFIELD TO ZFIELD.
    Rechnungsstellung ja/nein
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'INVOICE'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-NO_OUT   = 'X'.
      APPEND AFIELD TO ZFIELD.
    Symbole
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'SYMBOLS'.
      AFIELD-REF_TABNAME = '    '.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-REPTEXT_DDIC = 'Prs?'(040).
      AFIELD-SP_GROUP = 'B'.
      AFIELD-NO_OUT = 'X'.
      AFIELD-SYMBOL = 'X'.
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '4'.
      AFIELD-JUST  = 'C'.
      APPEND AFIELD TO ZFIELD.
    Betrag
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'LOCCURAM'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-SP_GROUP = 'H'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-CFIELDNAME = 'LOCCURKEY'.
      AFIELD-DATATYPE = 'CURR'.
      AFIELD-DO_SUM   = 'X'.
      AFIELD-OUTPUTLEN  = '10'.
      APPEND AFIELD TO ZFIELD.
    Währung
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'LOCCURKEY'.
      AFIELD-TECH = ' '.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-OUTPUTLEN  = '4'.
      AFIELD-SP_GROUP = 'H'.
      APPEND AFIELD TO ZFIELD.
    BetragFW
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'FORCURAM'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-SP_GROUP = 'F'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-NO_OUT = 'X'.
      AFIELD-DO_SUM = 'X'.
      AFIELD-CFIELDNAME = 'FORCURKEY'.
      AFIELD-DATATYPE = 'CURR'.
      AFIELD-OUTPUTLEN  = '10'.
      APPEND AFIELD TO ZFIELD.
    Währung
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'FORCURKEY'.
      AFIELD-SP_GROUP = 'F'.
      AFIELD-TECH = ' '.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-NO_OUT = 'X'.
      AFIELD-OUTPUTLEN  = '4'.
      APPEND AFIELD TO ZFIELD.
    Gepäckgewicht
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-SP_GROUP = 'A'.
      AFIELD-NO_OUT   = 'X'.
      AFIELD-FIELDNAME = 'LUGGWEIGHT'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-NO_SIGN = 'X'.
      AFIELD-QFIELDNAME = 'WUNIT'.
      AFIELD-OUTPUTLEN  = '10'.
      APPEND AFIELD TO ZFIELD.
    Mengeneinheit
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-SP_GROUP = 'A'.
      AFIELD-NO_OUT   = 'X'.
      AFIELD-FIELDNAME = 'WUNIT'.
      AFIELD-REF_TABNAME = 'SBOOK'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-OUTPUTLEN  = '4'.
      APPEND AFIELD TO ZFIELD.
    Numc
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'NUMC'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-SELTEXT_S = 'NUMC'.
      AFIELD-SELTEXT_M = 'NUMC_U'.
      AFIELD-SELTEXT_L = 'NUMC_USER'(041).
      AFIELD-DATATYPE = 'NUMC'.
      AFIELD-OUTPUTLEN  = '10'.
      AFIELD-NO_OUT     = 'X'.
      APPEND AFIELD TO ZFIELD.
    Blubber
      L_COUNT = L_COUNT + 1.
      CLEAR AFIELD.
      AFIELD-FIELDNAME = 'BLUBBER'.
      AFIELD-REF_TABNAME = 'LTDXT'.
      AFIELD-REF_FIELDNAME = 'TEXT'.
      AFIELD-COL_POS = L_COUNT.
      AFIELD-HOTSPOT = 'X'.
      AFIELD-SP_GROUP = 'S'.
      AFIELD-REPTEXT_DDIC = 'Kommentar'(043).
      AFIELD-DATATYPE = 'CHAR'.
      AFIELD-OUTPUTLEN  = '20'.
      AFIELD-NO_OUT = 'X'.
      APPEND AFIELD TO ZFIELD.
    ENDFORM.                               " FIELDS
          FORM YEVENTS                                                  *
    FORM YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'YEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'YTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'YTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'YEND_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
    ENDFORM.
          FORM HEVENTS                                                  *
    FORM HEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'HTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_HEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'HTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_HEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'HEND_OF_LIST'.
      APPEND XS_EVENT TO GT_HEVENTS.
    ENDFORM.
    FORM ZBEFORE_LINE_OUTPUT USING LINEINFO TYPE SLIS_LINEINFO.
      WRITE AT /20 'HalloZ'.
    ENDFORM.
          FORM XBEFORE_LINE_OUTPUT                                      *
    FORM XBEFORE_LINE_OUTPUT USING LINEINFO TYPE SLIS_LINEINFO.
      WRITE AT /20 'HalloX'.
    ENDFORM.
          FORM XTOP_OF_PAGE                                             *
    FORM XTOP_OF_PAGE.
      WRITE: / 'X_TOP_OF_PAGE'.
    ENDFORM.
          FORM XTOP_OF_LIST                                             *
    FORM XTOP_OF_LIST.
      WRITE: / 'X_TOP_OF_LIST'.
    ENDFORM.
          FORM XEND_OF_PAGE                                             *
    FORM XEND_OF_PAGE.
      WRITE: / 'X_END_OF_PAGE'.
    ENDFORM.
          FORM XEND_OF_LIST                                             *
    FORM XEND_OF_LIST.
      WRITE: / 'X_END_OF_LIST'.
    ENDFORM.
    FORM YTOP_OF_PAGE.
      WRITE: / 'Y_TOP_OF_PAGE'.
    ENDFORM.
          FORM YTOP_OF_LIST                                             *
    FORM YTOP_OF_LIST.
      WRITE: / 'Y_TOP_OF_LIST'.
    ENDFORM.
          FORM YEND_OF_PAGE                                             *
    FORM YEND_OF_PAGE.
      WRITE: / 'Y_END_OF_PAGE'.
    ENDFORM.
          FORM YEND_OF_LIST                                             *
    FORM YEND_OF_LIST.
      WRITE: / 'Y_END_OF_LIST'.
    ENDFORM.
          FORM YTOP_OF_LIST                                             *
    FORM HTOP_OF_LIST.
      WRITE: / 'h_TOP_OF_LIST'.
    ENDFORM.
          FORM YEND_OF_PAGE                                             *
    FORM HEND_OF_PAGE.
      WRITE: / 'h_END_OF_PAGE'.
    ENDFORM.
          FORM YEND_OF_LIST                                             *
    FORM HEND_OF_LIST.
      WRITE: / 'h_END_OF_LIST'.
    ENDFORM.
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'REFR'.
          LOOP AT XDATA.
            IF XDATA-BOX = 'X'.
              XDATA-LISTINFO = 'C50'.
            ELSE.
              XDATA-LISTINFO = SPACE.
            ENDIF.
            MODIFY XDATA.
          ENDLOOP.
          LOOP AT YDATA.
            IF YDATA-BOX = 'X'.
              YDATA-LISTINFO = 'C50'.
            ELSE.
              YDATA-LISTINFO = SPACE.
            ENDIF.
            MODIFY YDATA.
          ENDLOOP.
          LOOP AT IDATA.
            IF IDATA-BOX = 'X'.
              IDATA-LISTINFO = 'C50'.
            ELSE.
              IDATA-LISTINFO = SPACE.
            ENDIF.
            MODIFY IDATA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.
          FORM PF_STATUS_SET                                            *
    FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD'. " EXCLUDING EXTAB.
    ENDFORM..

  • 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

  • ALV Block Printing Problem

    Dear All,
       when i am printing alv block report, each block is printing in each page and also some other bock is printed ( no of records passed by etc.. ) is shown in print preview and also printedon separate page
      Please provide settings to fix this...
    Thanks in Advance.

    Hi,
      Can any one have solution on this...

  • 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

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

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

  • Index file increase with no corresponding increase in block numbers or Pag file size

    Hi All,
    Just wondering if anyone else has experienced this issue and/or can help explain why it is happening....
    I have a BSO cube fronted by a Hyperion Planning app, in version 11.1.2.1.000
    The cube is in it's infancy, but already contains 24M blocks, with a PAG file size of 12GB.  We expect this to grow fairly rapidly over the next 12 months or so.
    After performing a simple Agg of aggregating sparse dimensions, the Index file sits at 1.6GB.
    When I then perform a dense restructure, the index file reduces to 0.6GB.  The PAG file remains around 12GB (a minor reduction of 0.4GB occurs).  The number of blocks remains exactly the same.
    If I then run the Agg script again, the number of blocks again remains exactly the same, the PAG file increases by about 0.4GB, but the index file size leaps back to 1.6GB.
    If I then immediately re-run the Agg script, the # blocks still remains the same, the PAG file increases marginally (less than 0.1GB) and the Index remains exactly the same at 1.6GB.
    Subsequent passes of the Agg script have the same effect - a slight increase in the PAG file only.
    Performing another dense restructure reverts the Index file to 0.6GB (exactly the same number of bytes as before).
    I have tried running the Aggs using parallel calcs, and also as in series (ie single thread) and get exactly the same results.
    I figured there must be some kind of fragmentation happening on the Index, but can't think of a way to prove it.  At all stages of the above test, the Average Clustering Ratio remains at 1.00, but I believe this just relates to the data, rather than the Index.
    After a bit of research, it seems older versions of Essbase used to suffer from this Index 'leakage', but that it was fixed way before 11.1.2.1. 
    I also found the following thread which indicates that the Index tags may be duplicated during a calc to allow a read of the data during the calc;
    http://www.network54.com/Forum/58296/thread/1038502076/1038565646/index+file+size+grows+with+same+data+-
    However, even if all the Index tags are duplicated, I would expect the maximum growth of the Index file to be 100%, right?  But I am getting more than 160% growth (1.6GB / 0.6GB).
    And what I haven't mentioned is that I am only aggregating a subset of the database, as my Agg script fixes on only certain members of my non-aggregating sparse dimensions (ie only 1 Scenario & Version)
    The Index file growth in itself is not a problem.  But the knock-on effect is that calc times increase - if I run back-to-back Aggs as above, the 2nd Agg calc takes 20% longer than the 1st.  And with the expected growth of the model, this will likely get much worse.
    Anyone have any explanation as to what is occurring, and how to prevent it...?
    Happy to add any other details that might help with troubleshooting, but thought I'd see if I get any bites first.
    The only other thing I think worth pointing out at this stage is that we have made the cube Direct I/O for performance reasons. I don't have much prior exposure to Direct I/O so don't know whether this could be contributing to the problem.
    Thanks for reading.

    alan.d wrote:
    The only other thing I think worth pointing out at this stage is that we have made the cube Direct I/O for performance reasons. I don't have much prior exposure to Direct I/O so don't know whether this could be contributing to the problem.
    Thanks for reading.
    I haven't tried Direct I/O for quite a while, but I never got it to work properly. Not exactly the same issue that you have, but it would spawn tons of .pag files in the past. You might try duplicating your cube, changing it to buffered I/O, and run the same processes and see if it does the same thing.
    Sabrina

  • Need to download the ALV blocked output in to excel sheet

    I have a requirement where there is a need to download the Alv block output to excel sheet. when i click on excel button which is on output only header block data is coming in excel sheet.but i need both header block and item block data into excel.

    Hi,
    create a pushbutton on the toolbar,
    whenever user clicks the pushbutton,
    call the fm gui_download for 2 times
    for the first time,
    append = ' ',
    and for second time.
    append = 'X'.
    check this thread.
    Re: How to download multiple ALV Container data on a screen to a single Excel?
    Regards.
    R K.

  • ALV how to display page no in every page - Page break

    Hi All
    I would like to know how can i write an ALV page no in each of the page.
    Currently i manage to write the page no in the top , but only show "Page No : 1 "
    but when i send to spool the All the page no will break into "Page No : 1 , Page No :2 and up to end page .
    thank you

    Hi Check this program.
    A Simple ABAP ALV LIST VIEWER Example
    This ALV program have all the basic report requirements such as page heading, page no, sub-total and a grand total.
    This is a basic ALV with the followings:-
    - Page Heading
    - Page No
    - Sub-Total
    - Grand Total
    REPORT ZALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
    GS_PRINT            TYPE SLIS_PRINT_ALV,
    GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
    GT_EVENTS           TYPE SLIS_T_EVENT,
    GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
    GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
    GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
    FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
    COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
      INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    Print Parameters
    PARAMETERS:
                P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
                P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
                P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
                P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
                P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
                P_RESERV TYPE I.                  "NO OF FOOTER LINE
    INITIALIZATION.
    G_REPID = SY-REPID.
    PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
    START-OF-SELECTION.
    TEST DATA
    MOVE 'TEST1' TO ITAB1-FIELD1.
    MOVE 'TEST1' TO ITAB1-FIELD2.
    MOVE '10.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    MOVE 'TEST2' TO ITAB1-FIELD1.
    MOVE 'TEST2' TO ITAB1-FIELD2.
    MOVE '20.00' TO ITAB1-FIELD3.
    APPEND ITAB1.
    DO 50 TIMES.
      APPEND ITAB1.
    ENDDO.
    END-OF-SELECTION.
    PERFORM BUILD.
    PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
    PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
    PERFORM CALL_ALV.
    FORM BUILD.
    DATA FIELD CATALOG
    Explain Field Description to ALV
    DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD1'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
    FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
    FIELDCAT_LN-NO_OUT    = ' '.
    FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME = 'FIELD2'.
    FIELDCAT_LN-TABNAME   = 'ITAB1'.
    FIELDCAT_LN-NO_OUT    = 'X'.
    FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    CLEAR FIELDCAT_IN.
    FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
    FIELDCAT_LN-TABNAME       = 'ITAB1'.
    FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
    FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
    FIELDCAT_LN-NO_OUT        = ' '.
    FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
    APPEND FIELDCAT_LN TO GT_FIELDCAT.
    DATA SORTING AND SUBTOTAL
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    ENDFORM.
    FORM CALL_ALV.
    ABAP List Viewer
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME = 'ITAB1'
    IS_LAYOUT =  GS_LAYOUT
    IT_FIELDCAT = GT_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
      IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
      IT_EVENTS = GT_EVENTS[]
    IT_EVENT_EXIT =
      IS_PRINT = GS_PRINT
    IS_REPREP_ID =
    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 =
    TABLES
    T_OUTTAB = ITAB1
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    ENDFORM.
    HEADER FORM
    FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    *GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 0
           IMPORTING
                ET_EVENTS   = LT_EVENTS.
      READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO LT_EVENTS.
      ENDIF.
    define END_OF_PAGE event
    READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                             INTO LS_EVENT.
    IF SY-SUBRC = 0.
      MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
      APPEND LS_EVENT TO LT_EVENTS.
    ENDIF.
    ENDFORM.
    FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: GS_LINE TYPE SLIS_LISTHEADER.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'H'.
      GS_LINE-INFO = 'HEADER 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      CLEAR GS_LINE.
      GS_LINE-TYP  = 'S'.
      GS_LINE-KEY  = 'STATUS 1'.
      GS_LINE-INFO = 'INFO 1'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
      GS_LINE-KEY  = 'STATUS 2'.
      GS_LINE-INFO = 'INFO 2'.
      APPEND GS_LINE TO GT_TOP_OF_PAGE.
    CLEAR GS_LINE.
    GS_LINE-TYP  = 'A'.
    GS_LINE-INFO = 'ACTION'.
    APPEND GS_LINE TO  GT_TOP_OF_PAGE.
    ENDFORM.
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
      WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
    ENDFORM.
    FORM END_OF_PAGE.
      WRITE at (sy-linsz) sy-pagno CENTERED.
    ENDFORM.
    PRINT SETTINGS
    FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
      LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
      LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
      LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
      LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
      LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
      LS_PRINT-RESERVE_LINES      = P_RESERV.
    ENDFORM.
    *END OF ZALV PROGRAM
    Reward if it helps you.

  • 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

Maybe you are looking for

  • Updated my iTunes and now my mac can not see my airport express no matter what I have tried

    recently updated my itunes and the firmware on my airport extreme and suddenly itunes does not recognize my airport express for speakers and my mac through airport utilities can not see my airport express. *** I have tried everything and nothing will

  • Mac OS 10.9 Mavericks WiFi Issue

    Since I have upgraded to Mavericks I have experienced a problem connecting to wireless networks, all wireless networks regardless of security settings.  The system displays the exclamation mark and doesn't get an IP address from the router.  I have d

  • How can i reduce the number of calls archived in recents

    How can i reduce the number of calls archived in recents

  • Import data - export and import tools

    Hi All, I am trying to import a currency.csv file using the import data and i get this error - "import failed: Array index out of range: 3" Any help is appreciated. Thanks in advance!

  • InputVerifier and XML Schema

    Is there a way by which I can pass the contstraints for a TextField to the InputVerifier, after getting them from the XML Schema. For example if I have a schema like:- ***************************** Start ***************************** <?xml version="1