Sending Invoice as PDF in email

Hello,
I have a requirement where I have to send Proforma Invoice as PDF in email.
Now, the Proforma Invoice is already using output type to Print and when I see the routines in Tcode NACE
It uses RVADAUS1 Program where it calls RV_EXPORT_DOCUMENT_PRINT function module to generate the Print document.
This works fine.
So, I created a new output type, copied the  RVADAUS1 to ZRVADAUS1 and modified the code where I am capturing the Spool generated through the original code and pass it to CONVERT_ABAPSPOOLJOB_2_PDF to convert it to PDF and then send it as an email.
Now, the problem I am facing is that, I am not able to generate a Spool when I am using the medium ( '5' External Send ). So the further code of capturing Spool and convert to PDF and send as email fails.
Any guidance is appreciated.
Regards,
DNP

Hi Sudhanshu,
Just before calling the function module RV_EXPORT_DOCUMENT_PRINT.
I forced TNAPR-NACHA = '1'. and NAST-NACHA = '1'.
which means I forced Transmission medium as 1(Print) instead of 5(External Send)
This created a SPOOL.
Regards,
DNP
Edited by: DNP on Aug 14, 2009 11:45 AM

Similar Messages

  • Send invoice (copies) to multiple email address

    Hi,
    Is it possible to send invoice(copies) to multiple email address? how?
    Understand that we can maintain multiple email add for a customer. Example if 5 email add has been maintained for customer A, let say if I need to email 1 original invoice to email add 1 and email the other 2 copies invoice to email add 2 & 3 , how do I select the email add 1, 2 & 3 from the customer under the OUTPUT of change invoice (VF02) when we only input the customer code under Partner?
    Appreciate your inputs on the above.

    Hi,
    I think it is possible to send invoice copies to multiple email addresses using comma in between them.
    Regards,
    Sarosh

  • Send Invoice as PDF Attachment with variable Filename

    Hello!
    We got a requirement from one customer. We should send our invoices as PDF-Attachment via E-Mail but the attachment must have a variable filename. At the Moment we can send invoice as PDF-Attachment but only with a fix filename.
    How can we change the filename in our Adobe Forms?
    Best Regards
    Markus

    Hi Florian!
    Answer 1:
        The original Name is Druckdaten.pdf
    Answer 2:
         Our entry in NAST-NACHA = 1
    Answer 3:
         I can implement some ABAP-Code
    Here some Screenshots:
    Configuration  of printer E-MAIL:
    Best regards
    Markus

  • Error send a smartform PDF by Email to Vendor

    Hi Expert,
    Please help me.........................
    I want to send a PO (Smartform) as Email to Vendor.
    In SAPScript the PO send by Email is working fine, but in Smartforms it is not working.
    Normally, I will use via Smartforms the Program = YBAA_FM06P, FORM routine = ENTRY_NEU, PDF/Smartform Form = ZYBAA_MMPO1.
    A communication strategy has communication type as INT has been defined.
    This communication strategy has been set as default in the output type ZNEU. The transmission medium has been set to 5 (External Send) and the partner function as VN (Vendor).
    The e-mail address of the vendor has also been maintained.
    In transaction MN04, i have also made an entry for output type ZNEU and set the document type as NB.
    But message output do not create.
    How to send a smartform PDF by Email to vendor?
    Thanks,

    Hi,
    I can convert the PO output in to PDF from SOST I can sent it to external vendor using the Mail triggering configuration settings but meassage output do not create.
    Please tell me how can I do.
    Thank,

  • Print normal invoice and send invoice as pdf to creator of invoice

    Hello to all,
    this is my first post in this big, special and great community. 
    Many thanks to all people in background for realizing and customizing !
    I have a request to print the normal invoice and to send the invoice as pdf copy to the creator of the invoice at the same time.
    Using include RVADOPFO and medium 5 would be the correct solution, if I could use the email field in customer master data entering the mail adress of the creator.
    But it is not possible, the field is used otherwise.
    Can anybody help me to solve the problem ?
    Thanks in advance and regards
    Claus

    Hi,
    One Print Program is sufficient to generate the Print invoice and send the Invoices as PDF to  customer.
    In the NACE transaction code , In the OUTPUT TYPE define a output with the  Transaction medium as 1 & 5
    In the CONDITION RECORDS in VV33 also maintain the MEDIUM as 1 and 5
    Alternatively you can you one program to generate the PDF and save to your LOCAL file and send to customer
    The PROGRAM to generate the PDF is  RSTXPDFT4
    Please check them and let us know your feedback
    regards,
    santosh

  • Send Invoices/Billing Doc by Email not displaying:Urgent help

    Dear SD Guru's
    I have a problem where I am trying to send my billing documents by email. When I use the output type Mail and Medium 7, Program:RSNASTSO, Form Routine:SAPOFFICE_AUFRUF_VX and I assigned a form which was designed by one of our abaper's. The result is the when I sent the billing document, its is sent to the mailbox but the billing document which will now be a PDF file does not open. What could be the problem??
    On the other hane if we use medium 5 External Send, the mail it is not sent, it remains in status WAITING, and remains in transit in SCOT.
    I urgently need to your help, as this functionality is now overdue.

    Hie Vee
    I have checked T-code NACE and taken a look at the table you said I should check, I actually noticed that the table is updated by the fields you input into NACE fields.
    I am so stuck, but maybe you could just check for for your output type, the Medium, Program and Form routine you are using unless thay are all non standard. But the norm is you add Z to the standard so maybe the letters after the Z could give me a hint.
    Plizzzzzzzzz!!!

  • How to add body text when sending output as PDF in email?

    Hello,
    We are using standard SAP to send SD output as PDF in an email (in output type we choose medium 5, email address is taken from customer master. In transaction SCOT is indicated that SAPscript/smartforms are converted to PDF. When the output is generated, we run rsconn01 to trigger the actual sending of the email).
    Via form TEXT_SYMBOL_REPLACE we can modify the subject of the email that is send to include e.g. the order number. HOWEVER, in the body of the email that is send, we now only have the PDF, but we also would like to add a standard text in the body of the email. Does anyone know how to do this?
    Thanks,
    Alex

    Hi,
    Please refer to the following program and see if it helps you.
    REPORT ZSAMPL_001 .
    INCLUDE ZINCLUDE_01.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    *file_open_error = 1
    *file_read_error = 2
    *no_batch = 3
    *gui_refuse_filetransfer = 4
    *invalid_type = 5
    *no_authority = 6
    *unknown_error = 7
    *bad_data_format = 8
    *header_not_allowed = 9
    *separator_not_allowed = 10
    *header_too_long = 11
    *unknown_dp_error = 12
    *access_denied = 13
    *dp_out_of_memory = 14
    *disk_full = 15
    *dp_timeout = 16
    *OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    ***INCLUDE ZINCLUDE_01 .
    10.08.2005 Amit M - Created
    Include For Mail (First Req F16)
    Modification Log
    Data
    tables crmrfcpar.
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    data v_rfcdest LIKE crmrfcpar-rfcdest.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    receivers = reclist
    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
    IF sy-subrc <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    FORM
    FORM ml_saveforbp USING jobname jobcount.
    Data
    *data : yhead like yhrt_bp_head.
    *DATA : ydocdata LIKE yhrt_bp_docdata,
    *yobjtxt LIKE yhrt_bp_objtxt OCCURS 0 WITH HEADER LINE,
    *yreclist LIKE yhrt_bp_reclist OCCURS 0 WITH HEADER LINE.
    *DATA : seqnr TYPE i.
    Head
    *yhead-jobname = jobname.
    *yhead-jobcount = jobcount..
    *MODIFY yhrt_bp_head FROM yhead.
    Doc Data
    *ydocdata-jobname = jobname.
    *ydocdata-jobcount = jobcount.
    *MOVE-CORRESPONDING docdata TO ydocdata.
    *MODIFY yhrt_bp_docdata FROM ydocdata.
    Objtxt
    *seqnr = 0.
    *LOOP AT objtxt.
    *seqnr = seqnr + 1.
    *yobjtxt-jobname = jobname.
    *yobjtxt-jobcount = jobcount.
    *yobjtxt-seqnr = seqnr.
    *MOVE-CORRESPONDING objtxt TO yobjtxt.
    *MODIFY yhrt_bp_objtxt FROM yobjtxt.
    *ENDLOOP.
    RecList
    *seqnr = 0.
    *LOOP AT reclist.
    *seqnr = seqnr + 1.
    *yreclist-jobname = jobname.
    *yreclist-jobcount = jobcount.
    *yreclist-seqnr = seqnr.
    *MOVE-CORRESPONDING reclist TO yreclist.
    *MODIFY yhrt_bp_reclist FROM yreclist.
    *ENDLOOP.
    ENDFORM. "ml_saveforbp
    FORM
    FORM ml_fetchfrombp USING jobname jobcount.
    *CLEAR docdata.
    *REFRESH objtxt.
    *REFRESH reclist.
    *SELECT SINGLE * FROM yhrt_bp_docdata
    *INTO corresponding fields of docdata
    *WHERE jobname = jobname
    *AND jobcount = jobcount.
    *SELECT * FROM yhrt_bp_objtxt
    *INTO corresponding fields of TABLE objtxt
    *WHERE jobname = jobname
    *AND jobcount = jobcount
    *ORDER BY seqnr.
    *SELECT * FROM yhrt_bp_reclist
    *INTO corresponding fields of TABLE reclist
    *WHERE jobname = jobname
    *AND jobcount = jobcount
    *ORDER BY seqnr.
    ENDFORM. "ml_fetchfrombp
    Hope this helps.
    Please reward some points if it helps.
    Regards,
    Amit Mishra

  • Sending SAPSCRIPT in PDF through email

    Hi everybody,
    I'm trying to send via email a sapscript. I red more posts regarding this issue but nothing seems to run correctly.
    Some posts refers to a sample program ZRICH_0003.
    I've just copied the code and replaced the form's name with one of mine and run it.
    The function SO_NEW_DOCUMENT_ATT_SEND_API1 return with error code 2 (document not sent). I really don't know why. I've just run it in two different SAP (4.7 and 5.0)
    Both didn't work. Both systems are UNIX. Must I do something in customizing or some RFC definition?
    Is there anybody that have a simple program that uses this function? 
    Thanks in advance
    Fabrizio

    i have tried the same thing. first generating spool & then convering sppol to PDF.
    REPORT  ZPO_PDF NO STANDARD PAGE HEADING
      LINE-SIZE 254.
    converts list to PDF - send via mail as attachment
    TABLES: adrp,  "Persons (central address administration)
            bhdgd, "Common data area batch heading routine
            bsik,  "Accounting: Secondary Index for Vendors
            usr21. "Assign user name address key
    General data definition
    TYPE-POOLS: icon.
    TYPE-POOLS: slis.
    DATA: d_linsz            LIKE sy-linsz.
    Constants
    CONSTANTS: c_yes(1)        TYPE c VALUE 'X'.
    Structures
    DATA: e_variant  TYPE disvariant.
    Selection-screen
      DATA: le_parameters LIKE pri_params.
      DATA: l_valid(1) TYPE c.
      DATA: lt_pdf TYPE TABLE OF tline WITH HEADER LINE.
      DATA: l_spool_c LIKE tsp01_sp0r-rqid_char.
      DATA: l_spool_i LIKE tsp01-rqident,
            _RECEIVER LIKE bsik-xref3.
    Get the SPOOL number
    PARAMETERS:
      spoolno LIKE TSP01-RQIDENT.
      l_spool_i =  spoolno.
    DATA: NUMBYTES TYPE I,
          ARC_IDX LIKE TOA_DARA,
          pdfspoolid like tsp01-rqident,
          jobname like tbtcjob-jobname,
          jobcount like tbtcjob-jobcount,
          is_otf.
    DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            SRC_SPOOLID                    = l_spool_i
            NO_DIALOG                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
          IMPORTING
            PDF_BYTECOUNT                  = numbytes
            PDF_SPOOLID                    = pdfspoolid
          OTF_PAGECOUNT                  =
            BTC_JOBNAME                    = jobname
            BTC_JOBCOUNT                   = jobcount
          TABLES
            PDF                            = lt_pdf
          EXCEPTIONS
            ERR_NO_OTF_SPOOLJOB            = 1
            ERR_NO_SPOOLJOB                = 2
            ERR_NO_PERMISSION              = 3
            ERR_CONV_NOT_POSSIBLE          = 4
            ERR_BAD_DSTDEVICE              = 5
            USER_CANCELLED                 = 6
            ERR_SPOOLERROR                 = 7
            ERR_TEMSEERROR                 = 8
            ERR_BTCJOB_OPEN_FAILED         = 9
            ERR_BTCJOB_SUBMIT_FAILED       = 10
            ERR_BTCJOB_CLOSE_FAILED        = 11.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Build the mail
      PERFORM build_mail
        TABLES lt_pdf
        USING _receiver.
    FORM prepare_print_format USING parameters LIKE priparams.
      DATA: BEGIN OF lt_report_source OCCURS 0,
              line(72) TYPE c,
            END OF lt_report_source.
      DATA: l_string_linsz TYPE string.
      DATA: l_tabix LIKE sy-tabix.
      DATA: BEGIN OF lt_sentencia OCCURS 0,
              line(72) TYPE c,
            END OF lt_sentencia.
      DATA: lt_tsp1d TYPE TABLE OF tsp1d WITH HEADER LINE.
      READ REPORT sy-repid INTO lt_report_source.
      CHECK sy-subrc = 0.
      CLEAR: l_tabix.
      WHILE NOT l_string_linsz CS '.'.
        ADD 1 TO l_tabix.
        READ TABLE lt_report_source
          INDEX l_tabix.
        TRANSLATE lt_report_source-line TO UPPER CASE.
        IF l_string_linsz CS 'REPORT'
          OR lt_report_source-line CS 'REPORT'.
          CONCATENATE l_string_linsz
                      lt_report_source-line
            INTO l_string_linsz
            SEPARATED BY space.
          CONDENSE l_string_linsz.
        ENDIF.
      ENDWHILE.
      TRANSLATE l_string_linsz USING '. '.
      CLEAR: lt_report_source.
      REFRESH: lt_report_source.
      FREE: lt_report_source.
      SPLIT l_string_linsz AT space INTO TABLE lt_sentencia.
      LOOP AT lt_sentencia
        WHERE line CS 'LINE-SIZE'.
        l_tabix = sy-tabix.
        EXIT.
      ENDLOOP.
      ADD 1 TO l_tabix.
      READ TABLE lt_sentencia
        INDEX l_tabix.
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE lt_tsp1d
        FROM tsp1d
        WHERE type = 'L'
          AND outcolumns >= lt_sentencia-line.
      SORT lt_tsp1d
        BY outcolumns.
      READ TABLE lt_tsp1d
        INDEX 1.
      parameters-linct = lttsp1d-outrows.
      parameters-linsz = ltsentencia-line.
      parameters-paart = lttsp1d-papart.
    ENDFORM.                    " prepare_print_format
    FORM build_mail     TABLES tpdf STRUCTURE tline
                        USING _receiver TYPE c.
      DATA: l_length_t_pdf TYPE i.
      DATA: l_string TYPE xstring.
      DATA: l_string_bck TYPE string.
      DATA: l_length_string TYPE i.
      DATA: l_length_objbin TYPE i.
      DATA: l_max_tabix TYPE i.
      DATA: l_dif TYPE i.
      DATA: l_hex_null TYPE x VALUE '00'.
      DATA: lt_objtxt           LIKE solisti1   OCCURS 10 WITH HEADER LINE.
      DATA: l_tab_lines         LIKE sy-tabix.
      DATA: le_doc_chng         LIKE sodocchgi1.
      DATA: lt_objpack          LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: lt_objhead          LIKE solisti1   OCCURS 1 WITH HEADER LINE.
      DATA: lt_reclist          LIKE somlreci1  OCCURS 5 WITH HEADER LINE.
      DATA: lt_contents_bin     LIKE solisti1   OCCURS 0 WITH HEADER LINE.
    Mail text
    (...here you should fill table lt_objtxt-line)
      lt_objtxt-line = 'First line of text'.
      append lt_objtxt.
      lt_objtxt-line = 'Second line'.
      append lt_objtxt.
      DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
      READ TABLE lt_objtxt INDEX l_tab_lines.
      le_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255
                             + STRLEN( lt_objtxt ).
      le_doc_chng-obj_descr = 'PO in PDF By mail'.
      CLEAR lt_objpack-transf_bin.
      lt_objpack-head_start = 1.
      lt_objpack-head_num   = 0.
      lt_objpack-body_start = 1.
      lt_objpack-body_num   = l_tab_lines.
      lt_objpack-doc_type   = 'RAW'.
      APPEND lt_objpack.
    Attached file, in PDF-format
      DESCRIBE FIELD tpdf LENGTH l_length_t_pdf.
      CLEAR: l_string_bck,
             l_string.
      LOOP AT tpdf.
        CONCATENATE l_string_bck tpdf INTO l_string_bck.
        l_dif = l_length_t_pdf - STRLEN( tpdf ).
        DO l_dif TIMES.
          CONCATENATE l_string_bck l_hex_null INTO l_string_bck.
        ENDDO.
        CONCATENATE l_string tpdf INTO l_string.
      ENDLOOP.
      sy-subrc = 0.
      WHILE sy-subrc = 0.
        REPLACE l_hex_null WITH space INTO l_string_bck.
      ENDWHILE.
      l_length_string = strlen( l_string_bck ).
      DESCRIBE FIELD lt_contents_bin LENGTH l_length_objbin.
      l_max_tabix = ceil( l_length_string / l_length_objbin * '1.0' ).
      DO l_max_tabix TIMES.
        lt_contents_bin = l_string_bck.
        APPEND lt_contents_bin.
        IF sy-tabix <> l_max_tabix.
          l_string_bck = l_string_bck+l_length_objbin.
        ENDIF.
      ENDDO.
      DESCRIBE TABLE lt_contents_bin LINES l_tab_lines.
      APPEND lt_objhead.
      lt_objpack-transf_bin = c_yes.
      lt_objpack-head_start = 1.
      lt_objpack-head_num   = 1.
      lt_objpack-body_start = 1.
      lt_objpack-body_num   = l_tab_lines.
      lt_objpack-doc_type   = 'PDF'.
      lt_objpack-doc_size   = ( l_tab_lines - 1 ) * 255.
      LOOP AT lt_contents_bin.
      ENDLOOP.
      lt_objpack-doc_size = lt_objpack-doc_size + STRLEN( lt_contents_bin ).
      APPEND lt_objpack.
    lt_reclist-receiver = 'testmailgmail.com'.
      lt_reclist-rec_type = 'U'.
      APPEND lt_reclist.
    Finally! we send the mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data                    = le_doc_chng
          put_in_outbox                    = c_yes
        TABLES
          packing_list                     = lt_objpack
          object_header                    = lt_objhead
          contents_bin                     = lt_contents_bin
         contents_hex                     =
          contents_txt                     = lt_objtxt
          receivers                        = lt_reclist
        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.
    ENDFORM.                    " build_mail

  • ZERS - Invoice as PDF and Email

    Hello,
    We have created a new Output Type ZERS copied from ERS. And created a new SAPScript ZERS_PRINT which is agained copied from MR_PRINT and Print Program ZMR_PRINT. Whenever MRRL is run, it's creating the invoice output Spool. Now, the users want to covert the Spool to PDF and then email. Can anybody please let me know if you have done that similar functionality or how can I do this?
    Where in the Print Program I can write my custom code?
    Thanks a lot for the help.

    Thanks Karthik,
    Like I mentioned, we have copied the standard print program into a Z-print program. And in FM "MRM_ENTRY_ERS", I do see FM "OPEN_FORM". And in the parameter structure "ITCPO" we have option for "TDGETOTF". My question is  how to set this flag?
    Do I need to go in Change mode for FM "MRM_ENTRY_ERS"? Please let me know.
    Or Should I copy this FM into a Z- FM? Can anybody please let me know.
    Thanks a lot for the help.
    Edited by: lope jie on Apr 30, 2010 8:30 PM

  • Mail Invoice in PDF as Email using Workflow

    Dear all,
    We are having a requirement to mail the invoice to the customer using worflow.
    The workflow has to execute on a certain date and mail should be sent to Customer which will have invoice as attachment in PDF form. Everything shld happen automatically.
    Is there any standard workflow available for this ?
    Is it possible to have a direct link with message type config in NACE ?
    Thanks in Advance.
    Regards,
    Vivek

    In NACE, in the FORM routine convert the Smartform or SapScript form to PDF and use the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send this file as an attachment to the required receipient.

  • Smartform how to send invoice as pdf to the spool

    I have a relatively standard invoice smartform. I want to place the output (in case of a certain output type) as a PDF in the spool as a spoolrequest.
    How can i arrange that.
    and second i want to email this request to the emailadress mentioned in the own data of the user whose printing this.
    Can someone help me??
    Regards, Frankl

    Hi,
    Please check below one
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/smartform%2bto%2bmail%2bas%2bpdf%2battachment
    Regards
    Jana

  • Send invoice document to multiple email ids

    Hi Experts,
    I wnat to email the invoice generated through tcode VF03 to multiple email ids.
    As per standard, only one email id is active . So please suggest some solution.
    Thanks in advance

    Hi,
    Create the distribution list and maintain the email ids in that.
    T.code : SO23 - to create a distribution list.
    And fuctional consultant that whether they can assign this distriution list in SRO to get the all email ids or u may have to write code in user exit.
    Thanks.
    Balu

  • It possible to send a copy of invoice as pdf files to sales agents bye-mail

    Hi All,
    Please let me know, is it possible to send a copy of invoice as pdf files to sales agents by e-mail triggered by the invoicing or is it only possible manually through ZPDF.
    If Possible please let know how to achieve it.
    Aditya

    Hi Adi,
    Go through the link given below, Hope it helps.
    Sending Invoice as PDF in email
    http://wiki.sdn.sap.com/wiki/display/Snippets/Smartform%2bto%2bMail%2bas%2bPDF%2battachment
    Also go through the notes given below
    Note 454893 - CHECKLISTSD: Sales document output as an e-mail
    Note 753622 - Sending of body text and PDF attachment with medium 5
    Note 960088 - FAQ: Sending SD messages externally
    Regards,
    MT

  • Sending documents as attachments via email

    Hi,
    I have a selection screen with purchase order number as "select-options" and 2 radio buttons one for downloading and opening the SAP Script output to the local file and the other raido button would convert the SAP Script output into .pdf file and send that file as an attachment via e-mail to the receipent(only one).
    I'm through with the first operation. Now need to know about the e-mailing procedure and the function module(s) to be used and their import, export, etc. parameters.
    Thanks & Regards,
    Rajesh

    Hi Rajesh,
    You can use standard SAP program <b>RSTXPDFT4</b> to convert SAPSript spools request to PDF.
    Also please check this link for sample code to sending an attachment (PDF) via email:
    http://www.sapgenie.com/abap/code/abap31.htm
    Hope this will help.
    Regards,
    Ferry Lianto

  • Attach page content as pdf in email

    Thanks for all who answer this thread.
    I am using this syntax to send email from a web page....
    <cfset subject = "Application Name">
    <a
    href="mailto:?subject=#urlEncodedFormat(e_subject)#">Email
    page</a>
    i know, how to create page content in pdf...
    How can i attach page content pdf to this mail? is that
    possible?.
    OR
    what is best way to send page content PDF as email.....
    user want to type some info in body of email.....
    thanks

    Use cfsavecontent to generate your page content.
    Use cfdocument to create the pdf file
    Use cfmail and cfmailparam to send it as an email
    attachment.

Maybe you are looking for

  • Interactive report URL syntax

    Hi I'm using Apex 3.1.2, and am fairly new to using Interactive reports. I've found the URL syntax to apply a filter on an IR, and was just wondering if it is possible to apply a sort, or even open a saved report from a URL link? I am well aware that

  • File processing...  first time.

    I am taking my program step by step.. this is the first day i learned about tokenizing and file input.. public class nameSearchEngine {      public static void main(String[]args) throws FileNotFoundException {                System.out.println("Type

  • Adobe reader installation

    I am trying to re-install adobe reader x after uninstalling from control panel in windows 7. But the setup fails stating that there is a more functional product already installed.

  • IPS 5.1(3) never-block-networks not working

    Our Cisco IDS 4200 appliances have been converted from 4.1(x) to 5.1(3) with latest signature S252. I'm going through fine-tuning and enabling countermeasures step-by-step. One thing I noticed is that even though a never-block-host for our /19 CIDR i

  • Entry aids for items without material master

    Hi All Can someone remind me.... I want to default G/L accounts directly into the purchase order non-material master line items based upon the material group. I have added specific valuation types to the entry aid config table in purchasing but now c