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

Similar Messages

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

  • 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

  • Blocked ALV report

    Hi
    I have a requirement to create a invoice report, I am planning to go with ALV, but the challenge is when it is printed the information related to each invoice should be printed separately.
    How do i go about doing this..
    your help is appreciated, Is blocked ALV report a solution for this?
    Thankyou
    Krishna Kiran

    You should read each line of the ALV and send them to the printer....I do it one and worked fine -;)
    Greetings,
    Blag.

  • In ALV report doubt

    Hi Expart,
    In ALV report ,what is the work of
    1) REUSE_ALV_VARIANT_DEFAULT_GET function module
    2) SLIS_LAYOUT_ALV
    Regards
    Bhabani

    Hi,
    1.SELECTING THE VARIANTS FOR INITIAL LIST DISPLAY (DEFAULT VARIANT)
    The variants in the list display can be both user-specific and general. The user can programmatically set the initial (default) variant for list display.
    The default variant can be found using the function module 'REUSE_ALV_VARIANT_DEFAULT_GET'.
    Sample code:
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = variant save condition ( A=all, U = user-specific )
           CHANGING
                cs_variant = internal table containing the program name (and the default variant---optional )
           EXCEPTIONS
                not_found  = 2.
    2.A layout is build for the report output list description USING the internal table declared above (I_LAYOUT).
    Output list description structure.
         The parameters are described under the following heads:
    •     Display options
    •     Exceptions
    •     Totals
    •     Interaction
    •     Detail screen
    •     Display variants (only for hierarchical-sequential lists)
    •     Color
    •     Other
    The layout table is of type slis_layout_alv_spec and has the following fields:
    Reward,if useful.
    Thanks,
    Chandu

  • ALV Report doubt

    Hi All
    I am creating a ALV report and had realized that we can use REUSE_ALV_FIELDCATALOG_MERGE to create a fieldcatalog.
    However in I_STRUCTURE_NAME parameters I have to pass only structure that are defined in DDIC. I can"t pass my internal table defined for output.
    So this option maynot be much useful. instead I can build fieldcatalog manually.
    Am I right ? also at this time I am only concentrating on ALV using Functional Modules. Please let me know.
    Regards
    Madhu.

    Hi ERIC and others,
    Thanks you once again.
    Can you please let me know where I am doing mistake, i am not getting totals on price but I getting sort on carrid and they are grouping.
    Please help me.
    REPORT  ZALV_REPORT_SFLIGHT.
    TABLES : SFLIGHT.
    TYPE-POOLS : SLIS.
    DATA :   IT_SFLIGHT TYPE TABLE OF SFLIGHT.
    **DATA DECLARTION
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_sort type STANDARD TABLE OF slis_sortinfo_alv WITH HEADER LINE,
          I_REPID      LIKE SY-REPID.
    i_repid = sy-repid.
    perform get_data.
    perform build_fieldcat.
    perform display.
    *&      Form  get_data
    form get_data .
    select * from sflight into table it_sflight.
    endform.                    " get_data
    *&      Form  build_fieldcat
    form build_fieldcat .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = i_repid
       I_INTERNAL_TABNAME           = 'IT_SFLIGHT'
       I_STRUCTURE_NAME             = 'SFLIGHT'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   =
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = FIELDCATALOG[]
    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.
    GD_sort-fieldname = 'CARRID'.
    GD_sort-tabname = 'SFLIGHT'.
    *GD_sort-up  =
    *GD_sort-down =
    *GD_sort-group = 'X'.
    GD_sort-subtot = 'X'.
    append gd_sort TO GD_SORT.
    endform.                    " build_fieldcat
    *&      Form  display
    form display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = I_REPID
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = FIELDCATALOG[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           = GD_sort[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = IT_SFLIGHT
    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
    Thank you

  • Checkbox in alv report-doubt

    hi all
        can anybody tell me the coding lines for
    1)when checking a check box 'test run' in selection-screen,
    a particular output field(for eg.,itab_final-WBS1) has to be updated in standard table(e.g,CATSDB-WBS)  ,if not checked,it should not be updated,just the user has to view the report
    thanks in advance
    Moderator Message: Please do your on work. If you get stuck after putting some effort from your side, then ask a specific question here.
    Edited by: kishan P on Apr 7, 2011 10:30 AM

    Hi,
    1.SELECTING THE VARIANTS FOR INITIAL LIST DISPLAY (DEFAULT VARIANT)
    The variants in the list display can be both user-specific and general. The user can programmatically set the initial (default) variant for list display.
    The default variant can be found using the function module 'REUSE_ALV_VARIANT_DEFAULT_GET'.
    Sample code:
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = variant save condition ( A=all, U = user-specific )
           CHANGING
                cs_variant = internal table containing the program name (and the default variant---optional )
           EXCEPTIONS
                not_found  = 2.
    2.A layout is build for the report output list description USING the internal table declared above (I_LAYOUT).
    Output list description structure.
         The parameters are described under the following heads:
    •     Display options
    •     Exceptions
    •     Totals
    •     Interaction
    •     Detail screen
    •     Display variants (only for hierarchical-sequential lists)
    •     Color
    •     Other
    The layout table is of type slis_layout_alv_spec and has the following fields:
    Reward,if useful.
    Thanks,
    Chandu

  • 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

  • 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

  • Totals and subtotals in blocked alv

    hi
    totals and subtotals for data type (CURR) fields is not coming in blocked alv report... Plz can u help us in this regard.. urgent.
    thnx in advance

    have a look on this
    REPORT  YMS_ALVBLOCKLIST.
    TABLES:LFA1,EKKO.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    END OF ITAB.
    DATA:BEGIN OF JTAB OCCURS 0,
    LIFNR LIKE EKKO-LIFNR,
    EBELN LIKE EKKO-EBELN,
    BUKRS LIKE EKKO-BUKRS,
    BSTYP LIKE EKKO-BSTYP,
    EKORG LIKE EKKO-EKORG,
    BSART LIKE EKKO-BSART,
    END OF JTAB.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE JTAB WHERE LIFNR
    IN LIFNR.
    TYPE-POOLS:SLIS.
    DATA:LAYOUT TYPE slis_layout_alv.
    DATA:EVE TYPE slis_t_event WITH HEADER LINE.
    DATA:EVE1 TYPE slis_t_event WITH HEADER LINE.
    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
    DATA:FCAT TYPE slis_t_fieldcat_alv.
    DATA:FCAT1 TYPE slis_t_fieldcat_alv.
    LAYOUT-ZEBRA = 'X'.
    LAYOUT-colwidth_optimize = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDOR DETAILS SCREEN'.
    EVE1-NAME = 'TOP_OF_PAGE'.
    EVE1-FORM = 'TOP_OF_PAGE1'.
    APPEND EVE1.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = EVE[]
    EXCEPTIONS
    LIST_TYPE_WRONG = 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.
    READ TABLE EVE WITH KEY NAME = 'TOP_OF_PAGE'.
    EVE-FORM = 'TOP_OF_PAGE'.
    MODIFY EVE TRANSPORTING FORM WHERE NAME = 'TOP_OF_PAGE'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
    * IT_EXCLUDING =
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    * I_STRUCTURE_NAME =
    * I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME = SY-REPID
    * I_BYPASSING_BUFFER =
    * I_BUFFER_ACTIVE =
    CHANGING
    CT_FIELDCAT = FCAT
    * 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.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    I_TABNAME = 'ITAB'
    IT_EVENTS = EVE[]
    * IT_SORT =
    * I_TEXT = ' '
    TABLES
    T_OUTTAB = ITAB
    * EXCEPTIONS
    * PROGRAM_ERROR = 1
    * MAXIMUM_OF_APPENDS_REACHED = 2
    * OTHERS = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'JTAB'
    * I_STRUCTURE_NAME =
    * I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME = SY-REPID
    * I_BYPASSING_BUFFER =
    * I_BUFFER_ACTIVE =
    CHANGING
    CT_FIELDCAT = FCAT1
    * 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.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT1
    I_TABNAME = 'JTAB'
    IT_EVENTS = EVE1[]
    * IT_SORT =
    * I_TEXT = ' '
    TABLES
    T_OUTTAB = JTAB
    * EXCEPTIONS
    * PROGRAM_ERROR = 1
    * MAXIMUM_OF_APPENDS_REACHED = 2
    * OTHERS = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL 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_OF_PAGE.
    REFRESH HEAD.
    HEAD-TYP = 'H'.
    HEAD-INFO = 'VENDORS DETAILS'.
    APPEND HEAD.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEAD[]
    * I_LOGO =
    * I_END_OF_LIST_GRID =
    ENDFORM.
    FORM TOP_OF_PAGE1.
    REFRESH HEAD.
    HEAD-TYP = 'H'.
    HEAD-INFO = 'PURCHASE DOCCUMENTS DETAILS'.
    APPEND HEAD.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEAD[]
    * I_LOGO =
    * I_END_OF_LIST_GRID =
    ENDFORM.

  • How to send ALV report by Email

    Hi.
    we have developed a block ALV report which has 3 reports i.e Detail report , summary report and Error report. Currently user run the report in background.However there is need to send this report by Email . I can use FM:SO_OBJECT_SEND . I want how to pass this report to FM and how to handle if there are multiple email ids. I think we can create a group of the user with email id in business workplace and pass the group to FM.
    I need help in how to assign the report and user group to this FM

    Hi,
    You may use the code given by Amit in this link -
    MAil Attachment.
    It is perfect to handle any type of email requirement.
    Regards,
    Amit
    Reward all helpful replies.

  • Problem in Blocked ALv's

    Hi,
    I have a requirement where i am supposed to display the employee details( Personal details, Education details and corporate details) in different blocks. I am using Blocked ALV for displaying the same, and displaying .
    But the problem is that i have to display the information in page by page - that is for every employee i have to display 3 blocks, and so on for all the employees given in the selection criteria. I am not able to do so.
    For a single employee i am using the following -
    1. 'REUSE_ALV_BLOCK_LIST_INIT'
    2. 'REUSE_ALV_BLOCK_LIST_APPEND' - 3 times for three blocks
    3. 'REUSE_ALV_BLOCK_LIST_DISPLAY' - for displaying the info.
    Regrds,
    Srini

    Hi this can help u,
    BLOCKED ALV REPORT.
    REPORT  ZCS_PRG21.
    TABLES: LFA1,EKKO.
    DATA:  BEGIN OF ITAB OCCURS 0,
           LIFNR LIKE LFA1-LIFNR,
           NAME1 LIKE LFA1-NAME1,
           ORT01 LIKE LFA1-ORT01,
           LAND1 LIKE LFA1-LAND1,
           REGIO LIKE LFA1-REGIO,
           END OF ITAB.
    DATA:  BEGIN OF JTAB OCCURS 0,
           LIFNR LIKE EKKO-LIFNR,
           EBELN LIKE EKKO-EBELN,
           BUKRS LIKE EKKO-BUKRS,
           BSTYP LIKE EKKO-BSTYP,
           EKORG LIKE EKKO-EKORG,
           BSART LIKE EKKO-BSART,
           END OF JTAB.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 5 ROWS.
    SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE JTAB UP TO 5 ROWS.
    TYPE-POOLS: SLIS.
    DATA:  LAYOUT TYPE SLIS_LAYOUT_ALV,
           HEADER TYPE SLIS_T_LISTHEADER WITH HEADER LINE,
           FLDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
           FLDCAT2 TYPE SLIS_T_FIELDCAT_ALV,
           EVE1 TYPE SLIS_T_EVENT WITH HEADER LINE,
           EVE2 TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-ZEBRA = 'X'.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'BLOCKED ALV'.
    EVE2-NAME = 'TOP_OF_PAGE'.
    EVE2-FORM = 'TOP_OF_PAGE1'.
    APPEND EVE2.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = EVE1[]
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
    READ TABLE EVE1 WITH KEY NAME = 'TOP_OF_PAGE'.
    EVE1-FORM = 'TOP_OF_PAGE'.
    MODIFY EVE1 TRANSPORTING FORM WHERE NAME = 'TOP_OF_PAGE'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = SY-REPID
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   =
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = SY-REPID
       I_INTERNAL_TABNAME           = 'ITAB' “it must be in capital letters, otherwise gives “no-fieldcatalog” is found
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = FLDCAT1
    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.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT
        IT_FIELDCAT                      = FLDCAT1
        I_TABNAME                        = 'ITAB'
        IT_EVENTS                        = EVE1[]
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = ITAB
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = SY-REPID
       I_INTERNAL_TABNAME           = 'JTAB'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = FLDCAT2
    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.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT
        IT_FIELDCAT                      = FLDCAT2
        I_TABNAME                        = 'JTAB'
        IT_EVENTS                        = EVE2[]
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = JTAB
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL 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_OF_PAGE.
    REFRESH HEADER.
    HEADER-TYP = 'H'.
    HEADER-INFO = 'VENDOR DETAILS'.
    APPEND HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = HEADER[]
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM TOP_OF_PAGE1.
    REFRESH HEADER.
    HEADER-TYP = 'H'.
    HEADER-INFO = 'PURCHASE DOCUMENTS DETAILS'.
    APPEND HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = HEADER[]
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    if u want more then try by adding the function modules
    'REUSE_ALV_BLOCK_LIST_APPEND' and 'REUSE_ALV_FIELDCATALOG_MERGE'
    reward points,if it is useful.
    thank you,
    chandu.

  • Alv reports sample example req..

    can anybody help me out with a simple example regarding ALV Reports.(simple ALV Reports , Blocked ALV Reports & Hierarchy ALV Reports).
    or pls send me a word document regarding the same ..to [email protected]
    response is highly appreciated..
    bye--
    Pradeepa

    Following document should get you started.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference For ALV Grid Control.pdf</a>
    tip : if you do a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/advancedsearch?query=alv%20grid&cat=sdn_all">search for alv grid</a> on the sdn homepage, this is the first result.
    Message was edited by:
            Dries Horions

  • Difference between blocked ALV and Hierarchical ALV

    Hi All,
    Can some body tell me what's the difference between hierarchical and blocked ALV Report Please telle me some body what's the type of ALV it's displaying for the standard Report V/LD this is pricing report I want to develop custom report exactly looks as V/LD but the problem is I am not able to identify what's the ALV format it's displaying either Hierarchical or blocked?
    Thanks&Regards
    Mahesh

    Hi Mahesh,
    Blocked ALV displays the data in blocks together in output. e.g. suppose you want to dsplay the data of header & item level. Then you candisplay the data of header records in first block & Item level data in another block on same output screen.
    For hierarchical ALV  check the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6e/4e2941fa918739e10000000a1550b0/frameset.htm
    & check this link also:
    /people/sap.user72/blog/2005/09/14/a-new-approach-to-alv-programming
    Reward points if helpful answer.
    Ashvender

Maybe you are looking for

  • Desktop viewing - I can't see the bottom part of pages

    hi, when i load a program, e.g. garage band (not safari that works) it doesn't allow me to see the bottom of the screen - like the page is too big or it's been stretched, this means i can't get access to some of the major controllers. I've went throu

  • R12 ACH for wellsfargo (NACHA/CREDIT/DEBIT)

    Hi I am working on 11i to R12 upgrade project. I need to create and implement ACH(NACHA/CREDIT/DEBIT) format in R12 environment.Can someone tell me how should i do that All I have is SQL and flatfile from 11.5.10 instance Do I need to create a Etext

  • BAPI_INVOICEEC_CREATE

    Hello All, My team is trying to use BAPI_INVOICEEC_CREATE to electronically post invoices from our external supplies to SRM 5.0 using an XI interface. However,  at present we are testing the BAPI using SE37 test tool.   We have set up a test sequence

  • Adding Undo-Redo buttons to toolbar?

    Is it possible to add Undo and Redo buttons to the toolbar?  Seems to me like this would be an obvious capability. Thanks!

  • RoboHelp unable to start word

    Using RoboHelp 7 & Word 2003 (service packs installed) on XP. I try to open an old project RoboHelp 6. Word Starts. However after a long period of time I get a dialog box saying: 'RoboHelp Explorer is unable to start Microsoft Word'. Bit of a show st