Sending invoice as attachment

HI ,
I am working on invoice approval workflow as when new invoice is created then it should go to sales dept. for approval and once they  approve it then it should be forwaded to customer.
But the problem is that i have to send invoice as attachment to sales dept. using workflows for approval. I dont know how to send it as attachment using workflows as their is nothing in output message for invoice bcoz that will come once it is approved from sales dept.
please help me on this.
Thanks,
rahul

Hi
U can also create a custom method in your Business Object and in that u can use the Function Module 'SO_NEW_DOCUMENT_ATT_SEND_API1'  to send the email with an attachment.
Please google to find examples as to how to use the above FM.
Check this link as well
http://www.sap-img.com/fu016.htm
Regards
Neeraj

Similar Messages

  • Sending INVOICE as attachment in PDF for  external Mail address

    HI!,
    We have made configuraiton for sendin mail while saving VF01 or VF02 from SAP R/3 to external id.
    Email is going to the partner Payer but the attachment of the invocie is going as OTF format and not in PDF.
    Where i am missing. I have gone thro the discussion thread of srinivas talks about some coding required in Program which what is that
    thanks in advance

    Hi,
    Check this program.
    Re: send a mail thro abap report  
    Posted: Mar 14, 2006 11:40 AM      Reply      E-mail this post 
    hi,
    the below program will help you to send email with any kind of attachment.It is working fine for me.Just try it.
    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.
    *PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
    DATA : pos TYPE i.
    DATA : len TYPE i.
    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.
    *file_name = appfn.
    *OPEN DATASET appfn FOR INPUT IN BINARY MODE.
    *DO.
    READ DATASET appfn INTO ITAB.
    IF SY-SUBRC EQ 0.
    *APPEND ITAB.
    ELSE.
    *APPEND ITAB.
    EXIT.
    ENDIF.
    *ENDDO.
    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 .
    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.
    SELECT SINGLE * FROM crmrfcpar WHERE consumer = 'CRM'.
    v_rfcdest = crmrfcpar-rfcdest.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' DESTINATION v_rfcdest
    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
    -suresh

  • How To Send Invoice List as attachment in User Decision Step?

    HI All,
    I have developed a workflow in which there is one ZMETHOD in which i will get the list of invoices.and that i want to send it as attachment to User Decision Step.
    How to do this?
    Regards,
    Arpita

    If your users will have access to MIR4, why not just bind the business object BUS2081 as an adhoc object into your decision step?  That would solve everything pretty nicely, I think. 
    Regards,
    Sue

  • 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

  • Sending PDF output attachment in e-mail to external users from BSP

    Hi All,
    Please gothrough the below requirement details :
    Requirement Details:
    Need to achieve the functionality of sending a PDF attachment of invoice to an external
    e-mail address from the BSP Application.
    Implementation Details:
    The Print out Output determination is already done in the system. We are using SAP R/3 4.7 (620)
    In the Transaction VF03 in the initial screen there is a menubar "Billing document" and underneath that menu there is a menu item called "Issue". If we click the "Issue" menu item all the output that are already proposed will be visible and we can select the printout Output determination and can issue a printout.
    I had created a FM to call from BSP and that function module will take the Invoice number as input and will call the "VF03" transaction using BDC and will trigger the Sapscript Printout . I see the the sapscript in the spool after I call the Function module .
    But I don't know how I can get the Spool request number for that Function module call from BSP page ????
    I got struck in this approach...
    If I know the Spool number after calling the function module the it's very easy to call the following FM's for sending a e-mail with the Invoice PDF attachment.
    CONVERT_OTFSPOOLJOB_2_PDF
    QCE1_CONVERT
    SO_NEW_DOCUMENT_ATT_SEND_API1
    Please let me know if anyone can help me in this ...
    Please reply ASAP.
    Thanks,
    Greetson

    Check out these weblogs.
    /people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Regards
    Raja

  • Automate Sending Email with Attachment

    Hello, I want to know if there is a way to automate sending invoices using Automator considering the following workflow.
    Print Invoice from local / network connected windows computer
    Scan Printed Invoice on a separate Web-Connected Mac
    Place Invoices in folder with the following Hierarchy
    Documents Folder
    Year
    Month / Day
    Manually rename Invoices (Invoices with more than one page / more than one TIFF file (1 per page) are named INVOICE# (2))
    Reference scanned Invoice for Email address
    Manually compose emails and add attachments
    Is it possible to use this workflow using automator?
    THANKS FOR ALL THE HELP! I do this at least 50 times daily and it's time consuming...

    The New Mail Message action will attach files sent to it, so you can use that and a Send Outgoing Messages action in a workflow saved as a folder action plug in. The plug in will send the files added to a folder to your workflow, so all you need to do next is configure folder actions to attach the plug in to your certain folder.

  • 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 &amp; 3 , how do I select the email add 1, 2 &amp; 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

  • How do I send invoices to a different account?

    Hi, how do I forward invoice emails to my accountant without changing our primary account email?

    You can not send invoice to other Email by itself as the invoice can be generated & printed from the Email ID it has been purchased & registered.
    Regrads
    Rajshree

  • How can I have a newsletter I created in PDF appear in the body of an email I send, rather than attach it.

    How can I get a newsletter created in PDF format to appear in the body of an email I send, rather than attach it.

    You cannot. (A few email programs might show it automatically; you cannot stop that either).

  • Error while trying send emai with attachment

    Hello,
    I am facing an error while trying to send email with attachment (spreadsheet).
    Error is:  "Error in calling 'SBCOMS_SEND_REQUEST_CREATE'   in  'SO_DOCUMENT_SEND_API1' with Sy-subcr = 1".
    Do I need to configure the sender email address or some configuration at the sender system?
    I followed the example given in the below link.
    http://wiki.sdn.sap.com/wiki/display/ABAP/HowtowriteanABAPProgramtoplaceanExcelfileinapathandsenditasan+Attachment
    Could you please help on this?
    Thanks & regards,
    Ravish

    Hi Ravish,
    sure you can create local excel using [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf], load as binary and attach.
    More elegant, future-oriented and advanced is the [excel-from-scratch-approach abap2xlsx by Ivan Femia|http://wiki.sdn.sap.com/wiki/display/ABAP/abap2xlsx]
    Regards,
    Clemens

  • How to populate a table by sending a csv attachment to a particular mail id

    Hi Experts,
    I have to populate a table in the database by sending a csv attachment to a particular mail id.
    Eg:
    I have a table , test
    with fields: name, designation, address
    and i am sending a csv attachemnt with the values , name, designation, address to a generic email id say : [email protected]
    my table -test should be populated automatically with the values from the attached csv.
    Any idea how this can be achieved ?
    Regards,
    Archana

    Hi,
    Why cant you try uploading the data in your csv file to your table by using external table concepts? This would help you much i beleive.
      CREATE TABLE "EXT_EMP_TEST"
       (     "EMPNO" NUMBER,
         "EMPNAME" VARCHAR2(20 BYTE),
         "JOB" VARCHAR2(20 BYTE)
       ORGANIZATION EXTERNAL
        ( TYPE ORACLE_LOADER
          DEFAULT DIRECTORY "DUMP_DIR"
          ACCESS PARAMETERS
          ( RECORDS DELIMITED BY NEWLINE
               BADFILE 'emp.bad'
                          LOGFILE 't.log_xt'               
                          FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ' " ' LDRTRIM
                          REJECT ROWS WITH ALL NULL FIELDS
                "EMPNO",
              "EMPNAME",
              "JOB"                                                                         
          LOCATION
           ( 'emp_det.dat'
       REJECT LIMIT UNLIMITED;
    {code}
    In the above code, default directory is the place where the file resides in your server. So before creating an external table you need to follow the below steps,
    1. Create a default directory.
    2. Place your file into that directory.
    3. Create an external table using the above script.
    4. Just execute the simple select statement upon that external table, {code} select * from EXT_EMP_TEST {code}
    *NOTE: In the above exaple i have used .dat file to load the data, you need to specify .csv over there*
    Regards,
    Sakthi.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Sending Mail with attachment like User Decision

    Hi,
    Is there any way to send the document attached with the send mail step ? In User Decision, we can use binding between the workflow and task and document is attached. Like wise, is there any method ??
    I know we can send the attachment using the FM SO_****. So don give that answers. I want to know without using the FM, is it possible or not ?
    And i don want to use BO SOFM.
    For example, in Project Definition, one person creates a milestone. WF is triggered and goes for attachment of concorrence note. One attaches the concorrence note and mail is send to initiator. In that mail, can he able to see the attachment ??

    As far as I know the answer is "probably". You aren't saying how the mail is sent to initiator, you just say you don't want to use the FM or the BOR object type SOFM. I assume you are using the standard sendmail step type, i.e. BOR object type SELFITEM with method SendTaskDescription.
    As I am sure you can imagine, an attachment doesn't magically appear. If you send a workflow step (task) to someone, you can bind attachments to make them available in work item display. If you send a message you can construct it with attachments, but that doesn't happen without any effort. If you look at the parameters for SendTaskDescription you will see that there is a parameter for attachments. Try passing (binding) a value to it. If your SendMail task doesn't include that parameter as importing parameter you will of course have to fix your task (TS object) first.

  • Sending Mail with attachment and preserving the order of attachment

    Hi Everyone!!!!!!
    My requirement is to send Email with attachment in the same order as they were attached by Sender while composing the mail. I want to preserve order of attachment in the mail and when receiver open a mail, the attached files should be reflected in same order as it was on sender side. In my application,the documents being upload are already in my database. So, user just requires to mark the corresponding check box and enter the Sequence number for each attachment. When he clicks on "SEND" button, the Source file is first written from database to OS level and then files are attached from source available on OS . The attached file name could be anything. Based on the Sequence number file should be attached and send. My current code works fine,but problem it is that the Sequence number is not preserved in my attachment . However, when I traced the output of FOR Loop by inserting it in a table " temp_trace" I found that the Sequence is preserved in the order that I want. So, I think that uploaded files are written on the Operating system in same order but they are not attached in same order. Below is the sample code that is I am using to attach file in email. Here, the user_sequence is the sequence number entered by user.
    for i in (select case when user_sequence is not null
    then trim(to_char(user_sequence ,'09'))||'_'||file_name||'.pdf'
    else ||'_'||file_name||'.pdf' end file_name ,
    file_src,length(file_src) len,cd.doc_id,PRIORITY from
    MIM_CLIENT_DOCS CD,(select DOC_ID ,user_sequence from table P_DOC_AND_user_sequence ) TEMP_TAB
    WHERE CD.DOC_ID = TEMP_TAB.DOC_ID order by case when user_sequence is null then 1 else 0 end, file_name)
    loop
    insert into temp_trace values(i.file_name);
    L_OUT := UTL_FILE.FOPEN(v_oracle_dir,i.file_name,'wb',32760);
    end loop;
    I want my output as
    1_first attachment.txt
    2_second_attachment.docx
    3_abc.sql
    _xxx.txt  ------------------ When sequence is not assigned by user That is null at last.
    Unfortunately, I am not getting attachment in mail in this sequence. Can anyone give me suggestion.
    Sorry for stuff essay and thanks in advance!!!!!!!!!!!

    >
    Please update your forum profile with a real handle instead of "974850".
    My requirement is to send Email with attachment in the same order as they were attached by Sender while composing the mail. I want to preserve order of attachment in the mail and when receiver open a mail, the attached files should be reflected in same order as it was on sender side. In my application,the documents being upload are already in my database. So, user just requires to mark the corresponding check box and enter the Sequence number for each attachment. When he clicks on "SEND" button, the Source file is first written from database to OS level and then files are attached from source available on OS . The attached file name could be anything. Based on the Sequence number file should be attached and send. My current code works fine,but problem it is that the Sequence number is not preserved in my attachment . However, when I traced the output of FOR Loop by inserting it in a table " temp_trace" I found that the Sequence is preserved in the order that I want. So, I think that uploaded files are written on the Operating system in same order but they are not attached in same order. Below is the sample code that is I am using to attach file in email. Here, the user_sequence is the sequence number entered by user.Always post code using <tt>\...\</tt> tags as described in the FAQ.
    for i in (select case when  user_sequence is not null
    then trim(to_char(user_sequence ,'09'))||'_'||file_name||'.pdf'
    else  ||'_'||file_name||'.pdf' end file_name ,
    file_src,length(file_src) len,cd.doc_id,PRIORITY from
    MIM_CLIENT_DOCS CD,(select DOC_ID ,user_sequence from table P_DOC_AND_user_sequence ) TEMP_TAB
    WHERE CD.DOC_ID = TEMP_TAB.DOC_ID order by case when user_sequence is null then 1 else 0 end, file_name)                               
    loop
    insert into temp_trace values(i.file_name);
    L_OUT := UTL_FILE.FOPEN(v_oracle_dir,i.file_name,'wb',32760);
    end loop;I want my output as
    1_first attachment.txt
    2_second_attachment.docx
    3_abc.sql
    _xxx.txt  ------------------ When sequence is not assigned by user That is null at last.
    Unfortunately, I am not getting attachment in mail in this sequence. Can anyone give me suggestion.I see no code that attaches anything to email messages. What code is used to do this? Why are the files being written to the file system?

  • Sending Mail with attachment from WD

    Hi all,
    I wan't to send an email from webdynpro with an attached pdf-document. I had a look at Tutorial 31, but i will only use the first part, sending email with attached interactive form. So I decided to build a new project. I did everything as in the tutorial described, but when entering the following code into the wdDoInit method from the SendView an error occurs.
    //@@begin wdDoInit()
         //     @TODO Enter your email address for the setFrom and setTo methods by replacing the text in angle brackets.
         wdContext.currentEmailElement().setFrom("[email protected]");
         wdContext.currentEmailElement().setTo("[email protected]");
         wdContext.currentEmailElement().setCc("");
         wdContext.currentEmailElement().setBcc("");
         wdContext.currentEmailElement().setSubject("Travel Request Form");
         wdContext.currentEmailElement().setBody("BlaBlaBla");   
        //@@end
    In the coding is no error. In the Context node of the SendView I created a new value node with the value attributes. When writing the code and using strg+space i can complete automatically, so no writing errors.
    When deploying and running the application I get always a NullPointerException, if make no difference if i delete one entry or which line of code i insert, the same error.
    java.lang.NullPointerException
         at com.ao.test.emailtest.SendView.wdDoInit(SendView.java:99)
         at com.ao.test.emailtest.wdp.InternalSendView.wdDoInit(InternalSendView.java:127)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:274)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
    I've compared my project with the one from tutorial but i found no differences.
    Have anybody have an idea what to do?
    Thanks
    Mathias

    Hi,
    NullpOinter excepttion could be bcose of "currentEmailElement()".
    Please create an element of EmailNode before these statements.
    IPrivate<ViewName>.IEmailElement ele=wdContext.createEmailElement();
    wdContext.NodeEmail().addElement(ele);
    You can use the following for sending attachments :
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText(Attachment);
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(Attachment);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(Attachment);
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    Regards, Anilkumar
    Message was edited by: Anilkumar Vippagunta

  • Sending mail with attachment and body.

    Hi Experts,
    I have a requirement of sending a mail with an attachment and also the mail will have a body whose content will be same as that in the attachment.Subject of the mail will also be configured dynamically.Though I am able to send the mail with the attachment but I am not able to configure the body whose content will be same as that of the attachment.
    I have unchecked the "Use Mail Package" and has hard-coded the "TO","From" field for sending the mail with attachment.
    Can you please check and let me know how to configure the body which will be same as that of the attachment.
    Thanks and Regards
    Atanu Mazumdar

    Hi,
    Use MTB module and then one of the parameter which can allow you to send message in attachment as well as in message body.
    Transform.ContentDisposition: it helps us to decide if we want to send the payload as an attachment or in the message body. If we give the Parameter value as u201Cattachmentu201D then we will have the payload attached in the mail and if we assign this value as u201Cinlineu201D the payload will go in the mail body.
    Hope this helps you..
    Regards....

Maybe you are looking for

  • Print to pdf

    I am sorta new to Mac.  On my old Windows PC I could Print to a PDF in addition to a normal printer.  How do I set it up to do the same thing on a Mac?  It only allows me to save as instead of printing to. Thanks in advance.

  • Integration between Oracle BPM and Oracle UCM

    Hi I have a requirement how to integarte between Oracle BPM and Oracle UCM. Detailsabout the problem: Once user start the process and want to upload the document in the same process, the document should be uploaded into UCM and similarly user wants t

  • Need simple directions for backing up manually

    In preparation for upgrading to Leopard, I am in the process of doing a really good backup of all the important things on my hd. I am backing up to an external hd, but for the moment I am doing it manually, not wanting to use backup software. (I will

  • Creating a website in illustrator

    I'm pretty new to the world of web design and I'm seeking your help. I've created a pretty good looking site in Illustrator and I want to know how to convert that to an HTML file or if this is even possible. I've spent a considerable amount of time o

  • ITunes 5 audio loss  (loss of sound/intruments)

    Since upgrading to iTunes 5 I've noticed many, many songs in my collection have missing sounds.. For example: Monday by Wilco (from the Being There CD) has a horn section track for most of the song. When I play the song, the horns aren't there.... ju