Seperate ALV  Properties in Blocked ALV

Hi All,
I have created a blocked ALV. The standard ALV functionalities like Sort ,Filter etc is working only for the first list.
Is there any techniques to give seperate functionalities for each list?
Iam using reuse_alv_grid_display .
and  LAYOUT-LIST_APPEND to show the blocked ALV.
thanks and regards,
Subeesh Kannottil

Hi Yawa Ding,
I have 3 lists .The standard ALV unctionality works only for the first list.
I want all these properties to be applied to all lists
Thanks and Regards,
Subeesh Kannottil

Similar Messages

  • To find total in blocked alv

    hi experts,
    i have created blocked ALV program.
    in the o/p , it displays list of recors for open items,then list of records for cleared items.
    now i want it  to display sum of both open and cleared items of particular column.
    in grid display it is displaying total for open and cleared items.
    but in blocked alv it is not displaying total for open and closed items separately.
    and also i need grand total of both.
    if any body knows please tell me..

    Hi Sridevi
    Refer this code as an example.
    This code calculates the occupied column from sflight table.
    TYPE-POOLS: slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         is_layout TYPE slis_layout_alv,
         it_events TYPE  slis_t_event ,
        it_sort TYPE  slis_t_sortinfo_alv .
    DATA: wa_fcat LIKE LINE OF it_fieldcat,
          wa_sort LIKE LINE OF it_sort.
    DATA: i_flight TYPE sflight_tab1.
    SELECT * FROM sflight
    INTO TABLE i_flight
    UP TO 10 ROWS.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_structure_name       = 'SFLIGHT'
      CHANGING
        ct_fieldcat            = it_fieldcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2.
    wa_fcat-do_sum = 'X'.
    MODIFY it_fieldcat FROM wa_fcat
         TRANSPORTING do_sum WHERE fieldname = 'SEATSOCC'.
    wa_sort-up = 'X'.
    wa_sort-fieldname = 'CARRID'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO it_sort.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program = sy-repid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLIGHT'
        it_events                        = it_events
        it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = is_layout
        it_fieldcat                      = it_fieldcat
        i_tabname                        = 'I_FLGIHT'
        it_events                        = it_events
       it_sort                          = it_sort
    *   I_TEXT                           = ' '
      TABLES
        t_outtab                         = i_flight
    EXCEPTIONS
       program_error                    = 1
       maximum_of_appends_reached       = 2
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks and Regards

  • Sorting in Blocked ALV Report

    Hi Experts,
    Can i achieve sorting in Blocked ALV report as we can do in ALV Grid Display.???
    If so, how can this be achieved????
    For example, if there are 3 records with the same value for a field.....say thfreee rows with name 'Gaurav'.
    I want to show 'Gaurav' only in the first row and the other two rows must be empty.
    Gaurav 1 2 3
    Gaurav 4 5 6
    Gaurav 7 8 9
    Should be seen as
    Gaurav 1 2 3
               4 5 6
               7 8 9
    Thanks and regards
    Gaurav raghav

    Here is the code.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_structure_name       = 'ZCRM_ACTIVITY_REPORT'
        CHANGING
          ct_fieldcat            = gt_fieldcatalog[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc EQ 0.
          CLEAR gs_sort.
          gs_sort-fieldname = 'ORG'.
          gs_sort-tabname = 'GT_ITAB'.
          gs_sort-spos = '1'.
          gs_sort-up = 'X'.
          APPEND gs_sort TO gt_sort.
        CLEAR gs_sort.
        gs_sort-fieldname = 'EMPLOYEE'.
        gs_sort-tabname = 'GT_ITAB'.
        gs_sort-spos = '2'.
        gs_sort-up = 'X'.
        APPEND gs_sort TO gt_sort.
      ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            is_layout                  = gt_layout
            it_fieldcat                = gt_fieldcatalog
            i_tabname                  = 'GT_ITAB'
            it_events                  = gt_events
            it_sort                    = gt_sort
            i_text                     = 'Report 1 '
          TABLES
            t_outtab                   = gt_itab
          EXCEPTIONS
            program_error              = 1
            maximum_of_appends_reached = 2
            OTHERS                     = 3.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.

  • Interactive in blocked ALV

    Hi to all,
    Iam displaying out put in BLOCKEd ALV using 2 internal tables.
    Each table has 10 fields.
    When I double click on particular column entry, it should call Transaction iw33.
    Other 9 columns should not call transacton if i select entry from the column.
    But iam able to call transaction for all the other column entries.
    Iam tried using this with slis_selfield structure.
    In the run time this structure is not capturing the fieldname.
    How can i capture field name.
    kindly send yr valuable replys.

    Hi naveen,
    1. I also tried the same thing, but its not returning the column name
       on which we click.
    2. One workaround can be
    a) we get the VALUE in slis_selfield structure.
    b) loop at the internal table where COLUMN1 = VALUE
    c) if found, then we can somehow deduce that column1 has been clicked.
    (It can happen that other columns can contain the same value,
    then it can be confusing)
    regards,
    amit m.

  • Subtotal in Blocked ALV

    Hi All,
    I am facing the problem in displaying the subtotal in Blocked ALV.
    My requirement is, I need to display the subtotals in 3 lines like below.
    for ex:
    subtotal:          7 <above total>
                          (5)<coming from someother field>
                           2
    from the above: 7 is total of that column.
                              5 is coming from some other field.
                              2 is substraction of above 2.
    Could anyone please help me in the above.
    Many thanks in advance.
    Regards,
    venkat.

    Hi Vaibhav,
    Thanks for your response.
    and one thing here in my above example is,  the value  5 is neither total nor subtotal. its just a different value coming from some other field.
    only the 7 is total of that column.
    and if I write that logic manually, It may not able display as the position of that column is around 500. because write statment may display upto 252nd position in the output, I guess.
    thank you very much.
    Regards,
    Venkat.
    Edited by: venkat reddy on Jan 18, 2010 8:45 PM

  • Page Number - Total Page number in Blocked ALV

    Hi Gurus,
      I need to print the page numbers like 1 of 5 in the ALV footer. Am able to print the current page number but am unable to print the total page number in the footer of the Blocked ALV. Can any one guide me how to display the total number of pages.
    Points will be awarded
    Thanks
    Ravi

    Hi,
    Please refer to the link below :
    http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm
    Thanks,
    Sri.

  • Header and Logo in Blocked ALV

    Is It possible to put header and logo in Blocked ALV Report.
    Is yes shall I go with the same way we put the Header and Logo in ALV Grid report.
    Thanks in Advance.

    Hi,
    You can put the haeder and logo  same like we have used to do in classical ALV's....
    sample code snippet..
    REPORT  ZALV_BLOCKEDALV .
    *provide tables
    TABLES: MARA, MAKT, MARD.
    *provide type-pools
    TYPE-POOLS: SLIS.
    *provide select-options
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    *provide data objects
    DATA: V_REPID TYPE SY-REPID,
          WA_MARA_FIELD TYPE SLIS_FIELDCAT_ALV,       "it is for field catalog
          WA_MAKT_FIELD TYPE SLIS_FIELDCAT_ALV,
          WA_MARD_FIELD TYPE SLIS_FIELDCAT_ALV,
          WA_MARA TYPE MARA,
          WA_MAKT TYPE MAKT,
          WA_MARD TYPE MARD,      IT_MARA_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MAKT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MARD_FIELD TYPE SLIS_T_FIELDCAT_ALV,
          IT_MARA TYPE TABLE OF MARA,
          IT_MAKT TYPE TABLE OF MAKT,
          IT_MARD TYPE TABLE OF MARD,      V_LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS TYPE SLIS_T_EVENT,            "it is for events
          WA_EVENTS TYPE SLIS_ALV_EVENT.V_REPID = SY-REPID.
    *provide field catalog perform
    PERFORM FIELD_CAT.
    *call the initial function module
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = V_REPID
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   IT_EXCLUDING                   =
    *provide perform for select the data
    PERFORM SELECT_DATA.
    *call mara append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MARA_FIELD[]
        I_TABNAME                        = 'MARA'
        IT_EVENTS                        = IT_EVENTS[]
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARA
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *call makt append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MAKT_FIELD
        I_TABNAME                        = 'MAKT'
        IT_EVENTS                        = IT_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MAKT
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *call mard append list
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = V_LAYOUT
        IT_FIELDCAT                      = IT_MARD_FIELD
        I_TABNAME                        = 'MARD'
        IT_EVENTS                        = IT_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARD
    EXCEPTIONS
       PROGRAM_ERROR                    = 1
       MAXIMUM_OF_APPENDS_REACHED       = 2
       OTHERS                           = 3.
    *display the data
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    * EXPORTING
    *   I_INTERFACE_CHECK             = ' '
    *   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.
    *&      Form  TOP_PAGE
    *       text
    FORM TOP_PAGE.  WRITE:/ 'THIS IS BLOCKED ALV REPORT PROGRAM BASED ON 3 BLOCKS' COLOR
    5.ENDFORM.                    "TOP_PAGE
    *&      Form  FIELD_CAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIELD_CAT .WA_MARA_FIELD-COL_POS = 1.
    WA_MARA_FIELD-FIELDNAME = 'MATNR'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 2.
    WA_MARA_FIELD-FIELDNAME = 'ERSDA'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 3.
    WA_MARA_FIELD-FIELDNAME = 'ERNAM'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 4.
    WA_MARA_FIELD-FIELDNAME = 'LAEDA'.
    WA_MARA_FIELD-REF_TABNAME = 'MARA'.
    APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
    CLEAR WA_MARA_FIELD.WA_MAKT_FIELD-COL_POS = '1'.
    WA_MAKT_FIELD-FIELDNAME = 'MATNR'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 2.
    WA_MAKT_FIELD-FIELDNAME = 'MAKTX'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 3.
    WA_MAKT_FIELD-FIELDNAME = 'MAKTG'.
    WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
    APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
    CLEAR WA_MAKT_FIELD.WA_MARD_FIELD-COL_POS = 1.
    WA_MARD_FIELD-FIELDNAME = 'MATNR'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 2.
    WA_MARD_FIELD-FIELDNAME = 'WERKS'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 3.
    WA_MARD_FIELD-FIELDNAME = 'LGORT'.
    WA_MARD_FIELD-REF_TABNAME = 'MARD'.
    APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
    CLEAR WA_MARD_FIELD.WA_EVENTS-FORM = 'TOP_PAGE'.
    WA_EVENTS-NAME = 'TOP_OF_PAGE'.
    APPEND WA_EVENTS TO IT_EVENTS.ENDFORM.                    " FIELD_CAT
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM SELECT_DATA .SELECT *
    FROM MARA
    INTO TABLE IT_MARA
    WHERE MATNR IN S_MATNR.SELECT *
    FROM MAKT
    INTO TABLE IT_MAKT
    WHERE MATNR IN S_MATNR.SELECT *
    FROM MARD
    INTO TABLE IT_MARD
    WHERE MATNR IN S_MATNR.ENDFORM.                    " SELECT_DATA
    hope  this will help you
    regards,
    kiran
    Edited by: kiran  kumar on Aug 23, 2010 1:43 PM

  • How to handle Events in Blocked ALV report

    Hi All,
    I have a Blocked ALV report, I have a requirement where if I double click a row in blocked ALV report, it should branch off to MM01 transaction code and the material number and change number should get populated with the material number and change number  in my program.
    Is there any idea how to do this.
    Thanks,
    Vishal.

    hi anil,
    I have used user_command1 as the function module however the field details are not getting captured.
    How can we use set get parameters in this aspect.
    Please elaborate your answer.
    Thanks,
    Vishal.

  • How to calculate totals in Blocked ALV Report

    Hi All,
    Can any body tell how to calculate totals & sub totals in
    Blocked ALV Report[Blocked List].
    Thanks in advance
    Thanks & Regards,
    Rayeezuddin.

    read this it might help
    Sums                                                       
    15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
    Only by fieldcatalog.
    Value set: SPACE, 'X'
    'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
    16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
    Value set: SPACE, 'X'
    'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
    17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
    Value set: SPACE, 'X'
    'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
    18. No_subtotals(1) TYPE c : No subtotals possible          
    Value set: SPACE, 'X'
    'X' = no subtotals.
    19. Numc_sum(1)  TYPE c : Totals only possible for NUMC-Fields.
    20. No_unit_splitting TYPE c: No separate total lines by inh.units   
    21.totals_before_items TYPE c: Display totals before the items   
    22. Totals_only(1) TYPE c :  Show only totals      
    Value set: SPACE, 'X'
    'X' = only total records are output.
    23. Totals_text(60) TYPE c : Text for 1st col. in totals   
    Value set: SPACE, string (max.60)
    ' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
    'String’ = The string passed is output after the total indicated by '*', if the column is wide enough.
    24. Subtotals_text(60) TYPE c : Texts for subtotals
    Value set: SPACE, string (max.60)
    ' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
    'String’ = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
    ELSE TELL ME I WILL PASTE COMPLETE HELP
    regards

  • Sub total in blocked alv

    hi experts,
    i have tried to subtotal in blocked alv. i used the coding for sorting in grid display. its working in FM reuse_alv_grid_display.
    but its not working in blocked alv, i.e., in FM reuse_alv_block_list_append .
    so what to do ?
    kind regards,
    debendra

    hi all,
    yes my question has been answered.
    as per below.
    have to maintain this line : WA_SORT-TABNAME = 'IT_MUSTER'
    where IT_MUSTER is the table name.
    FORM APPEND USING FTAB TYPE C FDATA TYPE STANDARD TABLE.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                        = layout
          IT_FIELDCAT                      = it_fcat
          I_TABNAME                        = FTAB
          IT_EVENTS                        = it_event
          IT_SORT                          = IT_SORT
        TABLES
          T_OUTTAB                         = FDATA.
    ENDFORM.
    Form sort.
      WA_SORT-TABNAME = 'IT_MUSTER'.
      wa_sort-fieldname = 'MON'.
      wa_sort-SUBTOT = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
    Endform.
    ragards,
    debendra

  • Block ALV Report Doubt!

    Hi!
       In Block AlV we r using Fun Mod
                              REUSE_ALV_BLOCK_LIST_APPEND
        To display data in blocks and called again to display other data in block in same screen.
      I want to know REUSE_ALV_BLOCK_LIST_DISPLAY Fun mod is optional  or mandatory
       without using this also shall i get the required o/p.
      Looking for your reply.
    Rahul.

    REUSE_ALV_BLOCK_LIST_DISPLAY  is mandatory, without calling this FM, you will not get any disply.
    In the below ALV if you comment out t REUSE_ALV_BLOCK_LIST_DISPLAY   FM call call you will not get disply.
    REPORT ztest1 .
    TABLES:     ekko, mara.
    TYPE-POOLS: slis.
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    TYPES: BEGIN OF t_mara,
      matnr TYPE mara-matnr,
      mtart TYPE mara-mtart,
      matkl TYPE mara-matkl,
    END OF t_mara.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          it_mara TYPE STANDARD TABLE OF t_mara INITIAL SIZE 0.
    *ALV data declarations
    DATA: fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog2 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_layout     TYPE slis_layout_alv,
          gt_events_ekko TYPE slis_t_event,
          xs_event      TYPE slis_alv_event,
          gt_events_mara TYPE slis_t_event,
          gd_repid       TYPE sy-repid,
          gt_print TYPE slis_print_alv.
    * START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM data_retrival.
      PERFORM build_fieldcat.
      PERFORM build_layout.
      PERFORM events_ekko.
      PERFORM events_mara.
      PERFORM display_alv_report.
    *SUBROUTINES
    *&      Form  data_retrival
    FORM data_retrival .
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      SELECT matnr mtart matkl
       UP TO 10 ROWS
        FROM mara
        INTO TABLE it_mara.
    ENDFORM.                    " data_retrival
    *&      Form  build_fieldcat
    FORM build_fieldcat .
    * FOR EKKO
      fieldcatalog1-fieldname   = 'EBELN'.
      fieldcatalog1-seltext_m   = 'Purchase Order'.
      fieldcatalog1-col_pos     = 0.
      fieldcatalog1-outputlen   = 10.
      fieldcatalog1-emphasize   = 'X'.
      fieldcatalog1-key         = 'X'.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'EBELP'.
      fieldcatalog1-seltext_m   = 'PO Item'.
      fieldcatalog1-col_pos     = 1.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'STATU'.
      fieldcatalog1-seltext_m   = 'Status'.
      fieldcatalog1-col_pos     = 2.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'AEDAT'.
      fieldcatalog1-seltext_m   = 'Item change date'.
      fieldcatalog1-col_pos     = 3.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'MATNR'.
      fieldcatalog1-seltext_m   = 'Material Number'.
      fieldcatalog1-col_pos     = 4.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'MENGE'.
      fieldcatalog1-seltext_m   = 'PO quantity'.
      fieldcatalog1-col_pos     = 5.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'MEINS'.
      fieldcatalog1-seltext_m   = 'Order Unit'.
      fieldcatalog1-col_pos     = 6.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'NETPR'.
      fieldcatalog1-seltext_m   = 'Net Price'.
      fieldcatalog1-col_pos     = 7.
      fieldcatalog1-outputlen   = 15.
      fieldcatalog1-do_sum      = 'X'.        "Display column total
      fieldcatalog1-datatype     = 'CURR'.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
      fieldcatalog1-fieldname   = 'PEINH'.
      fieldcatalog1-seltext_m   = 'Price Unit'.
      fieldcatalog1-col_pos     = 8.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR  fieldcatalog1.
    * FOR MARA
      fieldcatalog2-fieldname   = 'MATNR'.
      fieldcatalog2-seltext_m   = 'Material No'.
      fieldcatalog2-col_pos     = 0.
      fieldcatalog2-outputlen   = 10.
      fieldcatalog2-emphasize   = 'X'.
      fieldcatalog2-key         = 'X'.
      APPEND fieldcatalog2 TO fieldcatalog2.
      CLEAR  fieldcatalog1.
      fieldcatalog2-fieldname   = 'MTART'.
      fieldcatalog2-seltext_m   = 'Material type'.
      fieldcatalog2-col_pos     = 1.
      APPEND fieldcatalog2 TO fieldcatalog2.
      CLEAR  fieldcatalog2.
      fieldcatalog2-fieldname   = 'MATKL'.
      fieldcatalog2-seltext_m   = 'Material Group'.
      fieldcatalog2-col_pos     = 2.
      APPEND fieldcatalog2 TO fieldcatalog2.
      CLEAR  fieldcatalog2.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_layout
    FORM build_layout .
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    ENDFORM.                    " build_layout
    *&      Form  events_ekko
    FORM events_ekko .
      CLEAR xs_event.
      xs_event-name = slis_ev_top_of_page.
      xs_event-form = 'TOP_OF_PAGE-EKKO'.
      APPEND xs_event TO gt_events_ekko.
      CLEAR xs_event.
      xs_event-name = slis_ev_end_of_list.
      xs_event-form = 'END_OF_LIST_EKKO'.
      APPEND xs_event TO gt_events_ekko.
    ENDFORM.                    " events_ekko
    *&      Form  TOP_OF_PAGE-EKKO
    FORM top_of_page-ekko.
      WRITE: / 'TOP OF PAGE : Purchase Order'.
    ENDFORM.                    "XTOP_OF_PAGE
    *&      Form  END_OF_LIST_EKKO
    FORM end_of_list_ekko.
      WRITE: / 'end OF list : Purchase Order'.
    ENDFORM.                    "END_OF_LIST_EKKO
    *&      Form  events_mara
    FORM events_mara .
      CLEAR xs_event.
      xs_event-name = slis_ev_top_of_list.
      xs_event-form = 'TOP_OF_LIST-MARA'.
      APPEND xs_event TO gt_events_mara.
      CLEAR xs_event.
      xs_event-name = slis_ev_end_of_page.
      xs_event-form = 'END_OF_PAGE_MARA'.
      APPEND xs_event TO gt_events_mara.
    ENDFORM.                    "events_mara
    *&      Form  TOP_OF_LIST-MARA
    FORM top_of_list-mara.
      WRITE: / 'TOP OF LIST : Material Master'.
    ENDFORM.                    "TOP_OF_LIST-MARA
    *&      Form  END_OF_PAGE_MARA
    FORM end_of_page_mara.
      WRITE: / 'End OF Page : Material Master'.
    ENDFORM.                    "END_OF_PAGE_MARA
    *&      Form  display_alv_report
    FORM display_alv_report .
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = sy-repid.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = gd_layout
          it_fieldcat                      = fieldcatalog1[]
          i_tabname                        = 'it_ekko'
          it_events                        = gt_events_ekko
        TABLES
          t_outtab                         = it_ekko
       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                        = gd_layout
          it_fieldcat                      = fieldcatalog2[]
          i_tabname                        = 'it_mara'
          it_events                        = gt_events_mara
        TABLES
          t_outtab                         = it_mara
       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.
      gt_print-reserve_lines = 2.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        EXPORTING
          is_print = gt_print.
    ENDFORM.                    " display_alv_report

  • Save layout option for Block Alv

    Hi,
    Small Question,
    Is there any way to enable Save layout(Ctrl+F10) option for Block ALV?As i cannot see any option to do so with Reuse_*Block like i_save in Grid and For list ALVs...FM.And its by default it is Disable.
    Any Hints?
    Cheers,
    Amit.

    That's what i already investigated(Small).
    wanted Just to confirm.Anyways thanks.
    @Gautham:I already found that link([And this also |/message/702997#702997 [original link is broken];) but thought After 2 and
    half yrs Vijay found any solution and would land with any solution as always
    Anyways Thanks Vijay And Gautham.
    Cheers,
    Amit.

  • Blocked ALV

    Hi Experts,
    I want to use Blocked ALV in my report, in which there will be many headers and for each header there will be some line items.
    So can any one give me the same report which can show multiple headers and Item level descriptions. It should be shown as break up for each header and so on.
    Thanks & Regards,
    Ramana

    Hi,
    TABLES : mara,makt,mard.
    TYPE-POOLS : slis.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    DATA : v_repid TYPE sy-repid,
            wa_mara_field TYPE slis_fieldcat_alv,
            wa_makt_field TYPE slis_fieldcat_alv,
            wa_mard_field TYPE slis_fieldcat_alv,
            wa_mara TYPE mara,
            wa_makt TYPE makt,
            wa_mard TYPE mard,
            it_mara_field TYPE slis_t_fieldcat_alv,
            it_makt_field TYPE slis_t_fieldcat_alv,
            it_mard_field TYPE slis_t_fieldcat_alv,
            it_mara TYPE TABLE OF mara,
            it_makt TYPE TABLE OF makt,
            it_mard TYPE TABLE OF mard,
            v_layout TYPE slis_layout_alv,
            it_events TYPE slis_t_event,
            wa_events TYPE slis_alv_event.
    v_repid = sy-repid.
    PERFORM field_cat.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
       EXPORTING
         i_callback_program             = v_repid
       I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = ' '
       IT_EXCLUDING                   =
    PERFORM select_data.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
       EXPORTING
         is_layout                        = v_layout
         it_fieldcat                      = it_mara_field[]
         i_tabname                        = 'MARA'
         it_events                        = it_events[]
       IT_SORT                          =
       I_TEXT                           = ' '
       TABLES
         t_outtab                         = it_mara
      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                        = v_layout
         it_fieldcat                      = it_makt_field
         i_tabname                        = 'MAKT'
         it_events                        = it_events
       IT_SORT                          =
       I_TEXT                           = ' '
       TABLES
         t_outtab                         = it_makt
      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                        = v_layout
         it_fieldcat                      = it_mard_field
         i_tabname                        = 'MARD'
         it_events                        = it_events
       IT_SORT                          =
       I_TEXT                           = ' '
       TABLES
         t_outtab                         = it_mard
      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             = ' '
       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  TOP_PAGE
          text
    FORM top_page.
       WRITE :/ 'THIS IS BLOCKED ALV REPORT PROG BASED ON 3 BLOCKS' COLOR 5.
    ENDFORM.                    "TOP_PAGE
    *&      Form  FIELD_CAT
          text
    -->  p1        text
    <--  p2        text
    FORM field_cat .
       wa_mara_field-col_pos = 1.
       wa_mara_field-fieldname = 'MATNR'.
       wa_mara_field-tabname = 'MARA'.
       wa_mara_field-seltext_m = 'MATNR'.
       APPEND wa_mara_field TO it_mara_field.
       CLEAR wa_mara_field.
       wa_mara_field-col_pos = 2.
       wa_mara_field-fieldname = 'ERSDA'.
       wa_mara_field-tabname = 'MARA'.
       wa_mara_field-seltext_m = 'ERSDA'.
       APPEND wa_mara_field TO it_mara_field.
       CLEAR wa_mara_field.
       wa_mara_field-col_pos = 3.
       wa_mara_field-fieldname = 'ERNAM'.
       wa_mara_field-tabname = 'MARA'.
       wa_mara_field-seltext_m = 'ERNAM'.
       APPEND wa_mara_field TO it_mara_field.
       CLEAR wa_mara_field.
       wa_mara_field-col_pos = 4.
       wa_mara_field-fieldname = 'LAEDA'.
       wa_mara_field-tabname = 'MARA'.
       wa_mara_field-seltext_m = 'LAEDA'.
       APPEND wa_mara_field TO it_mara_field.
       CLEAR wa_mara_field.
       wa_makt_field-col_pos = 1.
       wa_makt_field-fieldname = 'MATNR'.
       wa_makt_field-tabname = 'MAKT'.
       wa_makt_field-seltext_m = 'MATNR'.
       APPEND wa_makt_field TO it_makt_field.
       CLEAR wa_makt_field.
       wa_makt_field-col_pos = 2.
       wa_makt_field-fieldname = 'MAKTX'.
       wa_makt_field-tabname = 'MAKT'.
       wa_makt_field-seltext_m = 'MAKTX'.
       APPEND wa_makt_field TO it_makt_field.
       CLEAR wa_makt_field.
       wa_makt_field-col_pos = 3.
       wa_makt_field-fieldname = 'MAKTG'.
       wa_makt_field-tabname = 'MAKT'.
       wa_makt_field-seltext_m = 'MAKTG'.
       APPEND wa_makt_field TO it_makt_field.
       CLEAR wa_makt_field.
         wa_mard_field-col_pos = 1.
       wa_mard_field-fieldname = 'MATNR'.
       wa_mard_field-tabname = 'MARD'.
       wa_mard_field-seltext_m = 'MATNR'.
       APPEND wa_mard_field TO it_mard_field.
       CLEAR wa_mard_field.
       wa_mard_field-col_pos = 2.
       wa_mard_field-fieldname = 'WERKS'.
       wa_mard_field-tabname = 'MARD'.
       wa_mard_field-seltext_m = 'WERKS'.
       APPEND wa_mard_field TO it_mard_field.
       CLEAR wa_mard_field.
       wa_mard_field-col_pos = 3.
       wa_mard_field-fieldname = 'LGORT'.
       wa_mard_field-tabname = 'MARD'.
       wa_mard_field-seltext_m = 'LGORT'.
       APPEND wa_mard_field TO it_mard_field.
       CLEAR wa_mard_field.
       wa_events-form = 'TOP_PAGE'.
       wa_events-name  = 'TOP_OF_PAGE'.
       APPEND wa_events TO it_events.
    ENDFORM.                    " FIELD_CAT
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
       SELECT *
       FROM mara
       INTO TABLE it_mara
       WHERE matnr IN s_matnr.
       SELECT *
       FROM makt
       INTO TABLE it_makt
       WHERE matnr IN s_matnr.
       SELECT *
       FROM mard
       INTO TABLE it_mard
       WHERE matnr IN s_matnr.
    ENDFORM.                    " SELECT_DATA

  • END OF PAGE IN BLOCK  ALV : PLZ HELP

    Hi experts.
    I have a requirement to display top-of-page end-of-page end-of-list in block alv but the problem is that end-of-page is not getting triggered instead top-of-page is getting triggered twice.
    Below is the code for your reference :
    REPORT  zbhr_workers_comp_report
    LINE-COUNT 60(4)
    LINE-SIZE 999
    NO STANDARD PAGE HEADING
    MESSAGE-ID zmhr.
    *//// This is how event table is getting populated:*
    FORM events_get1  CHANGING t1_events TYPE slis_t_event.
      DATA:ls1_events TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        IMPORTING
          et_events = t1_events.
      READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_top_of_page.
      IF sy-subrc = 0.
        MOVE c_form_top_of_page TO ls1_events-form.
       APPEND ls1_events TO t1_events.
        modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
        CLEAR ls1_events.
      ENDIF.
    READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_page.
      IF sy-subrc = 0.
        MOVE c_form_end_of_page TO ls1_events-form.
       APPEND ls1_events TO t1_events.
        modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
        CLEAR ls1_events.
      ENDIF.
      READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_list.
      IF sy-subrc = 0.
        MOVE c_form_end_of_list TO ls1_events-form.
       APPEND ls1_events TO t1_events.
        modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
        CLEAR ls1_events.
      ENDIF.
    ENDFORM.                    " EVENTS_GET1
    FORM    :  TOP_OF_PAGE
    FORM top_of_page.
      WRITE : /45 text-020, 65(5) text-021 , 71(11) v_begda, 84(3) text-022 , 89(11) v_endda.
    ENDFORM. "TOP_OF_PAGE
    FORM    :  end_of_page
    FORM end_of_page.
    DATA: lv_process TYPE i.
      CLEAR: lv_process.
       LOOP AT t_final_temp INTO w_final_temp where customer = t_final-customer.
         lv_process = lv_process + 1.
      ENDLOOP.
    *RESERVE 3 LINES.
      WRITE: /4 'Number of read Record : '(023), v_total_read.
      WRITE: /4 'Number of processed Record : '(024), lv_process.
    ENDFORM. "end_of_page
    FORM    :  end_of_list
    FORM end_of_list .
    v_total_process =  LINES( t_final[] ).
    WRITE: /4 'Total sum of all processed data: '(029), v_total_process.
    ENDFORM. "end_of_list
    *****Displaying the block alv.
    FORM display_output .
    To restrict the display of sel info and list info.
      st_print-no_print_selinfos = 'X'.
      st_print-no_print_listinfos = 'X'.
    st_print-reserve_lines = 2. " Lines reserved for end of page
    Initialize ALV Block List
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = sy-repid.
    Append the ALV Block list with table t_final.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = w1_layout
          it_fieldcat                = t1_fieldcat
          i_tabname                  = 'T_FINAL'
          it_events                  = t1_events
          it_sort                    = t_sort
        TABLES
          t_outtab                   = t_final
        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.
    Append the ALV Block list with table t_msg_display.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = w2_layout
          it_fieldcat                = t2_fieldcat
          i_tabname                  = 'T_MSG_DISPLAY'
          it_events                  = t2_events
        TABLES
          t_outtab                   = t_msg_display
        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 = ' '
          is_print          = st_print
        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_OUTPUT
    Above is the core logic which I have used for displaying top-of-page end-of-page and end-of-list in block alv.
    Please Help
    Regards
    Arvind.

    Hi
    MOVE 'TOP_OF_PAGE' TO ls1_events-form.
    what is thie c_form_top_of_page instead write as above ,i hope it will work
    Regards
    Pavan

  • How to download the blocked ALV output to PDF file.

    How to download the blocked ALV output to PDF file.
    I am able to download the BLocked ALV output in PDF format,
    but the each bolck in ALV is displaying different pages of PDF.
    In my report I have 4 block in 1 page, I am able to see the output in PDF but in different page.
    How to avoid the Page-break in PDF.
    Thanks,
    Ravi Yasoda.

    hi,
    I believe that your have 4 containers on the screen with individual ALV display. in this case, there is no way to get combined PDF output to my knowledge.
    However you can use Smartform/Sapscript as output which would allow you to display ALV in blocks and also print it in one.
    Regards,
    Nirmal

Maybe you are looking for