XML output email attachment.

Hi All,
Our client is currently suing the XMLP reports in their Receivables applications. The current functionalities are covered in the current report.
1. Generate the invoice report in pdf output. (It uses RDF to generate the xml data)
2. Based on the bursting setup deliver the pdf report to various destination.
3. Send the pdf report as attachment though email.
For this, We need to submit the one concurrent program at the time of processing, it submits the second concurrent program for bursting and then it submits the third concurrent program for attaching the pdf with the mail.
Now based on the latest partner system changes this requirement is changed to deliver the xml file instead of pdf file. They have given the specific tags that needs to be included in the xml file. Please note, these tags are different or same as the table column names.
Example:
Column Name : INVOICE_NUMBER
xml tag : VendorInvoiceNumber.
Is it possible to achieve the whole new requirement. If so, could you please tell me how? I very much appreciate your help in this.
Thanks in advance.

Go to OTN and get the mail example.
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Then use something like this (example below is sending xml to render as an Excel sheet, has to be opened as an XML table in Outlook 2007):
declare
conn utl_smtp.connection;
begin
conn := demo_mail.begin_mail('sender','recipient list','Subject of email','multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"');
demo_mail.attach_text(conn,'Enter comments for the message body','text/plain');
demo_mail.attach_text(conn,dbms_xmlgen.getxml('select whatever from wherever'),'application/msexcel',TRUE,'Name of your file.xls');
demo_mail.end_mail(conn);
end;
You can use this as the framework to create your mail sending package:
http://dizwell.com/2008/04/28/automatically-emailing-excel-spreadsheets-from-oracle/
Then just figure out how/where you want the mail sending to be triggered.

Similar Messages

  • Xml output emails are not coming

    Hi,
    We have an issue in our prod EBS 11i environment,
    suddenly we are unable to get mails for xml output. Other emails are coming.
    How to find the issue? please help.
    Thanks,
    Kavitha

    Hi,
    This it the request log.
    ========================================================
    XXDN Doner Custom: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXDN_PA_XML_INV_PRT module: XXDN: Invoice Printing Report
    Current system time is 06-JUN-2012 20:40:06
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_INVOICE_NUM_LOW='90137418'
    P_INVOICE_NUM_HIGH='90137418'
    P_COPY_NAME='Customer Copy'
    P_TO_EMAIL_ADDRESS='[email protected]'
    P_PRINTER_NAME='SFLD-ACCT05-HP4250'
    P_MASTER_REQUEST_ID='9539199'
    P_NO_OF_COPIES='1'
    P_CUST_PDFS='N'
    P_CLIENT_ADDR='Y'
    APPLLCSP Environment Variable set to :
    XML_REPORTS_XENVIRONMENT is :
    /ap02/u05/applmgr/prodora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    XENVIRONMENT is set to /ap02/u05/applmgr/prodora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    Xlib: connection to "apclsr01:0.0" refused by server
    Xlib: No protocol specified
    REP-3000: Internal error starting Oracle Toolkit.
    MSG-00100: XXDN_PA_XML_INV_PRT.rdf V1.9
    Report Builder: Release 6.0.8.28.0 - Production on Wed Jun 6 20:40:07 2012
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Start of log messages from FND_FILE
    Return 0
    Return 0
    Consolidation successful.
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 9539200 on node APCLSR01 at 06-JUN-2012 20:40:13.
    Post-processing of request 9539200 completed at 06-JUN-2012 20:40:15.
    ------------- 2) PRINT   -------------
    Printing output file.
    Request ID : 9539200      
    Number of copies : 0      
    Printer : SFLD-ACCT05-HP4250
    Finished executing request completion options.
    Concurrent request completed successfully
    Current system time is 06-JUN-2012 20:40:15
    ===========================================================
    And also i see below error in OPP log but that is not related to this request,
    [6/6/12 4:57:15 PM] [UNEXPECTED] [31721:RT9538937] oracle.apps.xdo.oa.schema.server.TemplateExpiredException: END_DATE has passed.
         at oracle.apps.xdo.oa.schema.server.TemplateInputStream.initStream(TemplateInputStream.java:439)
         at oracle.apps.xdo.oa.schema.server.TemplateInputStream.<init>(TemplateInputStream.java:235)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.getTemplateFile(TemplateHelper.java:1159)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3430)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
    Thanks,
    Thanks,

  • XML Bursting, Email attachment is blank

    I have report which as a part of my requirement need to send it to customers, I am using XML bursting logic to send it through email. It was working fine until last week and now it is sending emails succesfully with attachment as blank. below are the lines from log.
    Can you please advice me on this
    Edited by: User910243567 on Feb 8, 2012 3:09 AM

    Howdy,
    I seem to vaguely remember we had this problem with our bursting file for out POs.... It turned out to be a parm in the bursting file. I am sorry but I am not positive which one it was but I think it was the content-type parm. Anyway, our final file looks like the below xml so if you compare it to what you have now it may assist:
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
    <xapi:request select="/AZZ_POXPRPOL_BIP/LIST_G_INIT_INFO/G_INIT_INFO/LIST_G_HEADERS/G_HEADERS">
    <xapi:delivery>
    <xapi:email server="10.0.12.100" port="25" from="[email protected]" reply-to="">
    <xapi:message id="${POH_PO_NUM}" to="${REQUESTOR_EMAIL}" cc="" attachment="true" content-type="text/html" subject="Purchase Order ${POH_PO_NUM}">Please find attached purchase order ${POH_PO_NUM}.
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output="PO_${POH_PO_NUM}" output-type="pdf" delivery="${POH_PO_NUM}">
    <xapi:template type="xsl-fo" location="xdo://XXAZZ_CUS.AZZ_POXPRPOL_XSL.en.US/?getSource=true" filter="" />
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    Good luck and remember... Oracle is not supposed to be fun...it just pays the bills! ;-)
    Scott

  • XML formatted Email Attachment created by CL_IXML is too big to be received

    Dear all,
    I followed the excellent web blog http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment
    to pass an internal table (2MB in size, 18 columns * 6300 rows) to CL_IXML DOM and send this XML file as an formatted Excel attachment, it perfectly works, but the size of this XML attachment exceeded 8 MB, although I reduced it to 6MB successfully by simplying its Cell Attribute from
    <Cell ss:StyleID="s62"><Data ss:Type="String">1E2</Data></Cell>
    TO                    <Cell*><Data ss:Type="String">1E2</Data></Cell>.
    but I cannot do the same on its Data Attribute, and it is still too big to be received by the mailbox of my third party users, is there any way to reduce it below to 3MB?
    we need the attachment to be formatted Excel, and cannot request my third party receiver to do anything in Excl.
    I am using ECC 6.0, 32 bit no-unicode, and SAP Gui 7.20.
    looking forwarding to your reply
    Peter Ding

    You can try zipping the file and send it as attachment.
    Use the FM SCMS_XSTRING_TO_BINARY to convert the XML to Binary. Do the ZIP using the method COMPRESS_BINARY of the class CL_ABAP_GZIP.
    Regards,
    Naimesh Patel

  • Send Output as attachment to email address

    Hi friends,
    My requirement is to send the Output as attachment to a specific email address.
    I have created a new output type and using transmission medium as External Send.
    If I use SH/BP/SP it is picking the mail address and working fine.
    Now my requirement is to send to fixed standard email address irrelevant of document.
    Can anyone help me to explain how can I achieve this by setting in Parner functions of that output type?
    I dont want to add any parner function in partner determination.
    Thanks in advance.
    Rgds,
    AK

    Hi there,
    Define a new customized Z table & maintain the required mail ids in the table.
    in the O/p processing prog, call the Z table & send the mail to the mail ids mentioned in it.
    For formality, assign the O/p to an partner function in your condition records.
    Regards,
    Sivanand

  • Report output getting truncated in email attachment

    Hello Gurus,
    My requirement is to send a report output as an email attachment.
    I have done the coding for this but have a small problem. In the attachment the report is getting truncated after certain length.
    Can you advise wats the problem ?
    Regards,
    Suhas

    Hello Guys,
    I too was contemplating on those lines. But actually i was calculating the File Size incorrectly.
    Changed the code & now it working !!!!!!!
    BR,
    Suhas

  • Send Report output as Email attachment (PDF)

    Hi Experts,
      i am trying to send the contents of an internal table from my report as email using PDF attachment. I have coded the logic and i get the attachment in the email. When i try to open the attachement, i cannot open it.
    The message i get is "_Adobe reader could not open the attachment "attach.pdf" because it is either not a supported file type or the file has been damaged(for example, it was sent as an email attachment and wasn't correctly decoded )._
    Not sure where i went wrong.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
    CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = w_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = w_sent_all
        TABLES
          packing_list               = t_packing_list
          contents_bin               = t_attachment
          contents_txt               = it_message
          receivers                  = t_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.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    "send_file_as_email_attachment

    Hello RnB,
    You can check the mentioned link for the same:
    [Simple Program to generate PDF from ABAP List Output.|http://www.abapmadeeasy.com/2011/02/sap-abap-simple-program-to-generate-pdf.html]
    Regards,
    Uttam Agrawal

  • Email Attachment is not Working for xml file

    Hi All,
    if any one has any answer to this below Query, Your help will be highly appreciated.
    1- while configuring the email for attachment i am getting the selection failure Error in Content Encoding line where i am setting the base64 for encoding. Please fine configuration done for Email activity
    <scope name="Email1">
    <bpelx:annotation>
    <bpelx:pattern patternName="bpelx:email"></bpelx:pattern>
    </bpelx:annotation>
    <variables>
    <variable name="varNotificationReq"
    messageType="ns1:EmailNotificationRequest"/>
    <variable name="varNotificationResponse"
    messageType="ns1:ArrayOfResponse"/>
    <variable name="NotificationServiceFaultVariable"
    messageType="ns1:NotificationServiceErrorMessage"/>
    </variables>
    <sequence name="Sequence1">
    <assign name="EmailParamsAssign">
    <copy>
    <from expression="string('Default')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:FromAccountName"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Bcc"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Cc"/>
    </copy>
    <copy>
    <from expression="string('')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:ReplyToAddress"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('subject')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Subject"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('mailId')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:To"/>
    </copy>
    <copy>
    <from>
    <Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/mixed</MimeType>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    </BodyPart>
    <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">
    <MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    <contentencoding xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/>
    </BodyPart>
    </MultiPart>
    </ContentBody>
    </Content>
    </from>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content"/>
    </copy>
    <copy>
    <from expression="string('base64')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentEncoding"/>
    </copy>
    <copy>
    <from expression="string('application/xml')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:MimeType"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('body')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:ContentBody"/>
    </copy>
    <copy>
    <from expression="string('application/xml')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:MimeType"/>
    </copy>
    <copy>
    <from expression="'abc.xml'"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:BodyPartName"/>
    </copy>
    <copy>
    <from expression="ora:readFile('file:///*/*.xml')"/
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentBody"/>
    </copy>
    </assign>
    If any one has done it before please help me out...
    thanks
    Dillip

    Hello Dillip,
    Please find below links. Either of one should solve your problem -
    http://mysoathoughts.blogspot.fi/2013/02/send-xml-file-as-attachment.html
    http://neeraj-soa-tips.blogspot.co.uk/2012/01/sending-attachment-using-email-activity.html
    BR
    Vaibhav

  • Report output as an email attachment

    Hi ,
    I am sending report output as email attachment by using 'mail recipient ' CLTR+ F7' option in alv list.
    But this is sending mail as pdf attachment. I want it as excel format.
    Is there any option to change type of attachment which sending mail?

    Hi,
    This is not possible to change the filetype of the attachment. Instead you can have your own functionality in the program to send email with excel attachment
    Refer to this link..http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

  • Send ALV output as attachment (exceeding 255 columns) to Inbox or email

    Hello,
    My requirement is to send the ALV output as attachment (csv or xls) to either Office Inbox or external email.  The trick is the ALV output is way more than the 255 columns (about 2000).
    I have read a number of threads on this matter.  It seems that it is either SO_NEW_DOCUMENT_ATT_SEND_API1 or class BCS (cl_document_bcs=>create_document) but both has restriction on the line size (max 255 chars) (please correct me if I am wrong).
    Could anyone suggest other approaches?  Your input is much appreciated.
    Regards
    Calvin

    Hi,
    Comapare with your code,
    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.
    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.
    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.

  • I want to send my output of report as an email attachment

    i am having internal table contains values.
    i want that output should be send as an email attachment
    to email id given in selection screen.
    help me how to pass that internal table to the parameters
    of SO_DOCUMENT_SEND_API1 function module
    should i call any function modules to format my internal table to get as an attachment in email.
    help me its urgent..

    *& Report  ZEMAIL_ATTACH                                               *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
    *   Retrieve sample data from table ekpo
      PERFORM data_retrieval.
    *   Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    * Populate message body text
      perform populate_email_message_body.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
    *   Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
    *       Build data table for .xls document
    FORM build_xls_data_table.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    *    con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_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.
    * Populate zerror return code
      ld_error = sy-subrc.
    * Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
    *        Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.
                       " POPULATE_EMAIL_MESSAGE_BODY

  • Controlling XML output Livecycle Designer 8.0

    Hello.
    I am new to XML and somewhat new to LiveCycle Designer, however I have acclimated rather well.
    Here is what I want to do:
    1) Create a PDF fill-in-form (including various fields...text, numeric, radio buttons, and some FormCalc functions)
    2) Create a Submit button that emails an XML file to the form administrator
    3) Use MS Excel to import XML files into pre-mapped fields
    Basically, I do not have server database support, and this is the best workaround (and most functional) I could come up with.
    After mapping fields in Excel, I exported the *.xsd and created a new data connection within LiveCycle. Then, I linked the schema fields with the bindings - corrected any errors, and have tested the form (form1). I made the submit button - that's all good, too. When I import the XML into Excel - that's where I have a problem, and it's not an issue with Excel to my knowledge, but rather how the form generates the XML output.
    For example, I have 25 fields that will be outputted via XML. My PDF form consists of 4 pages (8.5" x 11"). When I created the form and got to the end of the page, I "inserted new page" and went on my merry way. When I import the XML, Excel properly maps the fields, however, it does not import the info to a single row. What I have discovered is that since my PDF form consists of 4 pages (each bound to "sheet[*]"), the XML output looks like the following:
    Example of the XML output from my form:
    <form1>
    <sheet>
    <submissionID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >743</submissionID>
    <reviewerID xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >234</reviewerID>
    <date xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >24/01/2008</date>
    </sheet>
    <sheet>
    <tag1>input</tag1>
    <tag2>input</tag2>
    </sheet>
    </form1>
    Wherever there is a "<form>" tag (hence a new page in my PDF document), Excel puts that data on a new column. All fields within form1 are imported and mapped to the correct field, however importing a single XML file will occur on 4 rows.
    I bound each "page" as "sheet[*]" mostly because that is the only way I knew how to use FormCalc to do calculations from fields that occur at different places throughout the document.
    So, I have tried to be as clear as possible, and would like suggestions/help as how to control the XML output from a LiveCycle document. If I am to modify the outputted XML and remove the multiple instances of <sheet> and </sheet> then Excel imports the data just fine and on a single row.
    I would love some help on this rather specific problem. I guess it's a very basic issue that someone with experience could help.
    Thank you so much!!
    Jim

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • Extension of excel file in email attachment is .excel instead of .xls

    I have concurrent program and I'm trying to use the 'delivery option' to send the output as attachment in email. I defined a rtf template and can open the output from 'Output' button correctly. it can also send mail with attach, but the file name of the attachment is .excel which Excel cannot recognize. My question is , is there any setup to specify the file extension of excel output. I'm sure bursting can work correctly, I just want to try the delivery option. Thanks in advance.

    Please see these links.
    excel output in report builder reports
    http://forums.oracle.com/forums/search.jspa?threadID=&q=excel+AND+XML&objID=f475&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Transform LiveCycle form xml output using xsl

    I've completed my first form but now want to format the xml that's generated.
    Whilst I work for a big Company, I don't think they'll stretch to purchasing the Reader Extensions Module so I can output as PDF. Also there will be more than 500 users completing the form, so I can't just extend the rights using Adobe Acrobat.
    Therefore, I'd like to transform the xml created using xsl (as I have knowledge in this area) - I'd like the transformation to occur when the form is submitted via email so that a 'friendly' attachment is added to the email and not the xml output.
    Any ideas on this one?

    First thing is, the fonts did not work in my system.. So I can not really understand where the email address fields are..
    Few things:
    1) You have used an Email submit button and tried to place the code in the MouseDown event.
        You need to change this button to "Regular Type Button". and place the code in the Click event to work.
    2) I placed a sample button and put in my code for your reference.. This is working fine..You can check the below sample.
    https://acrobat.com/#d=tQa4E*8aA*mJq6aijSHuDQ
    3) You can do the same way for your form..
    4) If you have Acrobat software, you can enable JavaScript debugger which can give you the specific error message rather than Submit cancelled. If you do not, then you need to put some messageBox statements and check..
    Thanks
    Srini

  • How to convert a workbook into PDF and broadcast as Email attachment

    Hello Gurus,
    i have installed the ADS (Adobe Document services). I would like to broadcast workbooks as a pdf file to some user.
    When i open the workbook and go to Broadcast --> Setup a broadcast setting for this workbook. The distribution type is
    Broadcast E-mail; Broadcast E-mail (Bursting); Broadcast Portal; Broadcast Multichannel and Output Format only MS Workbook and Link to current Data. Here i miss the possibility as PDF.
    Where can i set up that the workbook should be broadcast as PDF.
    Any help appreciated.
    Thanks and kind rgerads,
    Murat

    Thanks all for your answers,
    i also read that with changing the format in Report designer then broadcasting via PDF. Is there no possibility for PDFs for MS Excel Workbooks? How does it work when opening the query in Report designer? What do i have to do there but it is no solution for us because in the workbooks we use GET BEX DATA formulas and just show parts of the analyisis grid. I need a proper solution how to use broadcaster converting workbooks into PDF an send them as email attachment
    Thanks,
    Murat

Maybe you are looking for

  • How can i deploy two different versions of the same application on the same server??

    I have two different versions of an application. One is a released version. And another version under development. I need to port this version of the application to the same server. I'm using the same classes and packages(except for some new ones). I

  • WebI aggregation on top of BW query

    Hi, I'm having problems with aggregated values shown on WebI when using percentage values. As an example:                                                                        Actual 3    Actual 2    %                                                

  • Safari for Mac, webpage with Java applet, drag and drop area not working.

    At my company, we have a web page that our users access to submit media files, (QuickTime, Audio, images...), for transcoding for delivery.  The web page consists of a java applet, with an area that our users drag and drop media file into. After upda

  • I just got an iphone 4s and the app store is in Chinese (I think)

    I just got home with my new iphone 4s and the iTunes and App Store are using what I think is Chinese.  How can I change their settings so that they use English?

  • How can I outline signature pic in Mail

    Whenever I put a jpg in mijn signature (preferences) and edit it to outline to the right. It puts the file right in the signature window. Once I close it and start a new mailmessages the jpg is on the left again. Going back to the preferences the jpg