Send Order confirmation form as PDF in email on Order Save on webchannel

Hello,
I am developing a smartform for Purchase Order in CRM. When end user will save order on Internal sales webchhanel , order confirmation mail shoud be triggered to customer with smartform in PDF format.
I want to know how can I pass values from Order saved on webchannel to my smartform and send as PDF in mail attachment?
Thanks & Regards,
Madhura Nadgauda

Hello Madhura ,
Are you planning on sending the email on order create? Maybe you can use the order create FM ?
regards
Mark

Similar Messages

  • SAP forms to pdf and email

    I need to email sales orders as PDF files.  Is there a fairly easy way to do this?  I have the "SAP" email function working,  Just need to send the form as PDF instead of JPG.
    Thanx,
    Tim Pope

    Hi Tim,
    In the 2007A version, the PDF format will be available in the standard email function. I had heard a rumour that they would release the same functionality in the 2005A SP1 enhancement pack that has just been released but I cannot see it in the documentation.
    Other options are to use a third-party report writer or add-on (Third Wave make a Crystal-based add-on that should have the functionality you need). The ALD might also be capable of exporting and emailing in PDF format. Your final option is to write your own add-on and use the PrintEvent to capture the data from the sales order in XML format and convert it into PDF (search the forum as I'm sure I saw posts about available APIs that can do this).
    Kind Regards,
    Owen

  • Is it possible send several interactives forms in one only email?

    Hi again experts!
    I would like to know if is it possible attach many interactives forms in one mail.
    In order to do personnel evaluation we send an  e mail to Departement Manangers attaching an interactive form for every employee in his or her Department.
    I'd like send only one email for every manager.
    Do you think is it possible?
    If yes, some idea?
    Thank you very much,
    Gloria

    Hi gloria,
    Yes it's possible to do it .
    When you create an e-mail with BCS functionnality you can add several attachment to it .
    Here is a sample code for this .
    Best regards.
    Bertrand
    TYPE-POOLS : abap .
    DATA : data_for_update TYPE zdemopdf ,
           hexa            TYPE solix_tab.
    DATA : fm_name   TYPE funcname ,
           param     TYPE sfpoutputparams,
           doc_param TYPE sfpdocparams ,
           output    TYPE fpformoutput .
    ** CLASS-DEFINITIONS
    DATA: send_request       TYPE REF TO cl_bcs.
    DATA: document           TYPE REF TO cl_document_bcs.
    *DATA: sender             TYPE REF TO cl_sapuser_bcs.
    data: sender            TYPE REF TO if_sender_bcs.
    DATA: recipient          TYPE REF TO if_recipient_bcs.
    ** INTERNAL TABLES
    DATA: l_mailtext TYPE soli_tab.
    DATA: iaddsmtp   TYPE TABLE OF bapiadsmtp.
    DATA: ireturn    TYPE TABLE OF bapiret2.
    ** VARIABLES
    DATA: mail_line  LIKE LINE OF l_mailtext.
    DATA: bapiadsmtp         TYPE bapiadsmtp.
    DATA: subject    TYPE so_obj_des.
    DATA : att_subject TYPE so_obj_des.
    DATA : w_except TYPE REF TO cx_root .
    FIELD-SYMBOLS : <smtp> TYPE bapiadsmtp.
    param-nodialog = abap_true. " suppress printer dialog popup
    param-getpdf = abap_true.
    doc_param-langu = sy-langu.
    doc_param-country = 'FR'.
    doc_param-fillable = abap_true.
    doc_param-dynamic = abap_true.
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
      EXPORTING
        i_name     = 'ZDEMO_PDF'
      IMPORTING
        e_funcname = fm_name.
    *Set subject of the mail
    subject = 'Sample Mail with several forms'.
    * Set text of the mail
    mail_line = 'here it is'.
    APPEND mail_line TO l_mailtext .
    * Set attachment name
    att_subject = 'Sample form'.
    TRY.
    * Create persistent send request
        send_request = cl_bcs=>create_persistent( ).
    * Get sender object
        sender = cl_sapuser_bcs=>create( sy-uname ).
    * Add sender
        CALL METHOD send_request->set_sender
          EXPORTING
            i_sender = sender.
    * Create the Recipient
            recipient =
         cl_cam_address_bcs=>create_internet_address( ****** ). " Set the e-mail adress of the recipient
    * Add recipient with its respective attributes to send request
        CALL METHOD send_request->add_recipient
          EXPORTING
            i_recipient  = recipient
            i_express    = 'X'
            i_copy       = space
            i_blind_copy = space
            i_no_forward = space.
    * Set that you don't need a Return Status E-mail
        CALL METHOD send_request->set_status_attributes
          EXPORTING
            i_requested_status = 'E'
            i_status_mail      = 'E'.
    * set send immediately flag
        send_request->set_send_immediately( 'X' ).
    *Build Document
        document = cl_document_bcs=>create_document(
                            i_type    = 'RAW'
                            i_text    = l_mailtext
                            i_subject = subject ).
    *     add attachment to document
    do 5 times.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = param
      EXCEPTIONS
        cancel          = 1
        usage_error     = 2
        system_error    = 3
        internal_error  = 4.
    CHECK sy-subrc EQ 0.
    CALL FUNCTION fm_name
      EXPORTING
        /1bcdwb/docparams  = doc_param
        data_for_update    = data_for_update
      IMPORTING
        /1bcdwb/formoutput = output
      EXCEPTIONS
        usage_error        = 1
        system_error       = 2
        internal_error     = 3.
    CALL FUNCTION 'FP_JOB_CLOSE'
      EXCEPTIONS
        usage_error    = 1
        system_error   = 2
        internal_error = 3
        OTHERS         = 4.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer     = output-pdf "PDF file from function module
      TABLES
        binary_tab = hexa.
        CALL METHOD document->add_attachment
          EXPORTING
            i_attachment_type    = 'PDF'
            i_attachment_subject = att_subject
            i_att_content_hex    = hexa.
    * Add document to send request
        CALL METHOD send_request->set_document( document ).
    enddo.
    * Send document
        CALL METHOD send_request->send( ).
        COMMIT WORK.
      CATCH cx_send_req_bcs INTO w_except.
      CATCH cx_address_bcs INTO w_except.
      CATCH cx_document_bcs INTO w_except.
    ENDTRY.

  • Sales order confirmation to the customer through email

    Hi
    I have configured output type z101 for sales document.Here I selected transmission medium 5 for 'External Send' . After that I completed output determination procedure as same steps and  testing purpose I opened VA02 and goto Extras> ouput>Header>Edit>
    here I entered ouput type  ,medium 5(External Send),partner,language.
    My issue is
    Whenever I created(saved) the sales order  then immediately order confirmation goes to the customer emailid. customer email maintained in customer master(xd01).
    Please inform the  what are the required settings using SCOT Transaction.  This is the urgent need.
    Regards,
    Ravi

    Please have a look at the note 455140.
    Also look at the following weblog.
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Message was edited by: Vinod C

  • Sales order confirmation form in Adobe Forms-Urgent

    Hi Experts,
    I have to create an adobe form for Sales order Confirmation.
    I have worked on ABAP but no idea about Adobe forms. I am new for this.
    Could you please tell me what are are the things required to delelop an adobe forms
    What are the steps i have to follow to create an adobe form.
    I have to do coading in ABAP DEV Workbench or somewhere else?
    If somewhere else then in which language and where ?
    If someone has created a sales order confirmation adobe forms earlier please send me the code for reference.
    Regards,
    Nik

    Thanks again Vinod for this input. I've already had a look into the form where nothing named as 'TITLE' appear. And frankly I'm not very strong in identifying the print program for a given form. I try with debug but taking into account my poor skills in ABAP I'm lost with all those function module. And the print program that I could get from [NACE] includes so many things that I'm still not able to find out the OPEN_FORM statement. But I keep on trying.
    Regards.
    Nozome.

  • How do I submit my form as PDF in email?

    I just completed a PDF form with a Submit by email button, I was able to set the email id but when i press Submit by Email button, it attaches an XML. How do I make LiveCycle Designer save the form as pdf and attach it to the set email id? Help please

    Open your form in Acrobat Professional.  Using the Advanced pull down menu choose, "Extend Features in Adobe Reader".  You'll get a warning message which includes the following note - "Once reader enabled, certain functions,such as editing document content or inserting and deleting pages will be restricted." Read so you are sure this is what you want then choose Save Now.  Reader rights are now enabled.
    To answer your question on usage rights, I went right to the acrobate users group and copied their indepth explanation
    "To summarize the EULA as it relates to enabling PDFs, you are granted permission for enabling a PDF for a maximum of 500 uses. This means that if you post a PDF enabled form on your Web site and 500 people fill out the form, you're within the licensing agreement. If you enable a form where more than 500 people fill out and submit the form back to you, you're not complying with the licensing in the EULA. There are many uses for staying within the 500 limit. You might want to enable files used as a purchase order form, a travel expense form, a vacation leave form, etc. The form can be used by several Adobe Reader users many times, but needs to stay within the 500 use limitation.
    For a huge number of appliications this new enabling feature is designed for people who don't have industrial strength needs for forms distribution that require purchase of LRES. A charity golf tournament, a small conference, a PTA event, etc. are all likely candidates for using the new enabling features in Acrobat Professional."

  • Order confirmation Form

    Hi,gurus,
             I use the standard program RVADOR01 to print the order confirmation,  it can show the customer name and address , but can't show the telepone and fax number.
           My script is :
    /:   IF &PAGE& EQ '1 '.
    /*   INCLUDE &TVKO-TXNAM_ADR& OBJECT TEXT ID ADRS
    /:   ENDIF.
    /:   ADDRESS PARAGRAPH AS
    /:    ADDRESSNUMBER &VBDKA-ADRNR(K)&
    /:    TELEPHONE &VBDKA-TELF1&
    /:   ENDADDRESS
    Can someone tell me give me some advice?  Award point is surely.
    Thanks advance.

    this might help
    /:      ADDRESS [DELIVERY] [TYPE t] [PARAGRAPH a][ PRIORITY p]         [LINES l]
    /:     TITLE form of address
    /:     NAME name1[, name2[, name3[,name4]]]
    /:     PERSON name of natural person [TITLE form of address]
    /:     PERSONNUMBER number of the person
    /:     DEPARTMENT department
    /:     STREET strno HOUSE house number
    /:     POBOX  pobox [CODE code]
    /:     POSTCODE postal code
    /:     CITY city1[,city2]
    /:     REGION district
    /:     COUNTRY recipient country
    /:     FORMCOUNTRY sender country
    /:     ENDADDRESS
    Parameter PRIORITY defines which address lines may be omitted, if necessary. The possible values are as follows :
    A     Form of address
    B     Mandatory blank line 1
    C     Mandatory blank line 2
    2     Name2
    3     Name3
    4     Name4
    L     Country name
    S     Street line
    O     City line
    The parameter LINES are available for formatting the address. Possible values are from 1 to n. If it is not possible to format all address data due to a lack of lines, the data which is entered in the parameter PRIORITY is omitted.

  • Sending order confirmation to external app. for stock transport order

    Hello,
    What I need to do is to send an order confirmation from a STO to an external application. In more practical terms, the scenario is as follows.
    We receive orders from an external application and an STO will be created by using SAP Idoc PORDCR04. Then, after running the availabillity check, I need to send an electronical confirmation back from the STO to this application so they can see the order confirmation in their application
    How can I do that?
    Edited by: Gunnar Aroen on Nov 18, 2011 2:22 PM

    Hello Raghu,
    I need to send the order confirmation to E-mail for different customers. The
    e-mail id is same but i have to send to 300 different customers. Is there any
    option available in SAP to do this otherwise i have to trigger the output
    manually for this 300 customer numbers.
    I have a question here with reference to your questions of triggering a Order confirmation E-Mail --> Could you please explain the business reason of triggering E-mail to same recipient multiple times ? Just think over it...Sending E-mails for 300 number of Customer on a single E-mail ID is not making any sense. 
    You can maintain multiple E-mail ID in Customer master record and as per SAP standard, email will be triggered to only one recipient. Anyway please refer to the below suggestion of your question:-
    1:- Please reach out to Technical consultant and try developing a program which will have selection criteria of Sales Order, Customer ID, Output Type and Number of execution as selection screen which in turn will call the driver program and trigger the Email 300 number of times.
    Kindly update the forum after you carry out this exercise.
    Regards,
    Sarthak

  • Wrong Header Discount at Order Confirmation Form, /SMB40/SDORC_A

    Hi All,
    I have set the smartforms, /SMB40/SDORC_A as the print out form for Order confirmation. However, it is found the header discount shown on that form is always wrong.
    For example, the header discount is 6.00% but shown as 60.00%.
    Could you let me know what's the problem?
    Cheers,
    Chris.

    Dear Chris,
    Please check note 852250. Also check the following settings:
    1. User setting -> Defaults tab
    2. IMG -> SAP NetWeaver -> Set Countries -> Define Countries in mySAP
    Systems.
    I hope this helps.
    Best regards,
    Ian Kehoe

  • Slaes order confirmation form(smartform)

    Hi,
    Can you help me get SAP's preconfigured SmartForm and associated print program for the Sales Order Confirmation?
    Thanks
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Oct 17, 2008 3:24 PM

    HI
    Agree to Shakeel because preconfigured smartforms are not available in all servers, thats because SMB40 and SMB11 packages are not installed in those servers.
    So, the option available is to convert existing script to smartform. In the smartforms tcode in menu, utilities>Migration>Import SAP script form..
    After that process you will get the layout and you have to change the code however to display.
    Also, to download preconfigured smartforms you need to have access to service.sap.com.
    Regards,

  • Sending a text document as pdf by email.

    Hi,
    I have a plain text document that needs to be send as a pdf document by email. The line type of the text document is PC408-linda, which is 132-character length. I am trying to use the FM ‘SO_NEW_DOCUMENT_ATT_SEND_API1’ for sending the document which uses structure ‘SOLISTI1’ for sending the document. The line size of SOLISTI1 is 256 characters. I tried to send 132-character length internal table instead of the given structure for the FM, it didn’t work. Later, I put the 132-charcter line into the 256-character length line, which works well. But, I have a problem when the outgoing system converts the 256-character length into pdf document. It breaks the line.
    Can you please suggest me how can I fit this 132-chracter line in the above FM or Is there any alaternateive FM for sending this 132-character lines, which will fit in the pdf format.
    Lokman

    Hi,
    Here I am sending the part of the code that is sending the text document by using FM. Internal table $form conatins 132-character length text document. I want to send this document so that converted pdf appears similar to text line.
    FORM send_email USING $form TYPE tt_form.
    DATA:
        $form_wa1  LIKE pc408.
    data: paydate(15) type c.
    Data  date like sy-datum.
    *date = sy-datum.
    Email Subject.
    DATA: s1(30)  TYPE c VALUE  ' Avis - Bulletin de paie du ',
            s3(50)  TYPE c .
    loop at $form into $form_wa1.
    if sy-tabix eq 10.
    MOVE $form_wa1-linda+5(10) TO paydate.
    endif.
    objtxt-line = $form_wa1-linda.
    append objtxt.
    endloop.
    CONCATENATE s1 paydate INTO s3 separated by SPACE.
    *Email message body.
    DATA: c1(30)  TYPE c VALUE  'Vous trouverez ci-joint',
          c2(50) type c value ' votre bulletin de paie du  ' ,
          c type c value '.',
          c4(85)  TYPE c.
    CONCATENATE c1 c2 paydate c INTO c4 separated by SPACE.
    data: a1(40) type c value 'À ouvrir avec le programme "Notepad" ',
       a2(47) type c value ' ou "Wordpad" pour le visualiser correctement.',
       a3(90) type c.
      CONCATENATE a1 a2 INTO a3.
    data: b1(45) type c value ' Pour imprimer, veuillez vous ',
        b2(45) type c value ' assurer que les marges (droite et gauche)',
        b3(35) type c value ' sont restreintes au minimum.',
       b4(200) type c.
       CONCATENATE a3 b1 b2 b3 INTO b4.
    Main Text
    data wa_form like PC408 .
    Email Subject
    docdata-obj_name = 'TEST_ALI'.
    docdata-obj_descr = s3.
    Email Message
    objtxt = 'Bonjour,'.
    append objtxt.
    objtxt = ' '.
    append objtxt.
    objtxt = c4.
    append objtxt.
    objtxt = ' '.
    append objtxt.
    objtxt = b4.
    append objtxt.
    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 = 'RAW'.
    append objpack.
    Create Message Attachment
    Write Packing List (Attachment)
    loop at $form into $form_wa1.
    *if sy-tabix eq 10.
    *MOVE $form_wa1-linda+5(10) TO paydate.
    endif.
      objtxt-line = $form_wa1-linda.
      append objtxt.
    endloop.
    att_type = 'RAW '.
    describe table objtxt lines tab_lines.
    read table objtxt index tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    clear objpack-transf_bin.
    objpack-head_start = 6.
    objpack-head_num = 0.
    objpack-body_start = 6.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = 'Attached Document'.
    append objpack.
    Create receiver list
    reclist-receiver = wa_pa0105-usrid. "<-- change address
    *reclist-receiver = '[email protected]'. "<-- change address
    reclist-rec_type = 'U'.
    append reclist.
    *reclist-receiver = sy-uname. "<-- change internal user
    *reclist-rec_type = 'B'.
    *append reclist.
    Send Message
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    PUT_IN_OUTBOX = 'X'
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    tables
    packing_list = objpack
    OBJECT_HEADER = objhead
    *CONTENTS_BIN = objbin
    CONTENTS_TXT = objtxt
    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
    refresh: objtxt,
             objpack,
             objhead,
             reclist.
    IF sy-subrc <> 0.
    message ID 'SO' TYPE 'S' NUMBER '023'
    with docdata-obj_name.
    ENDIF.
    *write: / 'End of Program'.
    ENDFORM.                    " send_email

  • Form-to-pdf-to-email

    I'm trying to find a way to get a form online to convert into
    a pdf file so when the user hits the "submit" button it sends them
    via email a pdf version of the form they just filled out, as
    opposed to plain text.
    Any ideas?

    This is quite a difficult task and you'd need to be a fairly
    accomplished
    progrommer to complete it. If you're on Windows, you might
    want to have a
    look at some of the ASP.NET components on the market to help.
    Have a search
    on Google for some.
    Jules
    http://www.charon.co.uk/charoncart
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004

  • Cannot send the approval form by PDF in the procurement scenario

    Dear Experts,
    There is a problem with the PDF in the procurement scenario in Discovery System V3. I am using Japanese version of the DS.
    I can send the sales order which is the adobe form in the portal (log in by proc_sales).
    But when it comes to approving the procurement request (log in by proc_admin), when I click on the send button, an window pops up which says 2Cannot handle content type: text/html "
    I googled and it says if my version of Adobe reader is correct.
    I have installed Adobe Reader 7.0.9. (so is written in the business scenario script).
    Any advice will be very much helpful.
    many thanks
    Sudeep

    Hello Sudeep,
    Please follow this URL to open a CSN ticket : [https://service.sap.com/message|https://service.sap.com/message]
    When you open the message,you will be required to choose the category(component) under which to open the ticket . Please place your support message under the component CA_SOA_DS- this is the component used for Discovery System related messages.
    Thanks,
    Deepa

  • Send a Sapscript as a PDF by email

    Hi,
    I've to convert a sapscript into PDF and then send it by email.
    I'm using the next logic in my printer program:
    1. I Executo the FMs OPEN_FORM, WRITE_FORM and CLOSE_FORM.
    2. Then I obtain the spool request using the FM RSPO_FIND_SPOOL_REQUESTS
    3. Then I convert the Spool request into a *pdf using the FM CONVERT_OTFSPOOLJOB_2_PDF
    4. Finally I call the FM SO_DOCUMENT_SEND_API and attach the pdf created in the 3rd step.
    My problem is that when I execute all this in background task. It doesnt send the email. Does anybody know what is going on?
    Thanks !

    Did you leave the COMMIT_WORK parameter as SPACE? 
    You actually do not have to send it to the spool.  The OPEN_FORM function module has a parameter to request OTF data.  The CLOSE_FORM function will return it as an internal table.  You can convert that to PDF and send.

  • Problem in sending online interactive form in email as PDF attachment

    Hi,
    I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
    Can you pls help me in solving this, Or any other way for doing the same.
    Here is the code i am using for triggering the RFC from WD
    Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();     
              //to capture the outplacement level entered in the form
              mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
         mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
         wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
         try
              wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
              wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
         catch (WDDynamicRFCExecuteException e)
              // TODO Auto-generated catch block
              wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
              e.printStackTrace();
    Here is the function module code
    FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_OUT_PLACE_LEVEL) TYPE  XSTRING OPTIONAL
    *"     VALUE(I_BIN_DATA) TYPE  XSTRING OPTIONAL
    *"  TABLES
    *"      T_V_BIN_DATA STRUCTURE  SOLISTI1
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
    Data Declaration
      DATA: gd_cnt TYPE i,
            gd_sent_all(1) TYPE c,
            gd_error TYPE sy-subrc,
            tab_lines LIKE sy-tabix,
            v_subject(255) VALUE 'HI'.
    Structure Declaration
      DATA : BEGIN OF it_file OCCURS 0,
              row(255),
             END OF it_file.
      DATA : BEGIN OF i_split OCCURS 0,
      row(50),
      END OF i_split.
    DESCRIBE TABLE it_message LINES tab_lines.
    READ TABLE it_message INDEX tab_lines.
    Internal Table Declaration
      data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
      DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      data : wa_receiver like table of SOMLRECI1 with header line.
      data : it_receiver like table of SOMLRECI1 with header line.
      DATA :   gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
      REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
      CLEAR   : objbin, it_packing_list, wa_receiver, it_receivers.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SENDFILE'.
    gd_doc_data-obj_descr = v_subject.
    gd_doc_data-sensitivty = 'O'.
    APPEND GD_DOC_DATA.
    Appending The Internal Table it_packing_list
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'RAW'.
      it_packing_list-body_num = tab_lines.
      APPEND it_packing_list.
      move i_bin_data to t_v_bin_data.
    ********Add By Anuj
      APPEND t_v_bin_data.
    ********End Add By Anuj
      LOOP AT t_v_bin_data.
        MOVE t_v_bin_data TO objbin-line.
        APPEND objbin.
      ENDLOOP.
      CLEAR it_packing_list.
      DESCRIBE TABLE objbin LINES tab_lines.
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 1.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'PDF'.
      it_packing_list-body_num = tab_lines.
      it_packing_list-doc_size = tab_lines * 255.
      APPEND it_packing_list.
      wa_receiver-receiver = '[email protected]'.
      wa_receiver-rec_type = 'U'.
      wa_receiver-com_type = 'INT'.
      APPEND wa_receiver.
      move wa_receiver[] to it_receiver[].
      append it_receiver.
    *Appending The Internal Table it_receivers
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver to it_receiver.
    append it_receiver.
      Move wa_receiver[] to it_receivers[].
    Clear it_receivers.
      if i_OUT_PLACE_LEVEL NE 0.
    loop at it_receivers into wa_receiver.
       loop at it_receivers into wa_receiver.
    *Function Module To Post The Message To Externa Mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receivers
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
       endloop.
      elseif i_OUT_PLACE_LEVEL eq 0.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receiver
          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.
        clear wa_receiver.
      endif.
    ENDFUNCTION.
    Regards
    Ravindra

    Hi,
    I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
    Can you pls help me in solving this, Or any other way for doing the same.
    Here is the code i am using for triggering the RFC from WD
    Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();     
              //to capture the outplacement level entered in the form
              mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
         mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
         wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
         try
              wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
              wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
         catch (WDDynamicRFCExecuteException e)
              // TODO Auto-generated catch block
              wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
              e.printStackTrace();
    Here is the function module code
    FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_OUT_PLACE_LEVEL) TYPE  XSTRING OPTIONAL
    *"     VALUE(I_BIN_DATA) TYPE  XSTRING OPTIONAL
    *"  TABLES
    *"      T_V_BIN_DATA STRUCTURE  SOLISTI1
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
    Data Declaration
      DATA: gd_cnt TYPE i,
            gd_sent_all(1) TYPE c,
            gd_error TYPE sy-subrc,
            tab_lines LIKE sy-tabix,
            v_subject(255) VALUE 'HI'.
    Structure Declaration
      DATA : BEGIN OF it_file OCCURS 0,
              row(255),
             END OF it_file.
      DATA : BEGIN OF i_split OCCURS 0,
      row(50),
      END OF i_split.
    DESCRIBE TABLE it_message LINES tab_lines.
    READ TABLE it_message INDEX tab_lines.
    Internal Table Declaration
      data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
      DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
      data : wa_receiver like table of SOMLRECI1 with header line.
      data : it_receiver like table of SOMLRECI1 with header line.
      DATA :   gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
      REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
      CLEAR   : objbin, it_packing_list, wa_receiver, it_receivers.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SENDFILE'.
    gd_doc_data-obj_descr = v_subject.
    gd_doc_data-sensitivty = 'O'.
    APPEND GD_DOC_DATA.
    Appending The Internal Table it_packing_list
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'RAW'.
      it_packing_list-body_num = tab_lines.
      APPEND it_packing_list.
      move i_bin_data to t_v_bin_data.
    ********Add By Anuj
      APPEND t_v_bin_data.
    ********End Add By Anuj
      LOOP AT t_v_bin_data.
        MOVE t_v_bin_data TO objbin-line.
        APPEND objbin.
      ENDLOOP.
      CLEAR it_packing_list.
      DESCRIBE TABLE objbin LINES tab_lines.
      it_packing_list-transf_bin = 'X'.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 1.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type = 'PDF'.
      it_packing_list-body_num = tab_lines.
      it_packing_list-doc_size = tab_lines * 255.
      APPEND it_packing_list.
      wa_receiver-receiver = '[email protected]'.
      wa_receiver-rec_type = 'U'.
      wa_receiver-com_type = 'INT'.
      APPEND wa_receiver.
      move wa_receiver[] to it_receiver[].
      append it_receiver.
    *Appending The Internal Table it_receivers
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver[] to it_receiver[].
    append it_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    wa_receiver-receiver = '[email protected]'.
    wa_receiver-rec_type = 'U'.
    wa_receiver-com_type = 'INT'.
    APPEND wa_receiver.
    move wa_receiver to it_receiver.
    append it_receiver.
      Move wa_receiver[] to it_receivers[].
    Clear it_receivers.
      if i_OUT_PLACE_LEVEL NE 0.
    loop at it_receivers into wa_receiver.
       loop at it_receivers into wa_receiver.
    *Function Module To Post The Message To Externa Mail
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receivers
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
        clear wa_receiver.
       endloop.
      elseif i_OUT_PLACE_LEVEL eq 0.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gd_doc_data
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = it_packing_list
            contents_hex               = objbin
            receivers                  = it_receiver
          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.
        clear wa_receiver.
      endif.
    ENDFUNCTION.
    Regards
    Ravindra

Maybe you are looking for

  • Inserting an image from a CSV file

    I am trying to create a document that is a directory of members of a community.  The directory is in a CSV file.  One ot the fields is a @photos field that contains the path to the location of the images on my local compiuter,  When I try and preview

  • Program ID  in RFC

    Hi friends, IN sender RFC Adapter ... In RFC Server Parameter... What is Program ID

  • Why won't my macbook load Facebook?

    My macbook has quit loading one specific page - my facebook page. It loads any other page I try. It just won't load facebook. How can I get my macbook to load my facebook page again?

  • How can I config to create an out-of-box jms queue

    Hi All, I am new to WebLogic Server and I need to create an out-of-box jms queue for my project, which means instead of creating and configuring the queue at the administration console, I'd like to program and change some configuration files to achie

  • Iphoto crashes when downloading Nikon D800 files

    Hi, I am trying to download my Nikon D800 pictures directly to Iphoto, to use it as a library. The problem is always the same, whether I import the pics directly from the camera, from a card reader or plugging the SD card into the computer slot : Iph