Regarding report output formatinng....see this

Can anyboby help me please, it is very urgent.
i have fetched all the data into final internal table.my fields in the internal table is like this for example:
Date-text-result are 3 fields.
data is like this.....
d1  t1  r1
d1  t2  r2
d2  t1  r3
d3  t1  r4
d4  t2  r5
d5  t3  r6
It may contain any no. of texts and dates acc to selection screen.
we should display(o/p format) in this way(in matrix form):
- in the first line it should print  all distint texts horizontally.
-all distinct dates vertically.
-and it should print ressults corespondingly.
like this:
           t1  t2  t3
     d1  r1  r2
     d2  r3
     d3  r4
     d4       r5
     d5            r6
Thanks and regards,
Kamala.

Hello,
Check this sample code.Hope it helps.
data:begin of itab occurs 100,
      f1 like sy-datum,
      f2(2) type c,
      f3(2) type c,
     end of itab.
data:begin of itab_copy occurs 100,
      f2(2) type c,
      f1 like sy-datum,
      f3(2) type c,
     end of itab_copy.
data: begin of f_data occurs 100,
      f2(2) type c,
      pos type i,
      end of f_data.
data: pos type i value 15.
     itab-f1 = sy-datum - 2.
     itab-f2 = 't1'.
     itab-f3 = 'r1'.
     append itab.clear: itab.
     itab-f1 = sy-datum - 2.
     itab-f2 = 't2'.
     itab-f3 = 'r2'.
     append itab.clear: itab.
     itab-f1 = sy-datum - 1.
     itab-f2 = 't1'.
     itab-f3 = 'r3'.
     append itab.clear: itab.
     itab-f1 = sy-datum .
     itab-f2 = 't1'.
     itab-f3 = 'r4'.
     append itab.clear: itab.
     itab-f1 = sy-datum + 1.
     itab-f2 = 't2'.
     itab-f3 = 'r5'.
     append itab.clear: itab.
     itab-f1 = sy-datum + 2.
     itab-f2 = 't3'.
     itab-f3 = 'r6'.
     append itab.clear: itab.
loop at itab.
   itab_copy-f1 = itab-f1.
   itab_copy-f2 = itab-f2.
   itab_copy-f3 = itab-f3.
   append itab_copy.clear: itab_copy.
endloop.
      sort itab_copy.
      loop at itab_copy.
          at new f2.
              write at pos itab_copy-f2.
              f_data-f2 = itab_copy-f2.
              f_data-pos = pos.
              append f_data.clear:f_data.
               pos = pos + 10.
          endat.
      endloop.
      skip 1.
      loop at itab.
          read table itab_copy with key f1 = itab-f1
                                         f2 = itab-f2
                                         f3 = itab-f3.
        at new f1.
          clear: pos.
          skip 1.
              read table f_data with key f2 = itab_copy-f2.
              pos = f_data-pos.
          write: itab-f1.
        endat.
            write at pos itab-f3.
            pos = pos + 10.
      endloop.
Thanks.
Mark points if helpful.

Similar Messages

  • Urgent!!!! regarding report output

    i have a requirement such that, i need report without top of page..but headers needed to be in the printout in all pages.......pls gv ur suggestions.
    thanks

    Hi,
    I am sending the logo of the alv report.
    REPORT  YMS_EXCISE MESSAGE-ID E4 NO STANDARD PAGE HEADING LINE-SIZE 350.                              .
    TABLES : J_1IEXCHDR,      " header table
             J_1IEXCDTL,      " item table
             J_1IPART2,       " Excise Part II details
             LFA1,            " vendor master table
             J_1IMOVEND,      " vendor excise details table
             MSEG,            " Document Segment: Material
             MKPF,            " Header: Material Document
             DD07T,           " domain text table
             T001W.           " Plant and Branch Details
    DATA : BEGIN OF IT_CHDR OCCURS 100,
           DOCNO LIKE J_1IEXCHDR-DOCNO,
           DOCYR LIKE J_1IEXCHDR-DOCYR,
           EXNUM LIKE J_1IEXCHDR-EXNUM,
           EXDAT LIKE J_1IEXCHDR-EXDAT,
           WERKS LIKE J_1IEXCHDR-WERKS,
           EXBED LIKE J_1IEXCHDR-EXBED,
           EXCCD LIKE J_1IEXCHDR-EXCCD,
           ECS LIKE J_1IEXCHDR-ECS,
           END OF IT_CHDR.
    DATA : BEGIN OF IT_CDTL OCCURS 100,
           DOCYR LIKE J_1IEXCDTL-DOCYR,
           DOCNO LIKE J_1IEXCDTL-DOCNO,
           EXNUM LIKE J_1IEXCDTL-EXNUM,
           EXDAT LIKE J_1IEXCDTL-EXDAT,
           LIFNR LIKE J_1IEXCDTL-LIFNR,
           MATNR LIKE J_1IEXCDTL-MATNR,
           MAKTX LIKE J_1IEXCDTL-MAKTX,
           CHAPID LIKE J_1IEXCDTL-CHAPID,
           EXBAS LIKE J_1IEXCDTL-EXBAS,
           EXBED LIKE J_1IEXCDTL-EXBED,
           ECS   LIKE J_1IEXCDTL-ECS,
           MENGE LIKE J_1IEXCDTL-MENGE,
           MEINS LIKE J_1IEXCDTL-MEINS,
           RDOC2 LIKE J_1IEXCDTL-RDOC2,
           END OF IT_CDTL.
    DATA TEXT(10).
    DATA : BEGIN OF IT_OUT OCCURS 0,
           SERIALNO LIKE J_1IPART2-SERIALNO,
           TEXT1 LIKE TEXT,
           EXNUM LIKE J_1IEXCDTL-EXNUM,
           EXDAT LIKE J_1IEXCDTL-EXDAT,
           NAME LIKE LFA1-NAME1,
           DDTEXT LIKE DD07T-DDTEXT,
           EXCCD LIKE J_1IEXCHDR-EXCCD,
           BUDAT LIKE MKPF-BUDAT,
           EXBAS LIKE IT_CDTL-EXBAS,
           EXBED LIKE IT_CDTL-EXBED,
           ECS   LIKE IT_CDTL-ECS,
           MATNR LIKE IT_CDTL-MATNR,
           MAKTX LIKE IT_CDTL-MAKTX,
           CHAPID LIKE IT_CDTL-CHAPID,
           MENGE LIKE IT_CDTL-MENGE,
           MEINS LIKE IT_CDTL-MEINS,
           DEL_IND(1),
           END OF IT_OUT.
    DATA IT_PART2 LIKE J_1IPART2 OCCURS 0 WITH HEADER LINE.
    DATA S_NO(4) .
    DATA DB_CNT LIKE SY-TABIX.
    DATA EBELN_T LIKE MSEG-EBELN .
    TYPE-POOLS : SLIS.
    DATA : AFIELD TYPE SLIS_FIELDCAT_ALV.
    DATA : LIST_HEADER TYPE SLIS_T_LISTHEADER,
           FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           LS_FTCAT TYPE LVC_S_FCAT,
           SORTCAT TYPE SLIS_T_SORTINFO_ALV,
           SORTCAT_LN  LIKE LINE OF SORTCAT,
           G_REPID LIKE SY-REPID,
           G_BACK_GROUND(70),  "like bapibds01-objkey,
           GS_VARIANT LIKE DISVARIANT,
           G_SAVE ,
           GT_EVENTS TYPE SLIS_T_EVENT,
           ALV_EVENT TYPE SLIS_ALV_EVENT,
           EVENTCAT             TYPE SLIS_T_EVENT,
           EVENTCAT_LN          LIKE LINE OF EVENTCAT,
           LAYOUT_IN            TYPE SLIS_LAYOUT_ALV,
           LAYOUT_IN1           TYPE SLIS_LAYOUT_ALV.
    CONSTANTS : GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
    'TOP_OF_PAGE',
                GC_FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE
    'USER_COMMAND',
                GC_FORMNAME_BEFORE_OUTPUT TYPE SLIS_FORMNAME VALUE
    'BEFORE_OUTPUT'.
      ALV_EVENT TYPE SLIS_ALV_EVENT,
    DATA EX_NO LIKE IT_CHDR-EXNUM VALUE 0.
    DATA REGTYP_1 LIKE J_1IPART2-REGTYP.
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME.
    PARAMETERS  WERKS TYPE J_1IEXCHDR-WERKS.
    SELECT-OPTIONS : BUDAT FOR J_1IEXCHDR-EXDAT.
    PARAMETERS : R1 RADIOBUTTON GROUP GRP DEFAULT 'X',
                 R2 RADIOBUTTON GROUP GRP.
    SELECTION-SCREEN END OF BLOCK B.
    INITIALIZATION.
      G_REPID = SY-REPID.
      G_SAVE = 'A'.
    PERFORM BUILD_EVENT USING GT_EVENTS[].
      PERFORM ALV_EVENT_INIT.
    AT SELECTION-SCREEN.
      REFRESH LIST_HEADER.
      PERFORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER.
    START-OF-SELECTION.
    PERFORM ALV_EVENT_INIT.
      G_REPID = SY-REPID.
      G_BACK_GROUND = ' ' .
      IF R1 = 'X'.
        CLEAR R2. CLEAR : REGTYP_1.
        REGTYP_1 = 'A'.
         set titlebar 'BALAJI' with DB_CNT.
      ELSEIF R2 = 'X'.
        CLEAR R1.CLEAR : REGTYP_1.
        REGTYP_1 = 'C'.
         set titlebar 'BALAJI1' with DB_CNT.
      ENDIF.
      SELECT * FROM J_1IPART2
                       INTO CORRESPONDING FIELDS OF TABLE IT_PART2
                       WHERE REGTYP = REGTYP_1 AND
                             TRNTYP = 'GRPO' AND
                             BUDAT IN BUDAT.
                              DOCYR = IT_CDTL-DOCYR AND
                              DOCNO = IT_CDTL-DOCNO.
      LOOP AT IT_PART2.
        SELECT SINGLE * FROM J_1IEXCHDR
                  INTO CORRESPONDING FIELDS OF IT_CHDR
                          WHERE  TRNTYP = 'GRPO' AND
                          DOCYR = IT_PART2-DOCYR AND
                          DOCNO = IT_PART2-DOCNO AND
                          WERKS = WERKS AND
                          exdat IN BUDAT.
                       ORDER BY EXDAT.
        IF SY-SUBRC = 0.
          APPEND IT_CHDR.
        ELSE.
          CONTINUE.
        ENDIF.
    IF SY-SUBRC <> 0.
       MESSAGE E084.
    ENDIF.
      ENDLOOP.
      LOOP AT IT_CHDR.
        SELECT * FROM J_1IEXCDTL
                  INTO CORRESPONDING FIELDS OF IT_CDTL
                FOR ALL ENTRIES IN IT_CHDR
                         WHERE
                          TRNTYP = 'GRPO' AND
                          DOCNO  = IT_CHDR-DOCNO AND
                          DOCYR  = IT_CHDR-DOCYR AND
                          EXNUM  = IT_CHDR-EXNUM AND
                          EXDAT  = IT_CHDR-EXDAT AND
                          WERKS  = IT_CHDR-WERKS.
          IF SY-SUBRC = 0.
            APPEND IT_CDTL.
          ELSE.
            CONTINUE.
          ENDIF.
        ENDSELECT.
      ENDLOOP.
      LOOP AT IT_CDTL.
        CLEAR TEXT.
        DB_CNT = DB_CNT + 1.
        READ TABLE IT_CHDR WITH KEY EXNUM = IT_CDTL-EXNUM.
        READ TABLE IT_PART2 WITH KEY DOCNO = IT_CDTL-DOCNO .
        IT_OUT-SERIALNO = IT_PART2-SERIALNO.
        SELECT SINGLE NAME1 FROM LFA1
                        INTO IT_OUT-NAME
                        WHERE LIFNR = IT_CDTL-LIFNR.
        SELECT SINGLE * FROM LFA1
                          WHERE LIFNR = IT_CDTL-LIFNR.
        IF LFA1-LAND1 EQ 'IN'.
          TEXT = 'INVOICE'.
          IT_OUT-TEXT1 = TEXT.
        ELSE.
          TEXT = 'BOE'.
          IT_OUT-TEXT1 = TEXT.
        ENDIF.
        SELECT SINGLE * FROM J_1IMOVEND
                        WHERE LIFNR = IT_CDTL-LIFNR.
        SELECT SINGLE * FROM DD07T
                       INTO IT_OUT-DDTEXT
                        WHERE DOMNAME = 'J_1IVTYP' AND
                              DDLANGUAGE = 'EN' AND
                              DOMVALUE_L = J_1IMOVEND-J_1IVTYP.
      IF DD07T-DDTEXT = 'First Stage Dealer of indigenous excisable goods'
    OR
        DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisablegoods'.
          DD07T-DDTEXT = 'Dealer'.
        ENDIF.
        IT_OUT-DDTEXT = DD07T-DDTEXT.
       ELSEIF DD07T-DDTEXT = 'Second Stage Dealer of indigenous excisable
    *goods'.
          DD07T-DDTEXT =
        CLEAR EBELN_T.
        SELECT SINGLE LFBNR FROM MSEG
                            INTO EBELN_T
                            WHERE MBLNR = IT_CDTL-RDOC2 .
        SELECT SINGLE * FROM MSEG
                          WHERE BWART = '106' AND
                                LFBNR = EBELN_T ."and
                               ebeln = ebeln_t.
        IF SY-SUBRC = 0.
          IT_OUT-DEL_IND = 'X'.
        ELSE.
          IT_OUT-DEL_IND = ' '.
        ENDIF.
        SELECT SINGLE BUDAT FROM MKPF
                          INTO IT_OUT-BUDAT
                          WHERE MBLNR = EBELN_T  ."MSEG-LFBNR.
        IT_OUT-EXNUM = IT_CDTL-EXNUM.
        IT_OUT-EXDAT = IT_CDTL-EXDAT.
        IT_OUT-EXCCD = IT_CHDR-EXCCD.
        IT_OUT-EXBAS = IT_CDTL-EXBAS.
        IT_OUT-EXBED = IT_CDTL-EXBED.
        IT_OUT-ECS   = IT_CDTL-ECS.
        IT_OUT-MATNR = IT_CDTL-MATNR.
        IT_OUT-MAKTX = IT_CDTL-MAKTX.
        IT_OUT-CHAPID = IT_CDTL-CHAPID.
        IT_OUT-MENGE = IT_CDTL-MENGE.
        IT_OUT-MEINS = IT_CDTL-MEINS.
        APPEND IT_OUT.
       EX_NO = IT_CDTL-EXNUM.
      ENDLOOP.
    Title Portion
      IF REGTYP_1 = 'A'.
        SET TITLEBAR 'BALAJI' WITH DB_CNT.
      ELSEIF REGTYP_1 = 'C'.
        SET TITLEBAR 'BALAJI1' WITH DB_CNT.
      ENDIF.
      AFIELD-COL_POS = 1.
      AFIELD-FIELDNAME = 'SERIALNO'.
      AFIELD-SELTEXT_L = 'INPUTS'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 2.
      AFIELD-FIELDNAME = 'TEXT1'.
      AFIELD-SELTEXT_L = 'TYPE OF DOC'.
      AFIELD-JUST = 'L'.
      AFIELD-DECIMALS_OUT = '0'.
      AFIELD-NO_ZERO = 'X'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 3.
      AFIELD-FIELDNAME = 'EXNUM'.
      AFIELD-SELTEXT_L = 'DOC.NO'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 4.
      AFIELD-FIELDNAME = 'EXDAT'.
      AFIELD-SELTEXT_L = 'DOC.DATE'.
      AFIELD-JUST = 'C'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 5.
      AFIELD-FIELDNAME = 'NAME'.
      AFIELD-SELTEXT_L = 'NAME OF THE SUPPLIER'.
      AFIELD-NO_ZERO = 'X'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 6.
      AFIELD-FIELDNAME = 'DDTEXT'.
      AFIELD-SELTEXT_L = 'TYPE-OF-SUPPLIER'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 7.
      AFIELD-FIELDNAME = 'EXCCD'.
      AFIELD-SELTEXT_L = 'ECC OF THE SUPPLIER'.
      AFIELD-NO_ZERO = 'X'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 8.
      AFIELD-FIELDNAME = 'BUDAT'.
      AFIELD-SELTEXT_L = 'INPUT RECV DATE'.
      AFIELD-JUST = 'C'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 9.
      AFIELD-FIELDNAME = 'EXBAS'.
      AFIELD-SELTEXT_L = 'ASSESSABLE-VALUE'.
      AFIELD-DO_SUM             = 'X'.
      AFIELD-JUST = 'R'.
      AFIELD-DECIMALS_OUT = '2'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 10.
      AFIELD-FIELDNAME = 'EXBED'.
      AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN CENVAT'.
      AFIELD-JUST = 'R'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 11.
      AFIELD-FIELDNAME = 'ECS'.
      AFIELD-SELTEXT_L = 'DET OF CREDIT TAKEN E-CESS'.
      AFIELD-JUST = 'R'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 12.
      AFIELD-FIELDNAME = 'MATNR'.
      AFIELD-SELTEXT_L = 'MATERIAL-CODE'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 13.
      AFIELD-FIELDNAME = 'MAKTX'.
      AFIELD-SELTEXT_L = 'DESCRIPTION'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 14.
      AFIELD-FIELDNAME = 'CHAPID'.
      AFIELD-SELTEXT_L = 'TARIFF-ID'.
      AFIELD-JUST = 'L'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 15.
      AFIELD-FIELDNAME = 'MENGE'.
      AFIELD-SELTEXT_L = 'QUANTITY'.
      AFIELD-JUST = 'R'.
      AFIELD-DO_SUM             = ' '.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 16.
      AFIELD-FIELDNAME = 'MEINS'.
      AFIELD-SELTEXT_L = 'UOM'.
      AFIELD-JUST = 'C'.
      APPEND AFIELD TO FIELDCAT.
      AFIELD-COL_POS = 17.
      AFIELD-FIELDNAME = 'DEL_IND'.
      AFIELD-SELTEXT_L = 'Deleted'.
      AFIELD-JUST = 'C'.
      APPEND AFIELD TO FIELDCAT.
    * LAYOUT FOR ZEBRA CATLOG
      LAYOUT_IN-COLWIDTH_OPTIMIZE = 'X'.
      LAYOUT_IN-ZEBRA             = 'X'.
      LAYOUT_IN-GET_SELINFOS      = 'X'.
      LAYOUT_IN-CONFIRMATION_PROMPT = 'X'.
      LAYOUT_IN-DETAIL_POPUP = 'X' .
    SORTCAT-decimals     = '0'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = G_REPID
          I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
          I_SAVE                  = G_SAVE
          IS_VARIANT              = GS_VARIANT
          IT_FIELDCAT             = FIELDCAT
          IT_SORT                 = SORTCAT
          IS_LAYOUT               = LAYOUT_IN
          IT_EVENTS               = EVENTCAT
         I_BACKGROUND_ID         = g_back_ground
        TABLES
          T_OUTTAB                = IT_OUT.
    *&      Form  TOP_OF_PAGE_LIST_HEADER
          text
         -->LIST_HEADERtext
    FORM TOP_OF_PAGE_LIST_HEADER USING LIST_HEADER TYPE SLIS_T_LISTHEADER.
      DATA : HLINE TYPE SLIS_LISTHEADER,
             TEXT(60) TYPE C.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
    WRITE 'ROOTS INDUSTRIES LTD' TO TEXT.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
      SELECT SINGLE * FROM T001W WHERE WERKS = WERKS.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
      WRITE 'PLANT :' TO TEXT.
      WRITE WERKS TO TEXT+8.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
      WRITE T001W-NAME1 TO TEXT.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
      WRITE T001W-STRAS TO TEXT.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
      WRITE T001W-ORT01 TO TEXT.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
      CLEAR : HLINE,TEXT.
      HLINE-TYP = 'H'.
      WRITE 'DATE :' TO TEXT.
      WRITE BUDAT-LOW TO TEXT+7.
      IF BUDAT-HIGH NE ''.
        WRITE 'TO' TO TEXT+18.
        WRITE BUDAT-HIGH TO TEXT+22.
      ENDIF.
      HLINE-INFO = TEXT.
      APPEND HLINE TO LIST_HEADER.
    ENDFORM.                    "TOP_OF_PAGE_LIST_HEADER
    *&      Form  ALV_EVENT_INIT
          text
    FORM ALV_EVENT_INIT .
      CLEAR ALV_EVENT.
      ALV_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      ALV_EVENT-FORM = 'ALV_TOP_OF_PAGE'.
      APPEND ALV_EVENT TO EVENTCAT.
      CLEAR ALV_EVENT.
      ALV_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      ALV_EVENT-FORM = 'ALV_TOP_OF_LIST'.
      APPEND ALV_EVENT TO EVENTCAT.
       CLEAR ALV_EVENT.
       ALV_EVENT-NAME = SLIS_EV_END_OF_LIST.
       ALV_EVENT-FORM = 'ALV_END_OF_LIST'.
       APPEND ALV_EVENT TO GT_EVENTS.
       CLEAR ALV_EVENT.
       ALV_EVENT-NAME = SLIS_EV_END_OF_PAGE.
       ALV_EVENT-FORM = 'ALV_END_OF_PAGE'.
       APPEND ALV_EVENT TO GT_EVENTS.
    ENDFORM.                    "ALV_EVENT_INIT
    *&      Form  ALV_TOP_OF_PAGE
          text
    FORM ALV_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = LIST_HEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "ALV_TOP_OF_PAGE
    *&      Form  BUILD_EVENT
          text
         -->P_GT_EVENTS[]  text
    FORM BUILD_EVENT USING P_EVENTS TYPE SLIS_T_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = P_EVENTS
        EXCEPTIONS
          LIST_TYPE_WRONG = 1
          OTHERS          = 2.
      READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND INTO
    ALV_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_USER_COMMAND TO ALV_EVENT-FORM.
        APPEND ALV_EVENT TO P_EVENTS.
      ENDIF.
      READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_BEFORE_LINE_OUTPUT INTO
    ALV_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_BEFORE_OUTPUT TO ALV_EVENT-FORM.
        APPEND ALV_EVENT TO P_EVENTS.
      ENDIF.
    ENDFORM.                    " BUILD_EVENT
    Thanks,
    Shankar

  • Display Report output in Matrix format

    Hi
      I want to display normal report output in somewhat this manner.
    I will have one change requrest number and many transport requests will be assigned to that change request number, and to the transport requests many objects will be assigned.
    I have to display the output in this format:
    Change Request 1  |   Tr No.1 |  Tr No.2 |  Tr No.1 | and so on....
    Obj1
    Obj2
    Obj3
    Change Request 1  |   Tr No.1 |  Tr No.2 |  Tr No.1 | and so on....
    Obj1
    Obj2
    Obj3
    Like this it should go on.
    I have done the coding part, how to display the data in the above format i am not getting any idea, please help me out if you have any ideas.
    Thanks & Regards
    Haritha.

    Hi Vijay,
      First of all thank you for the response.
    I am retrieving the data from different tables and putting all the data in one internal table called i_final. Below is the declaration of that internal table and how i have populated the data to that. I am using control break statements to display the data but the data is coming in the next line.
    Please see the final internal table:
    1. Declaration:
    Data:Begin of i_final occurs 0,
           ccsnr like ysts-ccsnr,
           trkorr like ysts-trkorr,
           obj_name like e071-obj_name,
           check_box(1),
           status LIKE YSCS-STATUS,
          End of i_final.
    2. Populating different internal tables data to this table:
      loop at i_ccno.
        i_final-ccsnr = i_ccno-ccsnr.
        i_final-trkorr = i_ccno-trkorr.
        read table i_status with key trkorr = i_ccno-trkorr.
        if sy-subrc = 0.
          i_final-status = i_status-status.
        endif.
        read table i_obj_name with key trkorr = i_ccno-trkorr.
        if sy-subrc = 0.
          i_final-obj_name = i_obj_name-obj_name.
        endif.
        append i_final.
        clear i_final.
      endloop.
    3. Using Control break statements to display the data.
      sort i_final by ccsnr.
      loop at i_final.
         at new ccsnr.
           write:/2 i_final-ccsnr.
         endat.
           write:20 i_final-trkorr.
           uline.
      endloop.
    But the output is coming like this:
    CHG0003785  HSDK933109
                          HSDK933111
                          HSDK933113
                          HSDK933143
                          HSDK933268
    But i want the output like this:
    CHG0003785 | HSDK933109  |  HSDK933111  |   HSDK933113
    Thanks & Regards
    Haritha.

  • Adding a new field to VA05 Report output

    Hi All,
    Please suggest what's the best method to add the new field in the report output of VA05  this can be done in 2 ways one way is by writing the code in theUser exit PERFORM MOVE_USERFIELDS  or copy the whole program to Zprogram and write the Code?Ist one need access key but the the other method is not required.
    Please suggest me the best method
    Thanks&Regards
    Mahesh

    Hi Mahesh,
    i'm in the process of making a similar change,
    copying to a ZPROGRAM is not so difficult, but as i told you you have to add your new field to VBMTV structure, and copy the includes that you need to change,
    P.S. Note, when you copy you have to change some SELECT statements where
    it's selecting from T180V table based on sy-repid, you hav to change sy-repid to SAPMV75A, as there's some configuration done for this.
    Regards,
    Raghavendra

  • Exception (colouring cells) in report output based on formula.

    Hi Gurus,
    I want to colour my cells in report output. But this coloring is not so simple. It has to be done based on a formula.
    Lets say i have material in rows and sales value by period in columns.
    .......................Jan'08......Feb'08.......Mar'08.....Apr'08
    Material A...........100..........120............105.........140
    If Feb'08 values is greater than 0,02*Jan'08 value than ---> Feb'08 has to be coloured as green. etc.
    Is it possible to define such a rule for the exception?
    Thanks
    S.P.

    Hi Reddy,
    I am using bex 7.0.
    I tried that also.
    I created another formula in columns with name "Difference" and it calculates the difference.
    Report looks like as below:
    Material.....Jan'08.......Feb'08.....Difference
    ABC............100............120.............0,2
    Now, I have to colour Feb'08 column, based on the value under Difference column. But it does not work.
    In Exception settings; from Definition tab, I selected Difference column (exception is based on).
    In Display tab, I select Feb'08 column.
    But it does not work.
    Any idea?
    Thanks
    S.P.

  • See this error in report REP-1401: cf_1formula: Fatal PL/SQL errir occurred

    hi mater
    sir i use oracel reprot 6i
    i try to use formula for calculation see
    function avggFormula return Number is begin
    :cp_1 := (:bugamt-nvl(:totexp,0)/:bugamt)*100 ;
    return(:cp_1);
    end;
    this formula complie rightly no error
    but when i run my report
    that give me this error
    REP-1401: 'cf_1formula': Fatal PL/SQL errir occurred.
    ORA-01476: divisor is equal to zero
    please give me idea how i solve my this error
    thank;
    aamir

    Hi Aamir,
    The problem is that divisor by 0 (zero) is not possible.
    So you need to make sure that in your calculation there's no division by zero.
    In your case :bugamt is equal to zero then you will get this error.
    So just make sure that :bugamt is not equal to zero.
    You can do this as follows:
    function avggFormula return Number is begin
    IF :bugamt != 0 THEN
    :cp_1 := (:bugamt-nvl(:totexp,0)/:bugamt)*100 ;
    END IF;
    return(:cp_1);
    end;
    Regards
    Arif

  • Regarding SavIng of reports output into appl. or presentation server

    Hello Everyone I am working on ALE IDoc I am getting my output in forms of XML. I want to save my reports output directly to presentation server or application server (i have neither any flat file on desktop nor any file on application server).
    I have following codes which convert my Idoc into XML:
    *& Report ZIDOC_XML_CONVERSION
    report ZIDOC_XML_CONVERSION.
    types: TRESLIN(4096) type X,
    TRESTAB type standard table of TRESLIN.
    data: RESSTR type ref to IF_IXML_OSTREAM.
    data: RESTAB type TRESTAB.
    data: XSLTP type ref to CL_XSLT_PROCESSOR.
    data: G_IXML type ref to IF_IXML,
    G_STREAM_FACTORY type ref to IF_IXML_STREAM_FACTORY,
    DIR type STRING.
    data: IDOC type ref to CL_IDOC_XML1.
    data: PROGNAME type CXSLTDESC.
    data: STR type STRING.
    data: XSTR type XSTRING.
    data: RESSIZE type I.
    data: ID type EDI_STYLE.
    data GLOBAL_DOCNUM type EDI_DOCNUM.
    data GLOBAL_STYLEID type EDI_STYLE.
    data: GLOBAL_OK_CODE(30).
    data: HTML_CONTROL type ref to CL_GUI_HTML_VIEWER.
    data: FCODE_WA(30).
    data: FCODE_TAB type standard table of CHAR30.
    data: MS_DEFAULT_STYLE type EDI_STYLE.
    data: SAP_DEFAULT_STYLE type EDI_STYLE.
    data: SAP_TEXT_STYLE type EDI_STYLE.
    data: SAP_CONTEXT_STYLE type EDI_STYLE.
    data: TEXT_MS_DEFAULT_STYLE(30).
    data: TEXT_SAP_DEFAULT_STYLE(30).
    data: TEXT_SAP_TEXT_STYLE(30).
    data: TEXT_SAP_CONTEXT_STYLE(30).
    data ACTION like SY-UCOMM.
    parameters: IDOCNUM like EDIDC-DOCNUM,
    IDSTYLE type EDI_STYLE,
    ACTIONS type EDI_STFLAG.
    class CL_IXML definition load.
    class CL_ABAP_CHAR_UTILITIES definition load.
    class CL_GUI_FRONTEND_SERVICES definition load.
    class CL_GUI_HTML_VIEWER definition load.
    data: CONTAINER type ref to CL_GUI_CUSTOM_CONTAINER.
    data: REPID like SY-REPID, DYNNR like SY-DYNNR.
    data: WA_OBJ_LOCATION type IDOCSTYLE.
    data: LOCAL_XSLID type EDI_STYLE.
    data: BASE_URL(30).
    data: DATA_TABLE type TAB_RAW512.
    data: LEN type I.
    data: UI_FLAG type I.
    data: MYEVENT_TAB type CNTL_SIMPLE_EVENTS,
    MYEVENT type CNTL_SIMPLE_EVENT.
    data: LOCAL_STYLEID type EDI_STYLE.
    data: PARENT type ref to CL_GUI_CONTAINER.
    data: LINE type I.
    data: WA_SRC type STRUCT_SRC.
    data: LOCAL_EDIDC type EDIDC.
    data: TAB_OBJ_LOCATION type standard table of IDOCSTYLE .
    data: GEN_EX type ref to CX_XSLT_EXCEPTION.
    data: SRCSTR type ref to IF_IXML_ISTREAM.
    *load-of-program.
    try.
    create object XSLTP.
    catch CX_XSLT_EXCEPTION.
    write / TEXT-E01. exit. " XSLT not supported
    endtry.
    G_IXML = CL_IXML=>CREATE( ).
    G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
    DIR = ''.
    call method CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
    changing
    TEMP_DIR = DIR.
    *start-of-selection.
    GLOBAL_DOCNUM = IDOCNUM.
    GLOBAL_STYLEID = IDSTYLE.
    get parameter id 'IDOC_STYLEID' field GLOBAL_STYLEID.
    if GLOBAL_STYLEID is initial.
    GLOBAL_STYLEID = 'IE5'.
    endif.
    clear FCODE_TAB.
    clear GLOBAL_OK_CODE.
    clear ACTION.
    we only support action "deletemark" + "closeproce"
    if ACTIONS ' X X '.
    FCODE_WA = 'DELM'.
    append FCODE_WA to FCODE_TAB.
    FCODE_WA = 'CLPR'.
    append FCODE_WA to FCODE_TAB.
    endif.
    Create Object and create IDOC_XML
    create object IDOC
    exporting
    DOCNUM = IDOCNUM
    exceptions
    ERROR_LOADING_IDOC = 1
    ERROR_BUILDING_XML = 2
    others = 3.
    if SY-SUBRC 0.
    message id SY-MSGID type 'E' number SY-MSGNO
    with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
    raising NO_IDOC_XML_LOADED.
    endif.
    Determine transformation program.
    clear TAB_OBJ_LOCATION.
    select * from IDOCSTYLE into table TAB_OBJ_LOCATION
    where ( STYLEID = GLOBAL_STYLEID or STYLEID = '' )
    and ( MESTYP = LOCAL_EDIDC-MESTYP or MESTYP = '')
    and ( DIRECT = LOCAL_EDIDC-DIRECT or DIRECT = '')
    and OBJNR = 0.
    describe table TAB_OBJ_LOCATION lines LINE.
    if LINE > 0.
    loop at TAB_OBJ_LOCATION into WA_OBJ_LOCATION.
    move WA_OBJ_LOCATION-URL to PROGNAME.
    clear WA_OBJ_LOCATION.
    exit.
    endloop.
    else.
    message E110(IDOC_XML1) with LOCAL_XSLID WA_OBJ_LOCATION-URL
    raising ERROR_LOADING_OBJECT.
    endif.
    Transformation
    call method IDOC->GET_XMLDATA_AS_STRING
    importing
    DATA_STRING = STR.
    RESSTR = G_STREAM_FACTORY->CREATE_OSTREAM_ITABLE( TABLE = RESTAB )
    RUN
    try.
    call transformation (PROGNAME)
    source xml STR
    result xml RESSTR.
    catch CX_XSLT_EXCEPTION into GEN_EX.
    message E110(IDOC_XML1) with LOCAL_XSLID WA_OBJ_LOCATION-URL
    raising ERROR_LOADING_OBJECT.
    exit.
    endtry.
    write : / STR.
    I am getting following output:
    <?xml version="1.0"?><RSREQUST><IDOC BEGIN = "1"><EDI_DC40 SEGMENT="1"><TABNAM><![CDATAEDI_DC40]></TABNAM><M
    i want to save this output on my application server or presentation server, my data is not on presentation server or in application server, its on form of output and i want to save my output directly to application server or presentation server.hope that you people will help me out please reply me for this query.
    Thanks & Regards
    Vimarsh B.

    Hello Subhash,
    Try this
    data: sheet TYPE ole2_object.
    data: lv_file(512) default 'C:tst.xls'.
    * Save excel speadsheet to particular filename
      GET PROPERTY OF h_excel 'ActiveSheet' = sheet.
      CALL METHOD OF sheet 'SaveAs'
        EXPORTING
          #1 = lv_file     "filename
          #2 = 1.                      "fileFormat

  • Query regarding calling T-code MIGO from ALV report output

    Dear friends,
    I have to call MIGO transaction  from my ALV report output. Now problem is that I have to set the value 'display' In the first header field, 'Material Document' in 2nd header field when MIGO is called from the report output. Morever there is no parameter ID for these two fields. So how to set the values w/o using parameter ids.
    Regards,
    Rishi

    Hi,
    Try this coding,
    FORM DISPLAY.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       IS_LAYOUT                      = AK_LAYOUT
       IT_FIELDCAT                    = AK_FIELDCAT
      TABLES
       T_OUTTAB                       = ITAB.
    ENDFORM.                    " DISPLAY
    *&      Form  EVENT
    FORM EVENT USING P_AK_EVENT TYPE SLIS_T_EVENT.
      DATA : AK_EVENT1 TYPE SLIS_ALV_EVENT.
      AK_EVENT1-NAME = 'USER_COMMAND'.
      AK_EVENT1-FORM = 'USER_COMMAND'.
      APPEND AK_EVENT1 TO P_AK_EVENT.
    ENDFORM.                    " EVENT
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      IF R_UCOMM = '&IC1'.
      " AND SY-LSIND = '1'.
        READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
        SET PARAMETER ID 'AUN' FIELD ITAB-BUDAT.
        CALL TRANSACTION 'MIGO' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.                    " USER_COMMAND
    Regards,
    Nikhil.

  • I don't know who will see this, but i'm writing this here, because i cound't find any problem report places anywhere.

    I don't know who will see this, but i'm writing this here, because i cound't find any problem report places anywhere. Your site are too confusing. I just wanna say that css3 isn't working properly in mozilla. It lags. Other transitions doesn't work at all. Check this site http://css3exp.com/moon/ on your and on chrome browser to see differences. Could you write me a reply to this... question...? [email protected]

    It appears you have accidentally subscribed to a community and were getting e-mails for all related posts. I have removed the subscriptions, so you should be getting no more e-mails. Thank you for bringing this to our attention. I'm sorry you recieved so many e-mails you did not want.

  • "There is no report location specified for this project". Please see your C

    Using Primavera Contract Management Application in Production environment, when users selected the option “E-Mail Form” from “Select an action” dropdown it's throwing the below error.
    "There is no report location specified for this project". Please see your Contract Management Administrator.
    This is happening all of a sudden without any recent changes in Applicaiton / Share point.
    Primavera Contract Management version 14 SP1.
    Windows 2003 32bit
    Thanks
    Venu
    Edited by: user13401519 on 18/04/2012 20:00

    We just came across this as a bug. 1st question is can you click Print Preview while you have the document open? If yes, then have you modified the description of the document (in Document Steup)? If yes to that too, then you've found the bug that can be reproduced.
    Please report this to Oracle (and everyone else who comes across this) to get it more attention.

  • Is anyone else seeing this with the report toolkit

    I am using LV 8.6 and using the LV report functions inside a VI. This VI is my main VI for the TS user interface. What is happening is, I built my main vi into an executable and then I am building a deployment in TS with the executeable included. I get a tremendous amount of errors when I do this saying that the vi's that are part of the report generation in LV are not able to be loaded because they have no front panel or block diagram. So I did some investigating and sure enough the toolkit was changed to Object Oriented for LV 8.6. This explains why i can get it to build on a machine with LV8.5 installed instead of 8.6.
    I was just wondering if anyone has had this problem with the toolkit and TS.
    I also had a meeting with Brian Buress (field engineer for NI) and Jeff Phillips (LabVIEW product manager) they saw this activity (they were here and I showed it to them) and they could not explain it.
    The problem has to lye in the fact that the report VI'S are now object oriented.
    Is anyone else have trouble with this toolkit.
    Joe.
    "NOTHING IS EVER EASY"

    Hi Joe,
    Yes, I also had a problem with the report toolkit.
    See here for the problem and workaround

  • Discoverer report - Output from Discoverer plus is not the same as Discoverer desktop

    As a part of Upgrade project we are migrating the discoverer reports from 11i (11.5.10.2) to R12 (12.1.3) .After migrating to R12, for a custom discoverer report the output given by discoverer desktop is correct (24 rows for a scenario). But the report output from Discoverer plus does not show the credit transactions (2 rows). The output from Discoverer plus shows only 22 rows (24 - 2), which is incorrect. The query is the same in Discoverer desktop and Discoverer plus.
    Please let me know why these transactions that are appearing when the report is run from discoverer desktop are not appearing in discoverer plus. Is there any setup in discoverer plus for this?
    Regards,
    Brajesh

    Pretty hard to answer a question like this.  Best bet would be to copy the existing discoverer plus book and start removing conditions, fields, etc until those two rows from desktop show up and see if you can work it out. 

  • PAYABLES NOT GETTING THE REPORT OUTPUT IN PDF AFTER APPLYING RUP5 R12

    Hi All,
    RDBMS:10.2.0.3.0
    Oracle Apps :12.0.4
    OS:AIX 5.3
    Problem Description:
    We are presently facing an issue in Payables not getting the report output in PDF esp for the reports "Invoice Register", Invoice Hold Report and also other reports. We were able to generate the reports till our last test performed on last Thursday. This instance was cloned over the last weekend and probably the new upgrade to RUP5 R12,would have impacted it.
    Concurrent Programs submitted are completed normal but on clicking "view output" results in Blank PDF output.
    The error message what was shown is as below:
    "Adobe Reader could not open 'AcrC.tmp' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)".
    Where could we locate ther above 'AcrC.tmp' of Adobe Reader..
    could anyone please share such an experience encountered for resolution..
    Would appreciate an early response..
    Thanks for your time!
    Regards,

    I suggest you speak to your DBA/sysadmin. This is not likely to be a reports problem.
    Check that you can see the output from apps through the viewer (the report may not hav output anything)
    Check whether you can print anything on that printer from apps.
    May also be worth checking to see if you can print to another printer from this report.

  • Sending report output via E-mail (excel pivoted format)

    Hi all,
    i have a written a report where i need to send the report output to somebody via
    E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
    i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
    now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field  length should be adjusted as per the output field length.
    i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
    any idea will be highly appreaciated.
    Regards
    if not p_email1 is initial.
         perform fill_report_csv.
         perform f_send_internet_mail.
      endif.
    FORM fill_report_csv.
       data :   l_text(232) type c,
               v_matnr1(21) type c,
               v_matnr(21) type c,
               v_matkl(14) type c,
               v_maktx(45) type c,
               v_ttlstk(14) type c,
               v_verpr(14) type c,
               v_werks(14) type c,
               v_lgort(14) type c,
               v_char(10) type c,
               v_stks type p ,
               v_po(40) type c,
               v_qty(13) type c,
                v_qty1 type sy-datum,
               v_date(15) type c,
               v_date1(15) TYPE C,
               v_name(35) type c,
               v_eknam(18) type c,
               v_lifnr(15) type c,
            l_po(40) type c,
            v_matnr(20) type c,
             l_rate(11) type  p decimals 5,
             l_flag type c.
      concatenate c_equal c_colon 'PO no.' c_colon
                    into v_po.
      concatenate c_equal c_colon 'Material no.' c_colon
                    into v_matnr.
      concatenate c_equal c_colon 'Description.' c_colon
                    into v_maktx.
      concatenate c_equal c_colon 'Due Qty.' c_colon
                    into v_qty.
      concatenate c_equal c_colon 'Del Date.' c_colon
                    into v_date.
      concatenate c_equal c_colon 'Vendor.' c_colon
                    into v_name.
      concatenate c_equal c_colon 'Buyer.' c_colon
                    into v_eknam.
      concatenate c_equal c_colon 'Vendor Code.' c_colon
                    into v_lifnr.
    concatenate
             v_po v_matnr v_maktx v_qty
             v_date v_name v_eknam v_lifnr
             into i_download
             SEPARATED BY con_tab.
      append i_download .
    clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
    clear wa_output.
    loop at i_output into wa_output.
       on change of wa_output-ebeln.
         clear v_lines.
         loop at i_eket into wa_eket
                 where ebeln = wa_output-ebeln.
           v_lines = v_lines + 1.
           clear wa_eket.
         endloop.
    **-- Checking of page break
         v_lines = sy-linno + v_lines .
         if 55 < v_lines  .
           write:/0(161) sy-uline.
           new-page.
         endif.
      clear v_lines.
          loop at i_eket into wa_eket
                  where ebeln = wa_output-ebeln.
            v_lines = v_lines + 1.
            clear wa_eket.
          endloop.
    *-- Calculating the due qty.
        wa_output-dumng = wa_output-menge - wa_output-wemng.
    *-- Writing the Line items of the PO.
        read table i_ekpo into wa_ekpo
              with key ebeln = wa_output-ebeln
                       ebelp = wa_output-ebelp.
         l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
    *-- Writing of PO detail
         if wa_output-dumng gt 0 .
         v_qty = wa_output-dumng.
        v_date1 = wa_output-eindt.
        v_maktx = wa_output-maktx.
         if wa_output-maktx+0(1) = '"' .
                concatenate  c_equal wa_output-maktx
                   into v_maktx  .
             else .
                concatenate  c_equal c_colon wa_output-maktx c_colon
                   into v_maktx  .
             endif .
       if wa_output-name1+0(1) = '"' .
                concatenate  c_equal wa_output-name1
                   into v_name  .
             else .
                concatenate  c_equal c_colon wa_output-name1 c_colon
                   into v_name  .
             endif .
        v_name = wa_output-name1.
        v_lifnr = wa_output-lifnr.
         write wa_output-eindt to v_date1 DD/MM/YYYY.
         concatenate '="' wa_output-ebeln '/'
                wa_output-ebelp '"' into v_po .
         concatenate '="' wa_output-matnr '"' into v_matnr .
             concatenate  c_equal c_colon wa_output-maktx c_colon
               into v_maktx  .
              concatenate  c_equal c_colon wa_output-dumng c_colon
               into v_qty1  .
               concatenate  c_equal c_colon wa_output-eindt c_colon
               into v_date1  .
              concatenate  c_equal c_colon wa_output-name1 c_colon
               into v_name  .
                concatenate  c_equal c_colon wa_output-eknam c_colon
                into v_eknam  .
              concatenate  c_equal c_colon wa_output-lifnr c_colon
               into v_lifnr  .
              concatenate  c_equal c_colon wa_mard-werks '/'
               wa_mard-lgort c_colon
               into v_lgort .
                 concatenate '="' wa_output-lifnr '"' into v_lifnr .
    condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
         concatenate
             v_po v_matnr v_maktx v_qty
             v_date1 v_name v_eknam v_lifnr
             into i_download
             SEPARATED BY con_tab.
        concatenate con_cret i_download INTO i_download .
        append i_download .
      endif.
    clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
    endloop.
    ENDFORM.                    " fill_report_csv
    *&      Form  f_send_internet_mail
          text
    -->  p1        text
    <--  p2        text
    FORM f_send_internet_mail.
    Variables
    data:   it_packing_list like sopcklsti1 occurs 0 with header line,
            it_contents like solisti1 occurs 0 with header line,
            it_receivers like somlreci1 occurs 0 with header line,
            it_attachment like solisti1 occurs 0 with header line,
            gd_cnt type i,
            gd_sent_all(1) type c,
            gd_doc_data like sodocchgi1,
            gd_error type sy-subrc.
    data:   it_message type standard table of SOLISTI1 initial size 0
                    with header line.
    data : found_receiver type c,
           v_title(80) type c,
           l_text(180) type c.
    Fill the document data.
      gd_doc_data-doc_size = 1.
    Adds text to email text table
      append 'Pls see attached open purchase order report.' to it_message.
      append '' to it_message.
      concatenate 'Note: This is system generated report'
                  ', figures may subject to actual physical count.'
                  into l_text separated by space.
      append l_text to it_message.
    Populate the subject/generic message attributes
      CLEAR gd_doc_data.
      READ TABLE i_download INDEX w_cnt.
      gd_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( i_download ).
      gd_doc_data-obj_langu  = sy-langu.
      gd_doc_data-obj_name   = 'SAPRPT'.
    if p_asdate is initial .
         concatenate p_title ' '
                  sy-datum sy-uzeit into v_title separated by space.
    else .
        concatenate p_title ' '
                 p_bldat p_cputm into v_title separated by space.
    endif .
      gd_doc_data-obj_descr  = v_title .
      gd_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = i_download[].
    Describe the body of the message
      clear it_packing_list.
      refresh it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      describe table it_message lines it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      append it_packing_list.
    Create attachment notification
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num   = 1.
      it_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
      it_packing_list-doc_type   =  'XLS'.
      it_packing_list-obj_descr  =  'OPEN PURCHASE ORDER' .
      it_packing_list-obj_name   =  'PO.XLS' .
      it_packing_list-doc_size   =  it_packing_list-body_num * 255.
      APPEND it_packing_list.
    assign SAP user smtp address from successful retrieval.
      loop at p_email.
    Add the recipients email address
         found_receiver = 'X' .
         it_receivers-receiver = p_email-low.
         it_receivers-rec_type = 'U'.
         it_receivers-com_type = 'INT'.
         it_receivers-notif_del = ''.
         it_receivers-notif_ndel = 'X'.
         append it_receivers .
      endloop .
    Add default recipient email when unable to locate purc group email
       if found_receiver is initial .
           it_receivers-receiver = p_email.
           it_receivers-rec_type = 'U'.
           it_receivers-com_type = 'INT'.
           it_receivers-notif_del = ''.
           it_receivers-notif_ndel = 'X'.
          append it_receivers.
       endif .
    Call the FM to post the message to SAPMAIL
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
                commit_work                = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.
    Instructs mail send program for SAPCONNECT to send email.
      wait up to 2 seconds.
      if gd_error eq 0.
          submit rsconn01 with mode = 'INT'
                        with output = ' '
                        and return.
      endif.
    ENDFORM.                    " f_send_internet_mail

    Hi,
    go through this link,
    http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
    you have some sample programs.
    Regards,
    Raghavendra

  • Report output via E-mail

    Hi all,
    i have a written a report where i need to send the report output to somebody via
    E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
    i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
    now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field  length should be adjusted as per the output field length.
    i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
    any idea will be highly appreaciated.
    Regards
    if not p_email1 is initial.
         perform fill_report_csv.
         perform f_send_internet_mail.
      endif.
    FORM fill_report_csv.
       data :   l_text(232) type c,
               v_matnr1(21) type c,
               v_matnr(21) type c,
               v_matkl(14) type c,
               v_maktx(45) type c,
               v_ttlstk(14) type c,
               v_verpr(14) type c,
               v_werks(14) type c,
               v_lgort(14) type c,
               v_char(10) type c,
               v_stks type p ,
               v_po(40) type c,
               v_qty(13) type c,
                v_qty1 type sy-datum,
               v_date(15) type c,
               v_date1(15) TYPE C,
               v_name(35) type c,
               v_eknam(18) type c,
               v_lifnr(15) type c,
            l_po(40) type c,
            v_matnr(20) type c,
             l_rate(11) type  p decimals 5,
             l_flag type c.
      concatenate c_equal c_colon 'PO no.' c_colon
                    into v_po.
      concatenate c_equal c_colon 'Material no.' c_colon
                    into v_matnr.
      concatenate c_equal c_colon 'Description.' c_colon
                    into v_maktx.
      concatenate c_equal c_colon 'Due Qty.' c_colon
                    into v_qty.
      concatenate c_equal c_colon 'Del Date.' c_colon
                    into v_date.
      concatenate c_equal c_colon 'Vendor.' c_colon
                    into v_name.
      concatenate c_equal c_colon 'Buyer.' c_colon
                    into v_eknam.
      concatenate c_equal c_colon 'Vendor Code.' c_colon
                    into v_lifnr.
    concatenate
             v_po v_matnr v_maktx v_qty
             v_date v_name v_eknam v_lifnr
             into i_download
             SEPARATED BY con_tab.
      append i_download .
    clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
    clear wa_output.
    loop at i_output into wa_output.
       on change of wa_output-ebeln.
         clear v_lines.
         loop at i_eket into wa_eket
                 where ebeln = wa_output-ebeln.
           v_lines = v_lines + 1.
           clear wa_eket.
         endloop.
    **-- Checking of page break
         v_lines = sy-linno + v_lines .
         if 55 < v_lines  .
           write:/0(161) sy-uline.
           new-page.
         endif.
      clear v_lines.
          loop at i_eket into wa_eket
                  where ebeln = wa_output-ebeln.
            v_lines = v_lines + 1.
            clear wa_eket.
          endloop.
    *-- Calculating the due qty.
        wa_output-dumng = wa_output-menge - wa_output-wemng.
    *-- Writing the Line items of the PO.
        read table i_ekpo into wa_ekpo
              with key ebeln = wa_output-ebeln
                       ebelp = wa_output-ebelp.
         l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
    *-- Writing of PO detail
         if wa_output-dumng gt 0 .
         v_qty = wa_output-dumng.
        v_date1 = wa_output-eindt.
        v_maktx = wa_output-maktx.
         if wa_output-maktx+0(1) = '"' .
                concatenate  c_equal wa_output-maktx
                   into v_maktx  .
             else .
                concatenate  c_equal c_colon wa_output-maktx c_colon
                   into v_maktx  .
             endif .
       if wa_output-name1+0(1) = '"' .
                concatenate  c_equal wa_output-name1
                   into v_name  .
             else .
                concatenate  c_equal c_colon wa_output-name1 c_colon
                   into v_name  .
             endif .
        v_name = wa_output-name1.
        v_lifnr = wa_output-lifnr.
         write wa_output-eindt to v_date1 DD/MM/YYYY.
         concatenate '="' wa_output-ebeln '/'
                wa_output-ebelp '"' into v_po .
         concatenate '="' wa_output-matnr '"' into v_matnr .
             concatenate  c_equal c_colon wa_output-maktx c_colon
               into v_maktx  .
              concatenate  c_equal c_colon wa_output-dumng c_colon
               into v_qty1  .
               concatenate  c_equal c_colon wa_output-eindt c_colon
               into v_date1  .
              concatenate  c_equal c_colon wa_output-name1 c_colon
               into v_name  .
                concatenate  c_equal c_colon wa_output-eknam c_colon
                into v_eknam  .
              concatenate  c_equal c_colon wa_output-lifnr c_colon
               into v_lifnr  .
              concatenate  c_equal c_colon wa_mard-werks '/'
               wa_mard-lgort c_colon
               into v_lgort .
                 concatenate '="' wa_output-lifnr '"' into v_lifnr .
    condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
         concatenate
             v_po v_matnr v_maktx v_qty
             v_date1 v_name v_eknam v_lifnr
             into i_download
             SEPARATED BY con_tab.
        concatenate con_cret i_download INTO i_download .
        append i_download .
      endif.
    clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
    endloop.
    ENDFORM.                    " fill_report_csv
    *&      Form  f_send_internet_mail
          text
    -->  p1        text
    <--  p2        text
    FORM f_send_internet_mail.
    Variables
    data:   it_packing_list like sopcklsti1 occurs 0 with header line,
            it_contents like solisti1 occurs 0 with header line,
            it_receivers like somlreci1 occurs 0 with header line,
            it_attachment like solisti1 occurs 0 with header line,
            gd_cnt type i,
            gd_sent_all(1) type c,
            gd_doc_data like sodocchgi1,
            gd_error type sy-subrc.
    data:   it_message type standard table of SOLISTI1 initial size 0
                    with header line.
    data : found_receiver type c,
           v_title(80) type c,
           l_text(180) type c.
    Fill the document data.
      gd_doc_data-doc_size = 1.
    Adds text to email text table
      append 'Pls see attached open purchase order report.' to it_message.
      append '' to it_message.
      concatenate 'Note: This is system generated report'
                  ', figures may subject to actual physical count.'
                  into l_text separated by space.
      append l_text to it_message.
    Populate the subject/generic message attributes
      CLEAR gd_doc_data.
      READ TABLE i_download INDEX w_cnt.
      gd_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( i_download ).
      gd_doc_data-obj_langu  = sy-langu.
      gd_doc_data-obj_name   = 'SAPRPT'.
    if p_asdate is initial .
         concatenate p_title ' '
                  sy-datum sy-uzeit into v_title separated by space.
    else .
        concatenate p_title ' '
                 p_bldat p_cputm into v_title separated by space.
    endif .
      gd_doc_data-obj_descr  = v_title .
      gd_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = i_download[].
    Describe the body of the message
      clear it_packing_list.
      refresh it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      describe table it_message lines it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      append it_packing_list.
    Create attachment notification
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num   = 1.
      it_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
      it_packing_list-doc_type   =  'XLS'.
      it_packing_list-obj_descr  =  'OPEN PURCHASE ORDER' .
      it_packing_list-obj_name   =  'PO.XLS' .
      it_packing_list-doc_size   =  it_packing_list-body_num * 255.
      APPEND it_packing_list.
    assign SAP user smtp address from successful retrieval.
      loop at p_email.
    Add the recipients email address
         found_receiver = 'X' .
         it_receivers-receiver = p_email-low.
         it_receivers-rec_type = 'U'.
         it_receivers-com_type = 'INT'.
         it_receivers-notif_del = ''.
         it_receivers-notif_ndel = 'X'.
         append it_receivers .
      endloop .
    Add default recipient email when unable to locate purc group email
       if found_receiver is initial .
           it_receivers-receiver = p_email.
           it_receivers-rec_type = 'U'.
           it_receivers-com_type = 'INT'.
           it_receivers-notif_del = ''.
           it_receivers-notif_ndel = 'X'.
          append it_receivers.
       endif .
    Call the FM to post the message to SAPMAIL
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
                commit_work                = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.
    Instructs mail send program for SAPCONNECT to send email.
      wait up to 2 seconds.
      if gd_error eq 0.
          submit rsconn01 with mode = 'INT'
                        with output = ' '
                        and return.
      endif.
    ENDFORM.                    " f_send_internet_mail

    ans

Maybe you are looking for

  • Use of SOAP adapter in PI7.11 - migration from PI7.0

    Hello everybody, We are migrating from PI7.0 to PI7.11. we have a scenario RFC => PI => SOAP in PI 7.0 that work perfectly for 2 years in PI 7.11 that doesn'"t work. That gives the error message "com.sap.engine.interfaces.messaging.api.exception.Mess

  • SAP Quickviewer query for pricing records - V12L and KONH / KONP

    Has anyone used the logical database 'V12L' for pricing queries? There seems to be an issue with this logical database with some vague warning messages.. When I tried to create a simple table join query with KONH and KONP there are again some vague e

  • Can Mail send interactive PDF attachments with URL links?

    I have tried without success to send a PDF that has URL links embedded (made in InDesign CS3). When this mail arrives the links are stripped out from the attached PDF. I do not want to send html mail for this purpose. Anyone have any answers? Thanks.

  • HP Laserjet 4M

    I've just purchased new HP desktop P6653w computer and am trying to hook up an old HP laserjet printer to it. I've bought a USB to Parallel Converter cable for it. Is this all I need to hook it up with?

  • Create text area item within code in PLSQL region

    I want to embed a text area item within a region that is purely PLSQL. I want the text area to appear within the region at a specific place I am defining by my PLSQL. I have been able to create the look I want but haven't been able to process what th