Printing problem in Blocked ALV

Hello,
I  am displaying a report using ALV blocked list where I have to do transpose of the output table using dynamic internal table.
Now I need to take the printout of report , but can not do it through spool beause I need to print material no on the top of the each block and the relavent data in the transposed from. So I am downloading it in word and printing. But now i need to print each new material and its block on new page. New-page is not workijg, neiither i can use sort.
Please suggest some good solution for this.
Thanks in advance

Hello,
I  am displaying a report using ALV blocked list where I have to do transpose of the output table using dynamic internal table.
Now I need to take the printout of report , but can not do it through spool beause I need to print material no on the top of the each block and the relavent data in the transposed from. So I am downloading it in word and printing. But now i need to print each new material and its block on new page. New-page is not workijg, neiither i can use sort.
Please suggest some good solution for this.
Thanks in advance

Similar Messages

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

  • Problem In Block ALV

    Dear Friends,
      I am using Block ALV. I need diffrent labels (headings) before each block of alv. Is there any way?
    Regards,
    Bhavin

    *& Report  ZSD_DESPATCH
    REPORT  ZSD_DESPATCH NO STANDARD PAGE HEADING.
    *& Type Pool Declaration
    TYPE-POOLS: SLIS.
    *& External Table Declaration
    TABLES: VBRK, VBRP.
    *& Types Declaration
    TYPES: BEGIN OF ST_VBRKVBRP,
                 SORTL LIKE KNA1-SORTL, "Customer Sort Name
                 SALE(15),
                 BISMT LIKE MARA-BISMT, "Size
                 VBELN LIKE VBRK-VBELN, "Billing Doc Number
                 KUNAG LIKE VBRK-KUNAG, "Customer
                 VTWEG LIKE VBRK-VTWEG, "Distribution Channel
                 FKART LIKE VBRK-FKART, "Billing Doc Type
                 KNUMV LIKE VBRK-KNUMV, "Condition Record Number
                 VKORG LIKE VBRK-VKORG, "Sales Organization
                 KURRF LIKE VBRK-KURRF, "Billing Exchange Rate
                 WAERK LIKE VBRK-WAERK, "SD document currency
                 MATNR LIKE VBRP-MATNR, "Material Number
                 MATKL LIKE VBRP-MATKL, "Material group
                 FKIMG LIKE VBRP-FKIMG, "Actual billed quantity
                 POSNR LIKE VBRP-POSNR, "Item Position Number
                 PR00  LIKE KONV-KWERT, "PR00 Condition Based Value
                 ZDRP  LIKE KONV-KWERT, "ZDRP Condition Based Value
                 FUNEL LIKE VBRP-FKIMG, "FUNEL Quantity
                 PANEL LIKE VBRP-FKIMG, "PANEL Quantity
                 FKDAT LIKE VBRK-FKDAT, "Billing date
           END   OF ST_VBRKVBRP.
    TYPES: BEGIN OF ST_FOR_MONTH,
                 SORTL LIKE KNA1-SORTL,
                 SALE(15),
                 BISMT LIKE MARA-BISMT,
                 PANEL LIKE VBRP-FKIMG,
                 FUNEL LIKE VBRP-FKIMG,
                 PR00  LIKE KONV-KWERT,
                 ZDRP  LIKE KONV-KWERT,
           END   OF ST_FOR_MONTH.
    TYPES: BEGIN OF ST_FOR_DAY,
                 SORTL LIKE KNA1-SORTL,
                 SALE(15),
                 BISMT LIKE MARA-BISMT,
                 PANEL LIKE VBRP-FKIMG,
                 FUNEL LIKE VBRP-FKIMG,
                 PR00  LIKE KONV-KWERT,
                 ZDRP  LIKE KONV-KWERT,
           END   OF ST_FOR_DAY.
    *& Internal Table Declaration
    DATA: IT_VBRKVBRP  TYPE STANDARD TABLE OF ST_VBRKVBRP.
    DATA: IT_FOR_MONTH TYPE STANDARD TABLE OF ST_FOR_MONTH.
    DATA: IT_FOR_DAY   TYPE STANDARD TABLE OF ST_FOR_DAY.
    *& Work Areas Declaration
    DATA: WA_VBRKVBRP  LIKE LINE OF IT_VBRKVBRP.
    DATA: WA_FOR_MONTH LIKE LINE OF IT_FOR_MONTH.
    DATA: WA_FOR_DAY   LIKE LINE OF IT_FOR_DAY.
    *& Variables Declaration
    DATA : VALU        TYPE D,
           LOWDATE     TYPE D,
           HIGHDATE    TYPE D,
           L_LOWDT     TYPE D,
           L_HIGHDT    TYPE D,
           DAY         TYPE I,
           MONTH       TYPE I,
           LMONTH      TYPE I,
           MODN        TYPE I,
           PARTY_C(9)  TYPE C,
           LCMON(2)    TYPE C,
           YEAR(4)     TYPE C,
           LYEAR(4)    TYPE C,
           MONTH_NM(4) TYPE C,
           PARTY       LIKE VBRK-KUNAG,
           MATR        LIKE VBRP-MATNR,
           MATGRP      LIKE VBRP-MATKL.
    DATA: COUNTER TYPE I.
    *& ALV Data Declaration
    DATA: IT_FIELDCAT_FOR_DAY    TYPE SLIS_T_FIELDCAT_ALV.
    DATA: IT_FIELDCAT_FOR_MONTH  TYPE SLIS_T_FIELDCAT_ALV.
    DATA: WA_FIELDCAT_FOR_DAY    LIKE LINE OF IT_FIELDCAT_FOR_DAY.
    DATA: IT_EVENT_FOR_DAY      TYPE SLIS_T_EVENT WITH HEADER LINE.
    DATA: IT_EVENT_FOR_MONTH    TYPE SLIS_T_EVENT WITH HEADER LINE.
    DATA: TOP_OF_LIST_FOR_DAY TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST_FOR_DAY'.
    DATA: TOP_OF_LIST_FOR_MON TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST_FOR_MONTH'.
    DATA: IS_LAYOUT_FOR_DAY   TYPE SLIS_LAYOUT_ALV.
    DATA: IS_LAYOUT_FOR_MONTH TYPE SLIS_LAYOUT_ALV.
    *& Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT_001.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_003.
    SELECT-OPTIONS: S_WERKS FOR VBRP-WERKS OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_004.
    SELECT-OPTIONS:   S_VKORG FOR VBRK-VKORG OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_005.
    SELECT-OPTIONS:   S_VTWEG FOR VBRK-VTWEG OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(23) TEXT_006.
    PARAMETERS : DATE LIKE VBRK-FKDAT OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT_002.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_007.
    PARAMETERS : G1 RADIOBUTTON GROUP 1.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_008.
    PARAMETERS : CH1 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_009.
    PARAMETERS : CH2 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_010.
    PARAMETERS : CH3 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_011.
    PARAMETERS : CH4 AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 1(20) TEXT_012.
    PARAMETERS : G2 RADIOBUTTON GROUP 1.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN : END OF BLOCK B2.
    *& Initialization Event
    INITIALIZATION.
      TEXT_001 = 'Despatch details report'.
      TEXT_002 = 'Data selection criteria'.
      TEXT_003 = 'Plant'.
      TEXT_004 = 'Sales Organization'.
      TEXT_005 = 'Distribution Channel'.
      TEXT_006 = 'Date'.
      TEXT_007 = 'Daily'.
      TEXT_008 = 'Monthly Despatch'.
      TEXT_009 = 'Plan Vs Despatch'.
      TEXT_010 = 'Total Basic Value'.
      TEXT_011 = 'Despatch Report'.
      TEXT_012 = 'Despatch Rep with only basic'.
    *& Start of Selection
    START-OF-SELECTION.
      PERFORM GET_LYEAR.
      PERFORM GET_DATA.
      PERFORM FILL_FOR_DAY.
      PERFORM FILL_FOR_MONTH.
      PERFORM FIELDCAT_FOR_DAY.
      PERFORM FIELDCAT_FOR_MONTH.
      PERFORM EVENTS_FOR_DAY.
      PERFORM EVENTS_FOR_MONTH.
      PERFORM APPEND_FOR_DAY.
      PERFORM APPEND_FOR_MONTH.
      PERFORM LIST_DISPLAY.
    *&      Form  GET_LYEAR
          text
    -->  p1        text
    <--  p2        text
    FORM GET_LYEAR.
      VALU      = DATE.
      DAY       = ( VALU+6(2) ) - 1.
      MONTH     = VALU+4(2).
      YEAR      = VALU+0(4).
      IF MONTH  = 1.
        LMONTH = 12.
        LYEAR  = VALU+0(4) - 1.
      ELSE.
        LMONTH = VALU+4(2) - 1.
        LYEAR  = YEAR.
      ENDIF.
      LCMON     = LMONTH.
      MODN = LYEAR MOD 4.
      IF LMONTH < 10 .
        CONCATENATE LYEAR '0' LCMON '01' INTO L_LOWDT.
        IF LMONTH = 01  OR LMONTH = 03  OR
           LMONTH = 05  OR LMONTH = 07  OR
           LMONTH = 08.
          CONCATENATE LYEAR '0' LCMON '31' INTO L_HIGHDT.
        ELSEIF LMONTH = 2.
          IF  MODN = 0.
            CONCATENATE LYEAR '0' LCMON '29' INTO L_HIGHDT.
          ELSE.
            CONCATENATE LYEAR '0' LCMON '28' INTO L_HIGHDT.
          ENDIF.
        ELSE.
          CONCATENATE LYEAR '0' LCMON '30' INTO L_HIGHDT.
        ENDIF.
      ELSE.
        CONCATENATE LYEAR LCMON '01' INTO L_LOWDT.
        IF LMONTH = 10  OR LMONTH = 12.
          CONCATENATE LYEAR LCMON '31' INTO L_HIGHDT.
        ELSE.
          CONCATENATE LYEAR LCMON '30' INTO L_HIGHDT.
        ENDIF.
      ENDIF.
      LOWDATE  = DATE - ( DAY ).
      HIGHDATE = DATE.
    *& At the of this form following date we get
    *& L_HIGHDT - Last Month Hight Date
    *& L_LOWDT  - Last Month Low Date
    *& LOWDATE  - Current Month Low Date
    *& HIGHDATE - Current Month High Date
    ENDFORM.                    " GET_LYEAR
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA.
      SELECT VBRKVBELN VBRKKUNAG VBRK~VTWEG
             VBRKFKART VBRKKNUMV VBRP~MATNR
             VBRPMATKL VBRPFKIMG VBRK~VKORG
             VBRKWAERK VBRKKURRF VBRP~POSNR
             VBRK~FKDAT
             INTO CORRESPONDING FIELDS OF WA_VBRKVBRP
             FROM VBRK INNER JOIN VBRP ON
             VBRKVBELN = VBRPVBELN
              WHERE VBRP~WERKS IN S_WERKS AND
                    VBRP~VKORG_AUFT IN S_VKORG AND
                    VBRP~VTWEG_AUFT IN S_VTWEG AND
                    VBRK~FKDAT BETWEEN LOWDATE AND DATE  AND
                    ( VBRP~MATKL = 'GLASS SHE'     OR
                      VBRP~MATKL = 'GLASS FNL'     OR
                      VBRP~MATKL = 'GLASS PNL')   AND
                    VBRK~RFBSK = 'C'.
                  ORDER BY VBRKVBELN VBRPMATNR.
    *& Select PR00 based value
        SELECT SINGLE KWERT INTO WA_VBRKVBRP-PR00
              FROM KONV
              WHERE KNUMV = WA_VBRKVBRP-KNUMV AND
                    KPOSN = WA_VBRKVBRP-POSNR AND
                    KSCHL = 'PR00'.
    *& Select ZDRP based value
        SELECT SINGLE KWERT INTO WA_VBRKVBRP-ZDRP
              FROM KONV
              WHERE KNUMV = WA_VBRKVBRP-KNUMV AND
                    KPOSN = WA_VBRKVBRP-POSNR AND
                    KSCHL = 'ZDRP'.
    *& Select Sort name of the party
        SELECT SINGLE SORTL INTO WA_VBRKVBRP-SORTL
               FROM KNA1
               WHERE KUNNR = WA_VBRKVBRP-KUNAG.
    *& Select size of the product
        SELECT SINGLE BISMT INTO WA_VBRKVBRP-BISMT
               FROM MARA
               WHERE MATNR = WA_VBRKVBRP-MATNR.
    *& Multiply with exchange Rate
        WA_VBRKVBRP-PR00 = WA_VBRKVBRP-PR00 * WA_VBRKVBRP-KURRF.
        WA_VBRKVBRP-ZDRP = WA_VBRKVBRP-ZDRP * WA_VBRKVBRP-KURRF.
    *& Deciding Return and Fresh Sale
        IF WA_VBRKVBRP-VKORG = '1200' AND
           WA_VBRKVBRP-VTWEG = '40'.
          IF WA_VBRKVBRP-FKART = 'ZVRO' OR
             WA_VBRKVBRP-FKART = 'ZVRW'.
            WA_VBRKVBRP-SALE = 'Return'.
          ELSE.
            WA_VBRKVBRP-SALE = 'Fresh Sale'.
          ENDIF.
        ENDIF.
    *& Deciding Export Sale
        IF WA_VBRKVBRP-VKORG = '1202' AND
           WA_VBRKVBRP-VTWEG = '45'.
          WA_VBRKVBRP-SALE = 'Export'.
        ENDIF.
    *& Deciding Panel Quantity for the billing
        IF WA_VBRKVBRP-MATKL = 'GLASS SHE' OR
           WA_VBRKVBRP-MATKL = 'GLASS PNL'.
          WA_VBRKVBRP-PANEL = WA_VBRKVBRP-FKIMG.
        ENDIF.
    *& Deciding Funel Quantity for the billing
        IF WA_VBRKVBRP-MATKL = 'GLASS FNL'.
          WA_VBRKVBRP-FUNEL = WA_VBRKVBRP-FKIMG.
        ENDIF.
    *& Indicating Minus Price and quantity for the Return Sale
        IF WA_VBRKVBRP-FKART = 'ZVRO' OR
           WA_VBRKVBRP-FKART = 'ZVRW'.
          WA_VBRKVBRP-PANEL = WA_VBRKVBRP-PANEL * -1.
          WA_VBRKVBRP-FUNEL = WA_VBRKVBRP-FUNEL * -1.
          WA_VBRKVBRP-PR00  = WA_VBRKVBRP-PR00  * -1.
          WA_VBRKVBRP-ZDRP  = WA_VBRKVBRP-ZDRP  * -1.
        ENDIF.
        APPEND WA_VBRKVBRP TO IT_VBRKVBRP.
        CLEAR: WA_VBRKVBRP.
      ENDSELECT.
      SORT IT_VBRKVBRP BY SORTL SALE BISMT.
    ENDFORM.                    " get_data
    *&      Form  FILL_FOR_DAY
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FOR_DAY.
      LOOP AT IT_VBRKVBRP INTO WA_VBRKVBRP WHERE FKDAT = HIGHDATE.
        AT NEW BISMT.
          WA_FOR_DAY-SORTL = WA_VBRKVBRP-SORTL.
          WA_FOR_DAY-SALE  = WA_VBRKVBRP-SALE.
          WA_FOR_DAY-BISMT = WA_VBRKVBRP-BISMT+0(3).
        ENDAT.
        WA_FOR_DAY-PANEL = WA_FOR_DAY-PANEL + WA_VBRKVBRP-PANEL.
        WA_FOR_DAY-FUNEL = WA_FOR_DAY-FUNEL + WA_VBRKVBRP-FUNEL.
        WA_FOR_DAY-PR00  = WA_FOR_DAY-PR00  + WA_VBRKVBRP-PR00.
        WA_FOR_DAY-ZDRP  = WA_FOR_DAY-ZDRP  + WA_VBRKVBRP-ZDRP.
        AT END OF BISMT.
          APPEND WA_FOR_DAY TO IT_FOR_DAY.
          CLEAR: WA_FOR_DAY.
        ENDAT.
        CLEAR: WA_VBRKVBRP.
      ENDLOOP.
    ENDFORM.                    " FILL_FOR_DAY
    *&      Form  FILL_FOR_MONTH
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FOR_MONTH.
      LOOP AT IT_VBRKVBRP INTO WA_VBRKVBRP.
        AT NEW BISMT.
          WA_FOR_MONTH-SORTL = WA_VBRKVBRP-SORTL.
          WA_FOR_MONTH-SALE  = WA_VBRKVBRP-SALE.
          WA_FOR_MONTH-BISMT = WA_VBRKVBRP-BISMT.
        ENDAT.
        WA_FOR_MONTH-PANEL = WA_FOR_MONTH-PANEL + WA_VBRKVBRP-PANEL.
        WA_FOR_MONTH-FUNEL = WA_FOR_MONTH-FUNEL + WA_VBRKVBRP-FUNEL.
        WA_FOR_MONTH-PR00  = WA_FOR_MONTH-PR00  + WA_VBRKVBRP-PR00.
        WA_FOR_MONTH-ZDRP  = WA_FOR_MONTH-ZDRP  + WA_VBRKVBRP-ZDRP.
        AT END OF BISMT.
          APPEND WA_FOR_MONTH TO IT_FOR_MONTH.
          CLEAR: WA_FOR_MONTH.
        ENDAT.
        CLEAR: WA_VBRKVBRP.
      ENDLOOP.
    ENDFORM.                    " FILL_FOR_MONTH
    *&      Form  FIELDCAT_FOR_DAY
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT_FOR_DAY .
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'SORTL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Party Name'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'SALE'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Sale 4 day'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'BISMT'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Sizes'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 5.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'PANEL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Panel'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'FUNEL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Funel'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'PR00'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Basic Value (Rs.)'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 15.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'ZDRP'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_DAY'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Disc Value (Lacs.)'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 15.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_DAY.
      CLEAR WA_FIELDCAT_FOR_DAY.
    ENDFORM.                    " FIELDCAT_FOR_DAY
    *&      Form  FIELDCAT_FOR_MONTH
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT_FOR_MONTH .
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'SORTL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Party Name'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'SALE'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Sale'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'BISMT'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Sizes'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 5.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'PANEL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Panel'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'FUNEL'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Funel'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 10.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'PR00'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Basic Value (Rs.)'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 15.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
      COUNTER = COUNTER + 1.
      WA_FIELDCAT_FOR_DAY-COL_POS    = COUNTER.
      WA_FIELDCAT_FOR_DAY-FIELDNAME  = 'ZDRP'.
      WA_FIELDCAT_FOR_DAY-TABNAME    = 'IT_FOR_MONTH'.
      WA_FIELDCAT_FOR_DAY-SELTEXT_L  = 'Disc Value (Lacs.)'.
      WA_FIELDCAT_FOR_DAY-OUTPUTLEN  = 15.
      APPEND WA_FIELDCAT_FOR_DAY TO IT_FIELDCAT_FOR_MONTH.
      CLEAR WA_FIELDCAT_FOR_DAY.
    ENDFORM.                    " FIELDCAT_FOR_MONTH
    *&      Form  EVENTS_FOR_DAY
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS_FOR_DAY .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = IT_EVENT_FOR_DAY[]
        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 IT_EVENT_FOR_DAY
                 WITH KEY NAME = SLIS_EV_TOP_OF_LIST
                 INTO IT_EVENT_FOR_DAY.
      IF SY-SUBRC = 0.
        MOVE TOP_OF_LIST_FOR_DAY TO IT_EVENT_FOR_DAY-FORM.
        APPEND IT_EVENT_FOR_DAY.
      ENDIF.
    ENDFORM.                    " EVENTS_FOR_DAY
    *&      Form  EVENTS_FOR_MONTH
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS_FOR_MONTH .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = IT_EVENT_FOR_MONTH[]
        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 IT_EVENT_FOR_MONTH
                 WITH KEY NAME = SLIS_EV_TOP_OF_LIST
                 INTO IT_EVENT_FOR_MONTH.
      IF SY-SUBRC = 0.
        MOVE TOP_OF_LIST_FOR_MON TO IT_EVENT_FOR_MONTH-FORM.
        APPEND IT_EVENT_FOR_MONTH.
      ENDIF.
      CLEAR: IT_EVENT_FOR_MONTH.
    ENDFORM.                    " EVENTS_FOR_MONTH
    *&      Form  TOP_OF_LIST_FOR_DAY
          text
    -->  p1        text
    <--  p2        text
    FORM TOP_OF_LIST_FOR_DAY.
      WRITE: / 'FOR DAY'.
    ENDFORM.                    " EVENTS_FOR_MONTH
    *&      Form  TOP_OF_LIST_FOR_MONTH
          text
    -->  p1        text
    <--  p2        text
    FORM TOP_OF_LIST_FOR_MONTH.
      WRITE: / 'FOR MONTH'.
    ENDFORM.                    " EVENTS_FOR_MONTH
    *&      Form  APPEND_FOR_DAY
          text
    -->  p1        text
    <--  p2        text
    FORM APPEND_FOR_DAY .
      IF NOT IT_FOR_DAY IS INITIAL.
        WA_FOR_DAY-SORTL = ''.
        APPEND WA_FOR_DAY TO IT_FOR_DAY.
        CLEAR: WA_FOR_DAY.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IT_FIELDCAT = IT_FIELDCAT_FOR_DAY
          IS_LAYOUT   = IS_LAYOUT_FOR_DAY
          I_TABNAME   = 'IT_FOR_DAY'
          IT_EVENTS   = IT_EVENT_FOR_DAY[]
        TABLES
          T_OUTTAB    = IT_FOR_DAY[].
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " APPEND_FOR_DAY
    *&      Form  APPEND_FOR_MONTH
          text
    -->  p1        text
    <--  p2        text
    FORM APPEND_FOR_MONTH .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IT_FIELDCAT = IT_FIELDCAT_FOR_MONTH
          IS_LAYOUT   = IS_LAYOUT_FOR_MONTH
          I_TABNAME   = 'IT_FOR_MONTH'
          IT_EVENTS   = IT_EVENT_FOR_MONTH[]
        TABLES
          T_OUTTAB    = IT_FOR_MONTH[].
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " APPEND_FOR_MONTH
    *&      Form  LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM LIST_DISPLAY .
      DATA: GT_PRINT TYPE SLIS_PRINT_ALV.
      GT_PRINT-RESERVE_LINES = 2.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        EXPORTING
          IS_PRINT = GT_PRINT.
      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.                    " LIST_DISPLAY

  • ALV Grid and Icon : Printing Problem

    Hi, i develop some reports using ALV Grid and Icon and i'm facing printing problem, all report that using ALV grid with the option icon = 'X' cannot print properly, all the character field showing improper icon instead of the text. While all the ALV grid report with the option icon = ' ' can print normally.
    Thanks.

    Hi,
    Check the Demo Program <b>BCALV_DEMO_TOOLTIP</b>, Here i am able to see the Output Properly, and also able to Print them.
    Regards
    vijay

  • Blocked alv print out.

    hi,
    I generated a 3 internal table Blocked ALV program. If i try to take print out, these theree internal table data means individual block of data is getting in separate separate pages. I want this three Internal table data i need to  print in single page. If any one knows plz help me.
    regards,
    bab

    Hi ,
    Can you check your code  is there  parameter   " gs_print-grpchgedit = 'X'. " if  this parameter is  "X" then  it will  print in separate  page's  that is  Page  Break set.  if you remove  then it will continue in the same page  . but still it depends on the Number of entires in each table  . if each table has 5 entires then it will display in the same page.
    Also for more information about the "gs_print-grpchgedit = 'X'."
    Link  : [Page Break while Printing ALV;
    Regards

  • Problem when printing icons of an ALV grid

    I made an Alv grid report that has some icons.When i printed i don't see the icons but isee some characters ...
    What can i do ?
    Thanks a lot ....

    hi good
    if you take the print out of a alv grid report it wont show you the icon pictures in your paper,it wll show you the respective characters for those icons,
    Thanks
    mrutyun^

  • Alv printing problem

    Hello,
    The print-out of my alv is printing  XXXXXXX over the rows highlighted.
    How to solve this?
    Thanks

    hi Alberto,
    do you do some colouring in your ALV? If yes, take it back or use different colour...
    hope this helps
    ec

  • What is blocked alv

    can any one explain me what is a blocked alv
    Message was edited by:
            ameen shaik

    hi
    This report is used if you have to display more than one report on the output. Technically speaking if you have multiple internal table with data to be displayed as separate blocks then we go for block report of ALV
    This looks like a simple report but this report has the features of sorting
    and filtering only. 
    The important functions used for creating this report are:
         A. REUSE_ALV_BLOCK_LIST_INIT
         B. REUSE_ALV_BLOCK_LIST_APPEND
         C. REUSE_ALV_BLOCK_LIST_DISPLAY
    check with this report
    Declarations for BLOCK ALV DISPLAY
    *--type pools
    TYPE-POOLS:slis.
    DATA:x_layout TYPE slis_layout_alv,
    t_field TYPE slis_t_fieldcat_alv,
    *--field catalog
    x_fldcat LIKE LINE OF t_field,
    *--to hold all the events
    t_events TYPE slis_t_event,
    x_events TYPE slis_alv_event,
    t_sort TYPE slis_t_sortinfo_alv,
    x_sort LIKE LINE OF t_sort ,
    *--Print Layout
    x_print_layout TYPE slis_print_alv.
    *----Macro to add field catalog.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    DEFINE add_catalog.
    clear x_fldcat.
    x_fldcat-fieldname = &1.
    x_fldcat-seltext_m = &2.
    x_fldcat-outputlen = &3.
    x_fldcat-tech = &4.
    x_fldcat-col_pos = &5.
    x_fldcat-no_zero = 'X'.
    x_fldcat-ddictxt = 'M'.
    x_fldcat-datatype = &6.
    x_fldcat-ddic_outputlen = &7.
    if &6 = 'N'.
    x_fldcat-lzero = 'X'.
    endif.
    *--build field catalog
    append x_fldcat to t_field.
    END-OF-DEFINITION.
    *----- data declerations.
    data: v_repid like sy-repid.
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    ernam like mara-ernam,
    meins like mara-meins,
    end of itab.
    data: begin of jtab occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of jtab.
    select matnr ernam meins
    up to 20 rows
    from mara
    into table itab.
    select matnr maktx
    up to 20 rows
    from makt
    into table jtab.
    v_repid = sy-repid.
    *DISPLAY alv
    Initialize Block
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
    exporting
    i_callback_program = v_repid.
    *Block 1:
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '18' '' '1' 'C' '18',
    'ERNAM' 'Created By' '12' '' '2' 'C' '12',
    'MEINS' 'Unit' '5' '' '3' 'C' '3'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST1'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'ITAB'
    it_events = t_events
    it_sort = t_sort
    tables
    t_outtab = itab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--BLOCK 2(SUMMARY REPORT)
    *INITIALIZE
    refresh t_field. clear t_field.
    refresh t_events.
    *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
    add_catalog:
    'MATNR' 'Material' '20' '' '1' 'C' '18',
    'MAKTX' 'Description' '40' '' '2' 'C' '40'.
    *--build table for events.
    x_events-form = 'TOP_OF_LIST2'.
    x_events-name = slis_ev_top_of_list.
    append x_events to t_events.
    Append table block.
    call function 'REUSE_ALV_BLOCK_LIST_APPEND'
    exporting
    is_layout = x_layout
    it_fieldcat = t_field
    i_tabname = 'JTAB'
    it_events = t_events
    tables
    t_outtab = jtab
    exceptions
    program_error = 1
    maximum_of_appends_reached = 2
    others = 3.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *--CALL FM TO DISPLAY THE BLOCK REPORT.
    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    exporting
    is_print = x_print_layout
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    form top_of_list1.
    skip 1.
    write: 10 'List 1',
    /5 '----
    skip 1.
    format reset.
    endform.
    form top_of_list2.
    skip 1.
    write: 10 'List 2',
    /5 '----
    skip 1.
    format reset.
    endform.
    and this link
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-ProgramforALVBlocklist&
    Hope this helps to solve ur problem....
    do reward if useful....
    regards
    dinesh

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

  • Printing problem when PDF is sent to the printer with certain fonts - missing text

    I'm running into a printing problem when PDFs containing certain characters of the Calibri font are used.  The text in large sections of the PDF is missing on the paper version, but the text is there on the screen.  It's also happened when the PDFs we created were e-mailed out to a client and printed on their printer.  The problem is not present when printing directly from the programs (Microsoft Word, Excel, Visio, etc.).  I've been trying to get tech support from Adobe on this, but every time I call they apologize and say they will call back in 4-6 hours with an answer.  Same result each time, no call back.  If anyone from Adobe is listening, it's case number 184891587.  The font appears as an embedded subset when I look at the document properties.  Sometimes deleting one or two Characters allows for larger text blocks to be printed - i.e. removing a long dash in bold from the heading of a paragraph makes the paragraph reappear when printed to paper from PDF.  In all cases the PDF appears correct on the screen.  Printing as an image allows the text to appear, but the image quality isn't acceptable for small text, even at the 600 dpi setting on the printer.  If the PDF is sent out by e-mail, we do not have control over the end-user's printer setup anyway, so we need this to work in all cases.  
    The setup/process I'm using is as follows:
    Windows 7 Professional SP1 64-Bit
    Microsoft Office 2013 - problem is present when printing documents from Word, Excel or Visio.  Even other variations on documents. 
    I've tried Acrobat versions 11.0.0 to 11.0.5 as well as Acrobat Pro 11.0.0 and 11.0.1.  Same Result
    Printing to Adobe PDF as the printer, from the third party application
    Printing to a Xerox printer from PDF using Acrobat - Text missing
    Client prints to Konica printer - Text missing
    I print to the wide-format Ricoh (which also does 11x17) and the text is present. 
    Is there something I'm missing?  Is the entire font not getting embedded into the PDF file?  I noticed that rolling back to a much older version of the Calibri font (1.02 compared to 5.72) makes the problem mostly go away, but it's not completely gone.  Is it possible the font is too large to be completely embedded?  Where can I go from here? 

    Success!  At least for now.  It looks like my problem was fixed with Adobe's most recent update, 11.0.06.  From the release notes:
    PDF creation
    Added support for Lotus Notes 9.
    Added support for WebCapture in IE 11.
    Added support for conversions from AutoCAD 2013.
    3652540 A blank pdf is created for files having hidden visual style.
    3601108 Flow Chart converts as a multicolored square.
    3654345 Word documents missing parts of images in conversion to PDF.
    3654572 Temporary file size increases when creating pdf by combining multiple files into one PDF.
    3670155 PDF file created with Distiller XI prints incorrectly to some printers. (Emphasis mine)
    3599407 Checkbox check marks do not appear in these files.
    3663233 IE Web Capture in localized OS: Icons and drop-down menu items are missing and conversion dialog is not localized.
    3651931 Chrome Only: Few web pages when converted to pdf from Chrome plugin doesn’t show up the Save As dialog.
    3597910 EPM Mode On: Web capture is not working on Windows 8-32 bit when cache folder is missing.
    3610644 Firefox 23.0: With Firefox version 23.0 (latest), the WebCapture icon shows up very dim as if it is disabled.
    3650244 ODA falis to convert DWG files to PDF for large files.
    I don't know if that's definately what solved the problem, but it sure sounds similar and this is the update that made the printing problem go away.  We can't get the PDFs to fail at this point with our printers, even with Calibri 5.72.  I'll come back to thread if we have printing problems at the end-user locations. 

  • 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

  • How to 'EDIT field in a block AlV"

    <b>Hi Experts.
    i am having  a small query . i want to display some output in the block alv.
    After that i want one field in that Block Alv to be filled by the user  and then i
    want to do further calculation depending upom that field..
    please provide me support in this regard with coding part..
    An early reply will be highly appreciated...
    Regards.
    Neeraj</b>

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

  • Blocked alv list display

    hi,
    in blocked alv list , i want add push button on application tool bar. any one please tell me what is the process.?
    last time i added one push button on alv grid display, same process i followed now, but i did not get push button on application tool bar of , blocked alv list.

    I am able to add it , what is the problem you are facing.
    Check the Program BALVBT01.
    call function 'REUSE_ALV_BLOCK_LIST_INIT'
           exporting
                i_callback_program       = repid
                i_callback_user_command  = 'USER_COMMAND'
                i_callback_pf_status_set = 'STATUS'. "<------Status
    form pf_status_set using extab type slis_t_extab.
      BREAK-POINT.
      set pf-status 'STANDARD' excluding extab.
    endform.
    Copy the status From standard program SAPLKKBL, and Status is STANDARD using SE41 transaction.

Maybe you are looking for

  • Log on - Windows XP

    I just got my X300 and put on Windows XP because the Vista took up too much space on an already small hard drive. (Also wanted to get rid of bloatware and didn't like comfirming every move I made on Vista). I then wanted to get rid of the Welcome scr

  • Connecting Thunderbolt display to 2009 MacPro

    I have a 2009 Macpro with the GT 120 graphics card which has a dvi and mini display port. Can the thunderbolt be connected to the mini display por? I'm not interested in the extra thunderbolt facilities.

  • Customizing messaging and silent mode

    Several questions here: 1- Is there a way to choose to send text message rather than iMessage to a specific contact other than completely turning off iMessage? 2- Can the vibrate mode be customized to select how many vibrations for each category rath

  • More Quantity of Raw Material noticed in Quality Inspection

    Dear Experts, We have done GR against the PO for a material. But in Quality Inspection, we have noticed that there is excess quantity of stock received which is more than the inspection lot quantity. My issue is that inspection lot quantity will be c

  • Address for Onetime Vendor

    Hi, All When I create vendor invoice on transaction code FB60 or something specific on One-Time Vendor, the program will pop up an address and Bank data to fill in but its show only one street line, but I need more than one, so how should I do to cre