MIRO printing

Hi,
My requirement is to print the LOgistic Invoice document while posting it through tcode MIRO like Purchase order or Sales order.
How do I do this?Where I have to do the customization settings and also will it possible to print the document as soon as it will be posted through MIRO.
Please give me the solution by which I can do this.
Thanks & Regards,
Amol

Hi,
Yes i have done all customization settings required in transaction code NACE.
My setting details are :
Output type : REKL
Driver Program : RM08NAST
Form Routine : ENTRY_ERS
Form : My Z-form name which is a copy of MR_PRINT
But still I can not be able to get the print after successful posting through MIRO.
Do i need to do some other settings apart from NACE?
Also i want to know whether it is possible to print from MIRO like other sales or purchasing transactions?
Thanks in advance,
Amol

Similar Messages

  • Hi pls respond my code

    Program Name: ZMM_MIRO                         Date       : 05/01/07        *
                                                   Version    : Final           *
    Author  : Rashmi Patil                         Last Update: 08/01/07        *
    Description : Program to print invoice document.                            *
    Includes          : None                                                    *
    Logical Databases : None                                                    *
    External Calls    :                                                         *
          Function Modules : POPUP_TO_INFORM                                    *
          Transactions     : ZMIRO                                              *
    Scheduling Issues :  None, run manually                                     *
    *Request      Owner  Date           Description                               *
    DEVK906817   Rashmi 16/03/2007     Addition of Service tax, vat & tds details
    *DEVK907005   Rashmi 10/04/2007     Addition of ecess,netpr in doc currency   *
    *DEVK907017   Rashmi 12/04/2007     Correction in netpr                       *
    DEVK907045   Rashmi 17/04/2007     Correction in o/p for multiple TDS entries
    *DEVK907292   Rashmi 21/05/2007     Correction in object key and fiscal year  *
    *DEVK907460   Dharani 06/06/2007    PIR-60118_Addition planned delivery cost  *
                                      in MIRO print                             *
    REPORT  zmm_miro        LINE-SIZE       132
                            LINE-COUNT       60
                            MESSAGE-ID       00
                            NO STANDARD PAGE HEADING.
    TABLES: ekbe.
    DATA : ebeln LIKE ekbe-ebeln,
           ebeln1(90),
           ebeln_1(10),
           ebeln_2(10),
           ebeln_3(10),
           gjahr LIKE ekbe-gjahr,
           mjahr LIKE mkpf-mjahr,
           addrnr LIKE lfa1-adrnr,
           mblnr LIKE mseg-mblnr,
           belnr1 LIKE bkpf-belnr,
           belnr2 LIKE bkpf-belnr,
           objkey1(14),
           objkey2(14),
           total(10) TYPE p DECIMALS 2,
           v_lines TYPE i,
           count TYPE i,
           start_at_line TYPE i,
           end_at_line TYPE i,
           counter TYPE i,
           x TYPE f,
           tot_number_of_lines TYPE i,
           tot_number_of_pages TYPE i,
           page_number VALUE 1 TYPE i,
           ernam LIKE ekbe-ernam,
           total1(10) TYPE p DECIMALS 2.                        "DEVK907005
    DATA : BEGIN OF it_ekbe OCCURS 0,
           ebeln LIKE ekbe-ebeln,
           END OF it_ekbe.
    DATA : BEGIN OF it_mkpf OCCURS 0,
           ebeln LIKE ekbe-ebeln,
           mblnr LIKE mkpf-mblnr,
           budat LIKE mkpf-budat,
           belnr LIKE bkpf-belnr,                               "DEVK907031
           END OF it_mkpf.
    DATA : BEGIN OF it_bseg OCCURS 0,
           belnr LIKE bseg-belnr,
           umskz LIKE bseg-umskz,
           hkont LIKE bseg-hkont,
           shkzg LIKE bseg-shkzg,
           dmbtr LIKE bseg-dmbtr,
           koart LIKE bseg-koart,
           mwskz LIKE bseg-mwskz,
           txt20 LIKE skat-txt20,
           ktosl LIKE bseg-ktosl,                               "DEVK906817
           fwbas LIKE bseg-fwbas,                               "DEVK906817
           wrbtr LIKE bseg-wrbtr,
           END OF it_bseg.
    DATA : BEGIN OF it_final OCCURS 0,
           belnr LIKE ekbe-belnr,
           budat3 LIKE ekbe-budat,
           lifnr LIKE ekko-lifnr,
           name1 LIKE lfa1-name1,
           street LIKE adrc-street,
           str_suppl3 LIKE adrc-str_suppl3,
           location LIKE adrc-location,
           city1 LIKE adrc-city1,
           city2 LIKE adrc-city2,
           j_1ipanno LIKE j_1imovend-j_1ipanno,
           j_1isern LIKE j_1imovend-j_1isern,
           j_1ilstno LIKE j_1imovend-j_1ilstno,
           belnr1 LIKE bkpf-belnr,
           budat1 LIKE bkpf-budat,
           belnr2 LIKE bkpf-belnr,
           budat2 LIKE bkpf-budat,
           xblnr LIKE bkpf-xblnr,                               "DEVK906817
           mblnr LIKE mkpf-mblnr,
           budat4 LIKE mkpf-budat,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           mwskz LIKE bseg-mwskz,
           umskz LIKE bseg-umskz,
           aufnr LIKE rbco-aufnr,
           kostl LIKE rbco-kostl,
           amount1(20),
           amount2(20),
           ktosl LIKE bseg-ktosl,                               "DEVK906817
           fwbas LIKE bseg-fwbas,                               "DEVK906817
           dc LIKE bkpf-waers,
           lc LIKE bkpf-hwaer,
           END OF it_final.
    ***Begin of DEVK906817
    DATA : BEGIN OF it_stax OCCURS 0,
           mwskz LIKE bseg-mwskz,
           text1 LIKE t007s-text1,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,               "Base amount
          amount(20),                                         "DEVK907005
           amount(10) TYPE p DECIMALS 2,                        "DEVK907005
           dc_indicator(10),
           END OF it_stax.
    DATA : BEGIN OF it_tds OCCURS 0,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,               "Base amount
          amount(20),                                         "DEVK907005
           amount(10) TYPE p DECIMALS 2,                        "DEVK907005
           dc_indicator(10),
           END OF it_tds.
    DATA : BEGIN OF it_vat OCCURS 0,
           mwskz LIKE bseg-mwskz,
           text1 LIKE t007s-text1,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,               "Base amount
          amount(20),                                         "DEVK907005
           amount(10) TYPE p DECIMALS 2,                        "DEVK907005
           dc_indicator(10),
           END OF it_vat.
    DATA : tds_base(20) VALUE 0.
    ***End of DEVK906817
    ***Begin of DEVK907005
    DATA : BEGIN OF it_ecess OCCURS 0,
           mwskz LIKE bseg-mwskz,
           text1 LIKE t007s-text1,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,               "Base amount
           amount(10) TYPE p DECIMALS 2,
           dc_indicator(10),
           END OF it_ecess.
    ***End of DEVK907005
    ***BEGIN OF DEVK907045
    DATA : BEGIN OF it_tds1 OCCURS 0,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,
           amount(10) TYPE p DECIMALS 2,
           dc_indicator(10),
           END OF it_tds1.
    DATA : BEGIN OF it_tds2 OCCURS 0,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,
           amount(10) TYPE p DECIMALS 2,
           dc_indicator(10),
           END OF it_tds2.
    DATA : BEGIN OF it_tds3 OCCURS 0,
           hkont LIKE bseg-hkont,
           txt20 LIKE skat-txt20,
           fwbas LIKE bseg-fwbas,
           amount(10) TYPE p DECIMALS 2,
           dc_indicator(10),
           END OF it_tds3.
    ***END OF DEVK907045
    data: year like bkpf-gjahr,        "DEVK907292
          bkpf_year like bkpf-gjahr .  "DEVK907292
    SELECTION-SCREEN
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *PARAMETERS: p_belnr LIKE ekbe-belnr OBLIGATORY.
    SELECT-OPTIONS: p_belnr FOR EKBE-BELNR .
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
      IF p_belnr NE ''.
        SELECT SINGLE ebeln gjahr budat ernam FROM ekbe INTO (ebeln,gjahr,it_final-budat3,ernam)
          WHERE belnr IN p_belnr.
    Start of changes by 147547 on 06/06/2007     DEVK907460   PIR-60118_Addition planned delivery cost  in MIRO print
          if sy-subrc ne 0.
          select single ebeln gjahr from rseg into (ebeln,gjahr)
           where belnr IN p_belnr.
           if sy-subrc = 0.
           select single budat usnam lifnr from rbkp into (it_final-budat3,ernam,it_final-lifnr)
           where belnr IN  p_belnr.
           endif.
          endif.
    End of changes by 147547 on 06/06/2007  DEVK907460   PIR-60118_Addition planned delivery cost in MIRO print
      ENDIF.
    *---IF ENTERED RECORD IS INVALID
    Start of changes by 147547 on 06/06/2007  DEVK907460   PIR-60118_Addition planned delivery cost in MIRO print
    IF sy-subrc <> 0.
    End of changes by 147547 on 06/06/2007  DEVK907460   PIR-60118_Addition planned delivery cost   in MIRO print
    if p_belnr eq ''.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = sy-repid
            txt1  = text-002
            txt2  = text-003.
        EXIT.
      ELSE.
    *---TO FETCH VENDOR NUMBER
    if it_final-lifnr = ''.
        SELECT SINGLE lifnr FROM ekko INTO it_final-lifnr
         WHERE ebeln = ebeln .
    endif.
    *---TO FETCH VENDOR ADDRESS
        SELECT SINGLE adrnr FROM lfa1 INTO addrnr WHERE lifnr = it_final-lifnr.
        SELECT SINGLE name1 street str_suppl3 location city1 city2 FROM adrc
          INTO CORRESPONDING FIELDS OF it_final
              WHERE addrnumber = addrnr.
        SELECT SINGLE j_1ipanno j_1isern j_1ilstno FROM j_1imovend INTO CORRESPONDING FIELDS OF it_final
         WHERE lifnr = it_final-lifnr.
    *---TO FETCH MATERIAL DOCUMENT NUMBER
        SELECT SINGLE mblnr FROM mseg INTO mblnr WHERE ebeln = ebeln.
        SELECT SINGLE mblnr budat mjahr FROM mkpf INTO (it_final-mblnr, it_final-budat4, mjahr)
          WHERE mblnr = mblnr.
    ***BEGIN OF DEVK907292
       CONCATENATE: p_belnr gjahr INTO objkey1,
                    it_final-mblnr mjahr INTO objkey2.
       select single gjahr from rbkp into year
         where belnr = p_belnr and budat = it_final-budat3.
         concatenate p_belnr year into objkey1.
    ***END OF DEVK907292
    ***Begin of DEVK906817
       SELECT SINGLE belnr budat FROM bkpf INTO (it_final-belnr1,it_final-budat1)
        WHERE awkey = objkey1.
       SELECT SINGLE belnr budat xblnr waers hwaer FROM bkpf INTO (it_final-belnr1,it_final-budat1,it_final-xblnr,it_final-dc,it_final-lc)
       WHERE awkey = objkey1.                                     "DEVK907292
        SELECT SINGLE belnr budat xblnr waers hwaer gjahr FROM bkpf INTO (it_final-belnr1,it_final-budat1,it_final-xblnr,it_final-dc,it_final-lc,bkpf_year)
        WHERE awkey = objkey1.                                      "DEVK907292
    ***End of DEVK906817
        SELECT SINGLE belnr budat FROM bkpf INTO (it_final-belnr2,it_final-budat2)
         WHERE awkey = objkey2.
    *---TO FETCH DATA FROM TABLE BSEG
    Begin of DEVK906817
       SELECT belnr umskz hkont dmbtr koart shkzg mwskz FROM bseg INTO CORRESPONDING FIELDS OF TABLE it_bseg
         WHERE belnr = it_final-belnr1.
        SELECT belnr umskz hkont dmbtr wrbtr koart shkzg mwskz ktosl fwbas FROM bseg INTO CORRESPONDING FIELDS OF TABLE it_bseg
          WHERE belnr = it_final-belnr1
          AND gjahr = bkpf_year.                           "DEVK907292
    ***End of DEVK906817
        LOOP AT it_bseg.
          SELECT SINGLE txt20 FROM skat INTO it_bseg-txt20
           WHERE saknr = it_bseg-hkont AND ktopl = 'TSKY'.
          IF it_bseg-koart = 'K'.
            MOVE it_final-name1 TO it_bseg-txt20.
            MOVE : it_bseg-dmbtr TO total,                      "DEVK907017
                   it_bseg-wrbtr TO total1.                     "DEVK907017
          ENDIF.
          MODIFY it_bseg.
        ENDLOOP.
        SORT it_bseg BY shkzg.
       total = 0.                       "DEVK907017
       total1 = 0.                      "DEVK907017
        LOOP AT it_bseg.
          AT FIRST.
            SELECT SINGLE kostl aufnr FROM rbco INTO CORRESPONDING FIELDS OF it_final
              WHERE belnr = p_belnr.
            CONDENSE it_final-aufnr.
          ENDAT.
          MOVE : p_belnr TO it_final-belnr,
                 it_bseg-hkont TO it_final-hkont,
                 it_bseg-txt20 TO it_final-txt20,
                 it_bseg-mwskz TO it_final-mwskz,
                 it_bseg-umskz TO it_final-umskz,
                 it_bseg-ktosl TO it_final-ktosl,               "DEVK906817
                 it_bseg-fwbas TO it_final-fwbas.               "DEVK906817
          IF it_bseg-shkzg = 'H'.
            MOVE '' TO it_final-amount2.
            MOVE it_bseg-dmbtr TO it_final-amount1.
            tds_base = tds_base + it_final-amount1.             "DEVK906817
    Begin of DEVK907017
           IF it_bseg-mwskz = ''.
             SUBTRACT it_bseg-dmbtr FROM total.
             SUBTRACT it_bseg-wrbtr FROM total1.               "DEVK907005
           ELSE.
             ADD it_bseg-dmbtr TO total.
             ADD it_bseg-wrbtr TO total1.                      "DEVK907005
           ENDIF.
    End of DEVK907017
          ELSE.
            MOVE '' TO it_final-amount1.
            MOVE it_bseg-dmbtr TO it_final-amount2.
          ENDIF.
          APPEND it_final.
          it_final-kostl = ''.
          it_final-aufnr = ''.
        ENDLOOP.
    Begin of DEVK906817
    *--- To get service tax details .
       LOOP AT it_final WHERE ktosl = 'ESE'                                      "DEVK907005
        LOOP AT it_final WHERE ktosl = 'ESE' OR ktosl = 'YSE'.  "DEVK907005
          MOVE-CORRESPONDING it_final TO it_stax.
          SELECT SINGLE text1 FROM t007s INTO it_stax-text1
            WHERE mwskz = it_stax-mwskz
            AND spras = 'E'
            AND kalsm = 'ZTAXIN'.
          it_stax-amount = it_final-amount1 + it_final-amount2.
          IF it_final-amount1 = ''.
            MOVE 'DEBIT' TO it_stax-dc_indicator.
          ELSE .
            MOVE 'CREDIT' TO it_stax-dc_indicator.
          ENDIF.
        ENDLOOP.
    Begin of DEVK907005
    *--- To get ecess details .
        LOOP AT it_final WHERE ktosl = 'ZSE' OR ktosl = 'YEC'.  "DEVK907005
          MOVE-CORRESPONDING it_final TO it_ecess.
          SELECT SINGLE text1 FROM t007s INTO it_ecess-text1
            WHERE mwskz = it_ecess-mwskz
            AND spras = 'E'
            AND kalsm = 'ZTAXIN'.
          it_ecess-amount = it_final-amount1 + it_final-amount2.
          IF it_final-amount1 = ''.
            MOVE 'DEBIT' TO it_ecess-dc_indicator.
          ELSE .
            MOVE 'CREDIT' TO it_ecess-dc_indicator.
          ENDIF.
        ENDLOOP.
    End of DEVK907005
    *--- To get TDS details .
        LOOP AT it_final WHERE mwskz = ''.
          MOVE-CORRESPONDING it_final TO it_tds.
          it_tds-amount = it_final-amount1 + it_final-amount2.
          MOVE tds_base TO it_tds-fwbas.
          MOVE 'CREDIT' TO it_tds-dc_indicator.
    ***BEGIN OF DEVK907045
         ENDLOOP.
          APPEND it_tds.
        ENDLOOP.
        LOOP AT it_tds.
          IF sy-tabix = 1.
            MOVE it_tds TO it_tds1.
          ENDIF.
          IF sy-tabix = 2.
            MOVE it_tds TO it_tds2.
          ENDIF.
          IF sy-tabix = 3.
            MOVE it_tds TO it_tds3.
          ENDIF.
        ENDLOOP.
    ***END OF DEVK907045
    *--- To get VAT/Sales tax details .
        LOOP AT it_final WHERE ktosl = 'JP5' OR ktosl = 'NVV'.
          MOVE-CORRESPONDING it_final TO it_vat.
          SELECT SINGLE text1 FROM t007s INTO it_vat-text1
            WHERE mwskz = it_vat-mwskz
            AND spras = 'E'
            AND kalsm = 'ZTAXIN'.
          it_vat-amount = it_final-amount1 + it_final-amount2.
          IF it_final-amount1 = ''.
            MOVE 'DEBIT' TO it_vat-dc_indicator.
          ELSE .
            MOVE 'CREDIT' TO it_vat-dc_indicator.
          ENDIF.
        ENDLOOP.
    End of DEVK906817
    *---TO FETCH PURCHASE OREDER AND MATERIAL DOCUMENT NUMBERS
        SELECT ebeln FROM ekbe INTO TABLE it_ekbe
          WHERE belnr IN p_belnr.
        LOOP AT it_ekbe.
          SELECT SINGLE mblnr FROM mseg INTO mblnr WHERE ebeln = it_ekbe-ebeln.
    ***BEGIN OF DEVK907031
         SELECT SINGLE mblnr budat FROM mkpf INTO CORRESPONDING FIELDS OF it_mkpf
            WHERE mblnr = mblnr.
          SELECT SINGLE mblnr budat mjahr FROM mkpf INTO CORRESPONDING FIELDS OF it_mkpf
          WHERE mblnr = mblnr.
          CONCATENATE: it_mkpf-mblnr mjahr INTO objkey2.
          SELECT SINGLE belnr FROM bkpf INTO it_mkpf-belnr
          WHERE awkey = objkey2.
    ***END OF DEVK907031
          MOVE it_ekbe-ebeln TO it_mkpf-ebeln.
          APPEND it_mkpf.
          CLEAR it_mkpf.
        ENDLOOP.
      ENDIF.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          form     = 'ZMIRO'
          language = 'E'.
      CLEAR it_final.
      DESCRIBE TABLE it_final LINES tot_number_of_lines.
      x = tot_number_of_lines / 20.
      tot_number_of_pages = CEIL( x ).
      WHILE page_number LE tot_number_of_pages.
    *--- START OF PAGE
        CALL FUNCTION 'START_FORM'
          EXPORTING
            form        = 'ZMIRO'
            language    = 'E'
            startpage   = 'FIRST'
            program     = 'ZMM_MIRO'
          EXCEPTIONS
            form        = 1
            format      = 2
            unended     = 3
            unopened    = 4
            unused      = 5
            spool_error = 6
            codepage    = 7
            OTHERS      = 8.
        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 'WRITE_FORM'
          EXPORTING
            window                   = 'FIRST'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        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 'WRITE_FORM'
          EXPORTING
            element                  = 'HEADER'
            window                   = 'MAIN'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *---CHOOSE APPROPRIATE SEGMENT OF IT_FINAL TO BE DISPLAYED IN THE PAGE
        start_at_line = ( 20 * ( page_number - 1 ) ) + 1.
        end_at_line = 20 * page_number.
        IF end_at_line GT tot_number_of_lines.
          end_at_line = tot_number_of_lines.
        ENDIF.
        DESCRIBE TABLE it_final LINES v_lines.
        LOOP AT it_final FROM start_at_line TO end_at_line.
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element                  = 'LINE_ITEMS'
              window                   = 'MAIN'
            EXCEPTIONS
              element                  = 1
              function                 = 2
              type                     = 3
              unopened                 = 4
              unstarted                = 5
              window                   = 6
              bad_pageformat_for_print = 7
              spool_error              = 8
              codepage                 = 9
              OTHERS                   = 10.
          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 'WRITE_FORM'
            EXPORTING
              window                   = 'WINDOW3'
            EXCEPTIONS
              element                  = 1
              function                 = 2
              type                     = 3
              unopened                 = 4
              unstarted                = 5
              window                   = 6
              bad_pageformat_for_print = 7
              spool_error              = 8
              codepage                 = 9
              OTHERS                   = 10.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    hi ,
    pls  help me, this is my print program . my requirement is print multiple invoice documents,.
    earlier it was print single t invoice docment.so in selection screen   they used parameter for invoice.
    now my requirement is make it parameter as select-option.
    pls i have to submit today only pls help me.
    check my print program below.
        ENDLOOP.
        CALL FUNCTION 'END_FORM'
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *---TO DISPLAY NEXT PAGE.
        page_number = page_number + 1.
        start_at_line = ( 20 * ( page_number - 1 ) ) + 1.
        end_at_line = 20 * page_number.
        IF end_at_line GT tot_number_of_lines.
          end_at_line = tot_number_of_lines.
        ENDIF.
      ENDWHILE.
    *--- START OF LAST PAGE
      CALL FUNCTION 'START_FORM'
        EXPORTING
          form        = 'ZMIRO'
          language    = 'E'
          startpage   = 'PAGE1'
          program     = 'ZMM_MIRO'
        EXCEPTIONS
          form        = 1
          format      = 2
          unended     = 3
          unopened    = 4
          unused      = 5
          spool_error = 6
          codepage    = 7
          OTHERS      = 8.
      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 'WRITE_FORM'
         EXPORTING
           window                   = 'WINDOW6'
         EXCEPTIONS
           element                  = 1
           function                 = 2
           type                     = 3
           unopened                 = 4
           unstarted                = 5
           window                   = 6
           bad_pageformat_for_print = 7
           spool_error              = 8
           codepage                 = 9
           OTHERS                   = 10.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
      LOOP AT it_mkpf.
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            window                   = 'WINDOW4'
          EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            spool_error              = 8
            codepage                 = 9
            OTHERS                   = 10.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDLOOP.
    ***Begin of DEVK906817
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          window                   = 'WINDOW7'
        EXCEPTIONS
          element                  = 1
          function                 = 2
          type                     = 3
          unopened                 = 4
          unstarted                = 5
          window                   = 6
          bad_pageformat_for_print = 7
          spool_error              = 8
          codepage                 = 9
          OTHERS                   = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ***End of DEVK906817
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          window                   = 'WINDOW5'
        EXCEPTIONS
          element                  = 1
          function                 = 2
          type                     = 3
          unopened                 = 4
          unstarted                = 5
          window                   = 6
          bad_pageformat_for_print = 7
          spool_error              = 8
          codepage                 = 9
          OTHERS                   = 10.
      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 'END_FORM'
      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 'CLOSE_FORM'.

    hi ,
    my requirement is print multiple  invoice documents.earlier it was printed only sinle invoice document.
    now i made invoice as a select-option instead of parameter .
    but remaining code  how &where should i write,
    pls provide code for this program.
    Program Name: ZMM_MIRO Date : 05/01/07 *
    Version : Final *
    Author : Rashmi Patil Last Update: 08/01/07 *
    Description : Program to print invoice document. *
    Includes : None *
    Logical Databases : None *
    External Calls : *
    Function Modules : POPUP_TO_INFORM *
    Transactions : ZMIRO *
    Scheduling Issues : None, run manually *
    *Request Owner Date Description *
    DEVK906817 Rashmi 16/03/2007 Addition of Service tax, vat & tds details
    *DEVK907005 Rashmi 10/04/2007 Addition of ecess,netpr in doc currency *
    *DEVK907017 Rashmi 12/04/2007 Correction in netpr *
    DEVK907045 Rashmi 17/04/2007 Correction in o/p for multiple TDS entries
    *DEVK907292 Rashmi 21/05/2007 Correction in object key and fiscal year *
    *DEVK907460 Dharani 06/06/2007 PIR-60118_Addition planned delivery cost *
    in MIRO print *
    REPORT zmm_miro LINE-SIZE 132
    LINE-COUNT 60
    MESSAGE-ID 00
    NO STANDARD PAGE HEADING.
    TABLES: ekbe.
    DATA : ebeln LIKE ekbe-ebeln,
    ebeln1(90),
    ebeln_1(10),
    ebeln_2(10),
    ebeln_3(10),
    gjahr LIKE ekbe-gjahr,
    mjahr LIKE mkpf-mjahr,
    addrnr LIKE lfa1-adrnr,
    mblnr LIKE mseg-mblnr,
    belnr1 LIKE bkpf-belnr,
    belnr2 LIKE bkpf-belnr,
    objkey1(14),
    objkey2(14),
    total(10) TYPE p DECIMALS 2,
    v_lines TYPE i,
    count TYPE i,
    start_at_line TYPE i,
    end_at_line TYPE i,
    counter TYPE i,
    x TYPE f,
    tot_number_of_lines TYPE i,
    tot_number_of_pages TYPE i,
    page_number VALUE 1 TYPE i,
    ernam LIKE ekbe-ernam,
    total1(10) TYPE p DECIMALS 2. "DEVK907005
    DATA : BEGIN OF it_ekbe OCCURS 0,
    ebeln LIKE ekbe-ebeln,
    END OF it_ekbe.
    DATA : BEGIN OF it_mkpf OCCURS 0,
    ebeln LIKE ekbe-ebeln,
    mblnr LIKE mkpf-mblnr,
    budat LIKE mkpf-budat,
    belnr LIKE bkpf-belnr, "DEVK907031
    END OF it_mkpf.
    DATA : BEGIN OF it_bseg OCCURS 0,
    belnr LIKE bseg-belnr,
    umskz LIKE bseg-umskz,
    hkont LIKE bseg-hkont,
    shkzg LIKE bseg-shkzg,
    dmbtr LIKE bseg-dmbtr,
    koart LIKE bseg-koart,
    mwskz LIKE bseg-mwskz,
    txt20 LIKE skat-txt20,
    ktosl LIKE bseg-ktosl, "DEVK906817
    fwbas LIKE bseg-fwbas, "DEVK906817
    wrbtr LIKE bseg-wrbtr,
    END OF it_bseg.
    DATA : BEGIN OF it_final OCCURS 0,
    belnr LIKE ekbe-belnr,
    budat3 LIKE ekbe-budat,
    lifnr LIKE ekko-lifnr,
    name1 LIKE lfa1-name1,
    street LIKE adrc-street,
    str_suppl3 LIKE adrc-str_suppl3,
    location LIKE adrc-location,
    city1 LIKE adrc-city1,
    city2 LIKE adrc-city2,
    j_1ipanno LIKE j_1imovend-j_1ipanno,
    j_1isern LIKE j_1imovend-j_1isern,
    j_1ilstno LIKE j_1imovend-j_1ilstno,
    belnr1 LIKE bkpf-belnr,
    budat1 LIKE bkpf-budat,
    belnr2 LIKE bkpf-belnr,
    budat2 LIKE bkpf-budat,
    xblnr LIKE bkpf-xblnr, "DEVK906817
    mblnr LIKE mkpf-mblnr,
    budat4 LIKE mkpf-budat,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    mwskz LIKE bseg-mwskz,
    umskz LIKE bseg-umskz,
    aufnr LIKE rbco-aufnr,
    kostl LIKE rbco-kostl,
    amount1(20),
    amount2(20),
    ktosl LIKE bseg-ktosl, "DEVK906817
    fwbas LIKE bseg-fwbas, "DEVK906817
    dc LIKE bkpf-waers,
    lc LIKE bkpf-hwaer,
    END OF it_final.
    ***Begin of DEVK906817
    DATA : BEGIN OF it_stax OCCURS 0,
    mwskz LIKE bseg-mwskz,
    text1 LIKE t007s-text1,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas, "Base amount
    amount(20), "DEVK907005
    amount(10) TYPE p DECIMALS 2, "DEVK907005
    dc_indicator(10),
    END OF it_stax.
    DATA : BEGIN OF it_tds OCCURS 0,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas, "Base amount
    amount(20), "DEVK907005
    amount(10) TYPE p DECIMALS 2, "DEVK907005
    dc_indicator(10),
    END OF it_tds.
    DATA : BEGIN OF it_vat OCCURS 0,
    mwskz LIKE bseg-mwskz,
    text1 LIKE t007s-text1,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas, "Base amount
    amount(20), "DEVK907005
    amount(10) TYPE p DECIMALS 2, "DEVK907005
    dc_indicator(10),
    END OF it_vat.
    DATA : tds_base(20) VALUE 0.
    ***End of DEVK906817
    ***Begin of DEVK907005
    DATA : BEGIN OF it_ecess OCCURS 0,
    mwskz LIKE bseg-mwskz,
    text1 LIKE t007s-text1,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas, "Base amount
    amount(10) TYPE p DECIMALS 2,
    dc_indicator(10),
    END OF it_ecess.
    ***End of DEVK907005
    ***BEGIN OF DEVK907045
    DATA : BEGIN OF it_tds1 OCCURS 0,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas,
    amount(10) TYPE p DECIMALS 2,
    dc_indicator(10),
    END OF it_tds1.
    DATA : BEGIN OF it_tds2 OCCURS 0,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas,
    amount(10) TYPE p DECIMALS 2,
    dc_indicator(10),
    END OF it_tds2.
    DATA : BEGIN OF it_tds3 OCCURS 0,
    hkont LIKE bseg-hkont,
    txt20 LIKE skat-txt20,
    fwbas LIKE bseg-fwbas,
    amount(10) TYPE p DECIMALS 2,
    dc_indicator(10),
    END OF it_tds3.
    ***END OF DEVK907045
    data: year like bkpf-gjahr, "DEVK907292
    bkpf_year like bkpf-gjahr . "DEVK907292
    SELECTION-SCREEN
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *PARAMETERS: p_belnr LIKE ekbe-belnr OBLIGATORY.
    SELECT-OPTIONS: p_belnr FOR EKBE-BELNR .
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
    IF p_belnr NE ''.
    SELECT SINGLE ebeln gjahr budat ernam FROM ekbe INTO (ebeln,gjahr,it_final-budat3,ernam)
    WHERE belnr IN p_belnr.
    Start of changes by 147547 on 06/06/2007 DEVK907460 PIR-60118_Addition planned delivery cost in MIRO print
    if sy-subrc ne 0.
    select single ebeln gjahr from rseg into (ebeln,gjahr)
    where belnr IN p_belnr.
    if sy-subrc = 0.
    select single budat usnam lifnr from rbkp into (it_final-budat3,ernam,it_final-lifnr)
    where belnr IN p_belnr.
    endif.
    endif.
    End of changes by 147547 on 06/06/2007 DEVK907460 PIR-60118_Addition planned delivery cost in MIRO print
    ENDIF.
    *---IF ENTERED RECORD IS INVALID
    Start of changes by 147547 on 06/06/2007 DEVK907460 PIR-60118_Addition planned delivery cost in MIRO print
    IF sy-subrc 0.
    End of changes by 147547 on 06/06/2007 DEVK907460 PIR-60118_Addition planned delivery cost in MIRO print
    if p_belnr eq ''.
    CALL FUNCTION 'POPUP_TO_INFORM'
    EXPORTING
    titel = sy-repid
    txt1 = text-002
    txt2 = text-003.
    EXIT.
    ELSE.
    *---TO FETCH VENDOR NUMBER
    if it_final-lifnr = ''.
    SELECT SINGLE lifnr FROM ekko INTO it_final-lifnr
    WHERE ebeln = ebeln .
    endif.
    *---TO FETCH VENDOR ADDRESS
    SELECT SINGLE adrnr FROM lfa1 INTO addrnr WHERE lifnr = it_final-lifnr.
    SELECT SINGLE name1 street str_suppl3 location city1 city2 FROM adrc
    INTO CORRESPONDING FIELDS OF it_final
    WHERE addrnumber = addrnr.
    SELECT SINGLE j_1ipanno j_1isern j_1ilstno FROM j_1imovend INTO CORRESPONDING FIELDS OF it_final
    WHERE lifnr = it_final-lifnr.
    *---TO FETCH MATERIAL DOCUMENT NUMBER
    SELECT SINGLE mblnr FROM mseg INTO mblnr WHERE ebeln = ebeln.
    SELECT SINGLE mblnr budat mjahr FROM mkpf INTO (it_final-mblnr, it_final-budat4, mjahr)
    WHERE mblnr = mblnr.
    ***BEGIN OF DEVK907292
    CONCATENATE: p_belnr gjahr INTO objkey1,
    it_final-mblnr mjahr INTO objkey2.
    select single gjahr from rbkp into year
    where belnr = p_belnr and budat = it_final-budat3.
    concatenate p_belnr year into objkey1.
    ***END OF DEVK907292
    ***Begin of DEVK906817
    SELECT SINGLE belnr budat FROM bkpf INTO (it_final-belnr1,it_final-budat1)
    WHERE awkey = objkey1.
    SELECT SINGLE belnr budat xblnr waers hwaer FROM bkpf INTO (it_final-belnr1,it_final-budat1,it_final-xblnr,it_final-dc,it_final-lc)
    WHERE awkey = objkey1. "DEVK907292
    SELECT SINGLE belnr budat xblnr waers hwaer gjahr FROM bkpf INTO (it_final-belnr1,it_final-budat1,it_final-xblnr,it_final-dc,it_final-lc,bkpf_year)
    WHERE awkey = objkey1. "DEVK907292
    ***End of DEVK906817
    SELECT SINGLE belnr budat FROM bkpf INTO (it_final-belnr2,it_final-budat2)
    WHERE awkey = objkey2.
    *---TO FETCH DATA FROM TABLE BSEG
    Begin of DEVK906817
    SELECT belnr umskz hkont dmbtr koart shkzg mwskz FROM bseg INTO CORRESPONDING FIELDS OF TABLE it_bseg
    WHERE belnr = it_final-belnr1.
    SELECT belnr umskz hkont dmbtr wrbtr koart shkzg mwskz ktosl fwbas FROM bseg INTO CORRESPONDING FIELDS OF TABLE it_bseg
    WHERE belnr = it_final-belnr1
    AND gjahr = bkpf_year. "DEVK907292
    ***End of DEVK906817
    LOOP AT it_bseg.
    SELECT SINGLE txt20 FROM skat INTO it_bseg-txt20
    WHERE saknr = it_bseg-hkont AND ktopl = 'TSKY'.
    IF it_bseg-koart = 'K'.
    MOVE it_final-name1 TO it_bseg-txt20.
    MOVE : it_bseg-dmbtr TO total, "DEVK907017
    it_bseg-wrbtr TO total1. "DEVK907017
    ENDIF.
    MODIFY it_bseg.
    ENDLOOP.
    SORT it_bseg BY shkzg.
    total = 0. "DEVK907017
    total1 = 0. "DEVK907017
    LOOP AT it_bseg.
    AT FIRST.
    SELECT SINGLE kostl aufnr FROM rbco INTO CORRESPONDING FIELDS OF it_final
    WHERE belnr = p_belnr.
    CONDENSE it_final-aufnr.
    ENDAT.
    MOVE : p_belnr TO it_final-belnr,
    it_bseg-hkont TO it_final-hkont,
    it_bseg-txt20 TO it_final-txt20,
    it_bseg-mwskz TO it_final-mwskz,
    it_bseg-umskz TO it_final-umskz,
    it_bseg-ktosl TO it_final-ktosl, "DEVK906817
    it_bseg-fwbas TO it_final-fwbas. "DEVK906817
    IF it_bseg-shkzg = 'H'.
    MOVE '' TO it_final-amount2.
    MOVE it_bseg-dmbtr TO it_final-amount1.
    tds_base = tds_base + it_final-amount1. "DEVK906817
    Begin of DEVK907017
    IF it_bseg-mwskz = ''.
    SUBTRACT it_bseg-dmbtr FROM total.
    SUBTRACT it_bseg-wrbtr FROM total1. "DEVK907005
    ELSE.
    ADD it_bseg-dmbtr TO total.
    ADD it_bseg-wrbtr TO total1. "DEVK907005
    ENDIF.
    End of DEVK907017
    ELSE.
    MOVE '' TO it_final-amount1.
    MOVE it_bseg-dmbtr TO it_final-amount2.
    ENDIF.
    APPEND it_final.
    it_final-kostl = ''.
    it_final-aufnr = ''.
    ENDLOOP.
    Begin of DEVK906817
    To get service tax details .
    LOOP AT it_final WHERE ktosl = 'ESE' "DEVK907005
    LOOP AT it_final WHERE ktosl = 'ESE' OR ktosl = 'YSE'. "DEVK907005
    MOVE-CORRESPONDING it_final TO it_stax.
    SELECT SINGLE text1 FROM t007s INTO it_stax-text1
    WHERE mwskz = it_stax-mwskz
    AND spras = 'E'
    AND kalsm = 'ZTAXIN'.
    it_stax-amount = it_final-amount1 + it_final-amount2.
    IF it_final-amount1 = ''.
    MOVE 'DEBIT' TO it_stax-dc_indicator.
    ELSE .
    MOVE 'CREDIT' TO it_stax-dc_indicator.
    ENDIF.
    ENDLOOP.
    Begin of DEVK907005
    To get ecess details .
    LOOP AT it_final WHERE ktosl = 'ZSE' OR ktosl = 'YEC'. "DEVK907005
    MOVE-CORRESPONDING it_final TO it_ecess.
    SELECT SINGLE text1 FROM t007s INTO it_ecess-text1
    WHERE mwskz = it_ecess-mwskz
    AND spras = 'E'
    AND kalsm = 'ZTAXIN'.
    it_ecess-amount = it_final-amount1 + it_final-amount2.
    IF it_final-amount1 = ''.
    MOVE 'DEBIT' TO it_ecess-dc_indicator.
    ELSE .
    MOVE 'CREDIT' TO it_ecess-dc_indicator.
    ENDIF.
    ENDLOOP.
    End of DEVK907005
    To get TDS details .
    LOOP AT it_final WHERE mwskz = ''.
    MOVE-CORRESPONDING it_final TO it_tds.
    it_tds-amount = it_final-amount1 + it_final-amount2.
    MOVE tds_base TO it_tds-fwbas.
    MOVE 'CREDIT' TO it_tds-dc_indicator.
    ***BEGIN OF DEVK907045
    ENDLOOP.
    APPEND it_tds.
    ENDLOOP.
    LOOP AT it_tds.
    IF sy-tabix = 1.
    MOVE it_tds TO it_tds1.
    ENDIF.
    IF sy-tabix = 2.
    MOVE it_tds TO it_tds2.
    ENDIF.
    IF sy-tabix = 3.
    MOVE it_tds TO it_tds3.
    ENDIF.
    ENDLOOP.
    ***END OF DEVK907045
    To get VAT/Sales tax details .
    LOOP AT it_final WHERE ktosl = 'JP5' OR ktosl = 'NVV'.
    MOVE-CORRESPONDING it_final TO it_vat.
    SELECT SINGLE text1 FROM t007s INTO it_vat-text1
    WHERE mwskz = it_vat-mwskz
    AND spras = 'E'
    AND kalsm = 'ZTAXIN'.
    it_vat-amount = it_final-amount1 + it_final-amount2.
    IF it_final-amount1 = ''.
    MOVE 'DEBIT' TO it_vat-dc_indicator.
    ELSE .
    MOVE 'CREDIT' TO it_vat-dc_indicator.
    ENDIF.
    ENDLOOP.
    End of DEVK906817
    *---TO FETCH PURCHASE OREDER AND MATERIAL DOCUMENT NUMBERS
    SELECT ebeln FROM ekbe INTO TABLE it_ekbe
    WHERE belnr IN p_belnr.
    LOOP AT it_ekbe.
    SELECT SINGLE mblnr FROM mseg INTO mblnr WHERE ebeln = it_ekbe-ebeln.
    ***BEGIN OF DEVK907031
    SELECT SINGLE mblnr budat FROM mkpf INTO CORRESPONDING FIELDS OF it_mkpf
    WHERE mblnr = mblnr.
    SELECT SINGLE mblnr budat mjahr FROM mkpf INTO CORRESPONDING FIELDS OF it_mkpf
    WHERE mblnr = mblnr.
    CONCATENATE: it_mkpf-mblnr mjahr INTO objkey2.
    SELECT SINGLE belnr FROM bkpf INTO it_mkpf-belnr
    WHERE awkey = objkey2.
    ***END OF DEVK907031
    MOVE it_ekbe-ebeln TO it_mkpf-ebeln.
    APPEND it_mkpf.
    CLEAR it_mkpf.
    ENDLOOP.
    ENDIF.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    form = 'ZMIRO'
    language = 'E'.
    CLEAR it_final.
    DESCRIBE TABLE it_final LINES tot_number_of_lines.
    x = tot_number_of_lines / 20.
    tot_number_of_pages = CEIL( x ).
    WHILE page_number LE tot_number_of_pages.
    START OF PAGE
    CALL FUNCTION 'START_FORM'
    EXPORTING
    form = 'ZMIRO'
    language = 'E'
    startpage = 'FIRST'
    program = 'ZMM_MIRO'
    EXCEPTIONS
    form = 1
    format = 2
    unended = 3
    unopened = 4
    unused = 5
    spool_error = 6
    codepage = 7
    OTHERS = 8.
    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 'WRITE_FORM'
    EXPORTING
    window = 'FIRST'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    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 'WRITE_FORM'
    EXPORTING
    element = 'HEADER'
    window = 'MAIN'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *---CHOOSE APPROPRIATE SEGMENT OF IT_FINAL TO BE DISPLAYED IN THE PAGE
    start_at_line = ( 20 * ( page_number - 1 ) ) + 1.
    end_at_line = 20 * page_number.
    IF end_at_line GT tot_number_of_lines.
    end_at_line = tot_number_of_lines.
    ENDIF.
    DESCRIBE TABLE it_final LINES v_lines.
    LOOP AT it_final FROM start_at_line TO end_at_line.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'LINE_ITEMS'
    window = 'MAIN'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    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 'WRITE_FORM'
    EXPORTING
    window = 'WINDOW3'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    hi ,
    pls help me, this is my print program . my requirement is print multiple invoice documents,.
    earlier it was print single t invoice docment.so in selection screen they used parameter for invoice.
    now my requirement is make it parameter as select-option.
    pls i have to submit today only pls help me.
    check my print program below.
    ENDLOOP.
    CALL FUNCTION 'END_FORM'
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *---TO DISPLAY NEXT PAGE.
    page_number = page_number + 1.
    start_at_line = ( 20 * ( page_number - 1 ) ) + 1.
    end_at_line = 20 * page_number.
    IF end_at_line GT tot_number_of_lines.
    end_at_line = tot_number_of_lines.
    ENDIF.
    ENDWHILE.
    START OF LAST PAGE
    CALL FUNCTION 'START_FORM'
    EXPORTING
    form = 'ZMIRO'
    language = 'E'
    startpage = 'PAGE1'
    program = 'ZMM_MIRO'
    EXCEPTIONS
    form = 1
    format = 2
    unended = 3
    unopened = 4
    unused = 5
    spool_error = 6
    codepage = 7
    OTHERS = 8.
    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 'WRITE_FORM'
    EXPORTING
    window = 'WINDOW6'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT it_mkpf.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    window = 'WINDOW4'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDLOOP.
    ***Begin of DEVK906817
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    window = 'WINDOW7'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ***End of DEVK906817
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    window = 'WINDOW5'
    EXCEPTIONS
    element = 1
    function = 2
    type = 3
    unopened = 4
    unstarted = 5
    window = 6
    bad_pageformat_for_print = 7
    spool_error = 8
    codepage = 9
    OTHERS = 10.
    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 'END_FORM'
    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 'CLOSE_FORM'.

  • Smartform Printout overlapping

    Hello All,
    I have created smartform for MIRO printing with new page format.
    While printing the print preview is showing proper number of pages
    but when printout comes, it appears all pages overlapped on single page.
    In spool number of printing pages are proper.
    Page format is created and properly assigned to device type.
    Still the print is coming on single page of all the pages i.e overlapped.
    Waiting for reply
    Regards
    Pradnya Ramteke

    Hi
    In the page attributes of the smartform, did you give the next page as second page?? Just check if the page attributes are given correctly??
    Regards,
    Vishwa.

  • Print out put for miro and incomming excise invoice(j1iex)

    Hi guru's
    my client need print out for miro and incoming excise invoice.Plz help me in configuring them.
    thanks
    with regards

    hi,
    Do check the NACE transaction...
    Message schema is nothing but a program which will come into action whenever there will any need of output...
    So, check your message schema...Define the output type as per your requirement...
    Condition table consist of all those Fields which will be taken into consideration, whenever you trigger the message output...and those fields will be taken into consideration for the req. output...
    Access seq. will provide you the scequence in which the fields are be read and perform an output...
    At last printer determination is main, by which you'll print output...
    hope it helps..
    Regards
    Rahul.

  • Form Printing Through MIRO

    Hi All,
    I have to print an SAPscript Thru MIRO transaction. I have done the Settings in NACE transaction with a Z output type. All the settings are correct in one server and i am getting the printout and table NAST is getting updated. But with same settings, i dont get the print out in another system and table NAST is not getting updated.
    Please guide me..As to where could be the error.
    Urgent!!!
    Thanks in Advance

    Hi,
    Just check whether the NACE settings are there are not in the second server, and also check whether the Z output is existed .....
    Regards
    Sudheer

  • Message type to print in MIRO

    Hello guys,
    my problem is this:
    I must parametrize the output message in MIRO to print the invoice but when I run MIRO and I select from menu the voice 'Go to'> 'Message'>'Header and I insert the output type(message,for example MLPP) the system gives me message n°V0104..?What is it means'because my problem is to set my output type as a default like for example in Purchase Order in which I can insert several output type(message) as a default.For example NEU or others...
    I have already parametrized the message determination  for Logistic invoice but I can't associate these message type of print as a default in my Logistic Invoices-->must I execute this association in SPRO or in other ways?
    Thanks in advance,I promise 10 points for a fast resolutive answer.
    Bye
    Maximilian

    Dear Dheeraj,
    I have already maintained the required condition record in NACR/NACE for my output type under invoice verification:I have always the error message V0104...What do tou think?
    Thanks,bye
    Maximilian

  • Print preview MIRO output

    Dear friends,
    Where we can print or see print preview, invoices posted through MIRO tcode ?
    Regards,
    Praveen Lobo

    hi
    u can see with tcode MR90 .
    You execute this transaction  and then select the line item for which you want print .
    then in the header move to GOTO and there you will find print preview.
    hope it helps
    reward if useful
    Rohit

  • How to get Print out of MIRO

    Hi all,
           Please tell me the steps to get a print out of Logistic Invoice verfication.

    As per standard there is no Output type for Invoice printing.
    You need to create a new message tpe ZINV copying the KONS or ERS out put type , Copy all the settings which are maintained.
    SPRO-> Materials Management-> Logistics Invoice Verification-> Message Determination-> Maintain Message Types
    Maintain ZINV in message schema in
    SPRO-> Materials Management-> Logistics Invoice Verification-> Message Determination-> Maintain Message Schemas, Here Selct
    MR0002 - Logistics Inv. Ver. (MR1M), Click on Control Dat & add the newly created out put type
    Maintain the Condition records for the output type ZINV in MRM1 transaction.
    with key combination Compnay code or Company code/Vendor
    So when you create the Invoice the Message gets triggered.
    Then you can print the Invoice using transaction MR90.
    If you want to change the form you can create anew one & then assign the Same to the Out put type
    Thanks & Regards
    Kishore
    Edited by: Kishore Kumar Chiluka on Jul 25, 2008 8:54 AM

  • Print Out in MIRO

    Hello
    I have created the New output type in Invoice Verification (MR),
    i am not getting the output type in the MIRO Transaction in messages.
    When the select from the F4 option there are only two output types
    MLPP
    REKL
    Whatever the O\P type i have created is not appearing in the possible list of entries??
    Please help in this scenario.
    Regards,
    Kumar

    Dear Kumar,
    Once you create message out put type, you need to assign it to schemas. You do this in SPRO -Material Management- Logistics Invoice verification- Message determination-Maintain message schemas-MR0002.
    Then maintain the condtion record in MRM1 and try through MR90. I hope this will clarify all your doubts. Please reward me accordingly.
    Thanks,
    Ganesh

  • Print Invoice (MIRO) Docuemnt

    Dear Friends,
    What is configuration and procedure to priniting MIRO document . what is the output tyep to use in MR90. Please confirm. Can i use REKL ? what is configuration steps and COndition types to be used.
    Please confirm
    Thanks
    Madhavan

    Hi,
    I used output type REKL and partner fuction PI, Invoicing party. Used standard form MR_REKL.
    Following srror message appearing.
    Partner 500034 does not exist for partner function RS while saving MIRO docuemnt
    During MR90, the output is created, while processing follwoing error appearing
    Table RSEG: entry 5105600896 2009 2 does not exist
    the eror log is given below
    Processing log for program RM08NAST routine ENTRY_REKL
    Table T001: entry MECO KALSM  does not exist
    Table RSEG: entry 5105600897 2009 2 does not exist
    Please advise me to rectify the error
    Rgds
    Madhavan
    Edited by: Madhavan SR on May 21, 2009 1:11 PM

  • Print out of Layout

    Hi,
    Need suggestion for getting print out put of GRN (in MIGO), Invoice verification (in MIRO) & service entry sheet. Request you to suggest on this.
    Regards,
    Ranjan

    Hi
    Check following are some of steps for GR collective printing from SDN only
    1. Maintain the Printer Name in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Printer Setting
    2. Ensure that in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Item Print Indicator, 1 stands for Matl Doc print out
    3. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Print Version, maintain Print Version 2
    4. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Maintain Print Indicator for GI/Transfer Posting Documents
    5. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Maintain Output Types, for the Output types WE01, WE02 and WE03, ensure the foll:
    a. Default Values: Dispatch Time is 3 or 4 as per reqmt. and Tr medium is 1
    b. Print Parameter is 7
    6. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Printer Det->Pr Det by Pl/StoLoc, maintain the Output device for all your Plants
    7. Go to MN21, for Tr Type WE, Print Version 3, maintain Print Item as 1.
    Now the settings are ready for Printing Material doc
    8. While doing MIGO, ensure that in General Tab, you get "3 Collective Slip" beside the Print Indicator and you tick mark the field.
    9. Now depending on the setting in 5a, the Matl doc is printed. If it is 3, you have to print it using MB90. If it is 4, it is printed immediately.
    Regards,
    Archit

  • Print out of invoice verification..

    Dear All,
    Is it possible to take print out of Logistic invoice verification - MIRO(Like PO)?
    Application "MR" for this is available but i don't know how to use and  configure it...can you please explain steps like where i have to assign smart form..output type,condition record and other settings?
    or i have to create any T-code for this and assign smart form there..
    Thanks,
    Naren

    Hello,
    Please note that as Invoice Verification is posting of incoming document, SAP does not provide for direct print settings. You can only print Invoice Plans, EDI and any Invoice complaints. You can however try with INS (Invoice Plan) and REKL. Maintain the conditions for wither of these and it will work.
    Go to NACE. You can configure all the documents in single Tcode.
    for more clarification floww this link
    http://help.sap.com/saphelp_45b/helpdata/en/a8/b99864452b11d189430000e829fbbd/content.htm
    Regards
    Mahesh Naik.

  • MIRO - Posting with trans.type 159 not possible (No acquisition posted)

    Hi all,
    I have a case where an asset PO was created with multiple account assignment in one line item.  For example, purchase 10 pc of printer with 10 asset numbers specified in the account assignment tab.  By standard SAP, the GR is non-valuated.
    The GR of the PO was done in the previous period.  Now, when the invoice is to be posted thru MIRO.  The system generate error message to me.  The error message is "Posting with trans.type 159 not possible (No acquisition posted)" and message number is AA324.
    The reason of this error is due to no acquisition date in the asset master.  GR is non-valuated hence, the acquisition date is not populated in the asset as well.  I believe this is quite a common problem.  Kindly advise any workaround solution.
    Thanks.
    Tom

    Hi
    refer notes 1526247 and 1507808... Though it relates to Japan, but the issue is same
    Br, Ajay M

  • Goods Return and MIRO Credit Memo

    Hello Friends,
    Please give your suggestions for the queries below :
    1. Is there any way we can create Credit Memo (MIRO) with reference to MIGO 122 Movement document (Rejected material returned)
    2. Is there a report that shows the list of MIRO Credit Memos. (My document type is the same for both Invoice and Credit Memo)
    3. Is there a standard report of MIGO 122 Movement document linking with MIRO Credit Memo and possibly PO.
    4. If 161 movement solves my problem,  what is the document that I can print out and send alongwith the rejected material to Vendor.
    The question from my customer that how do confirm whether credit memo have been entered for all that is moved out of their premises as rejected material.
    Regards

    Hi,
    1.  If you are using ERS, then running MRRL transaction will automatically generate credit memo for your return delivery with movement type 122.
    2.  MIR5 is the one you should look into.
    3.  Take a look into ME80FN report.  Yet, this report does not indicate specifically for movement type 122.  If it is required that this movement type shall be chosen as part of selection parameters, then you should develop your own report.
    4.  There is not any particular difference if you are using movement type 161.  The only difference is that in case of using 161, you will have to raise a new return PO and make necessary GR and IR posting.  However, the disadvantage is that you will lose the track of your original PO (and PO history).
    Cheers,
    HT

  • USER EXIT or BADI for Vendor field in MIRO

    Hi Experts,
    In MIRO transaction vendor field gets defaulted from Purchase Order. So my requirement is to changes that vendor with alternate payee.
    To <u>replace the vendor with alternate payee</u> I need the <b>USER EXIT or BADI</b>, kindly help me on this will be useful for us.
    Thanks in Advance.
    SAP Consultant

    Transaction Code - MIGO                     Goods Movement
    Exit Name           Description
    MBCF0002            Customer function exit: Segment text in material do
    MBCF0005            Material document item for goods receipt/issue slip
    MBCF0006            Customer function for WBS element
    MBCF0007            Customer function exit: Updating a reservation
    MBCF0009            Filling the storage location field
    MBCF0010            Customer exit: Create reservation BAPI_RESERVATION_
    MBCF0011            Read from RESB and RKPF for print list in  MB26
    MB_CF001            Customer Function Exit in the Case of Updating a Ma
    No of Exits:          8
    BAPI-step by step procedure
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all BAPI's
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    Rewards if useful.................
    Minal

Maybe you are looking for