Mail attachment with UDF in SAP PI 7.1

Hello,
I need to reproduce this solution in PI 7.1
/people/samuel.chandrasekaran2/blog/2008/10/06/xi-mail-adapter-dynamically-building-attachment-and-message-body-content-using-a-simple-udf
It is about  adding lines of a message as an attachment to a mail.
The UDF works for all elements except the lines for the attachment itself.
In order to build the content of the attachment (for this particular requirement) they are using a global variable declared and initialized in the global sections.
But the button for the Java Section to use an imported archive is no longer available in PI.....
So how to solve that issue?
I tried to use a graphical variable instead of a global variable but I have no idea how to add the n lines
from the source message as one import object into the UDF via that graphical variable.
Your ideas are very appreciated!
Best Regards
Dirk

Hi,
yes, it is a little bit different. This is the issue.....  
But I am not sure if your links will help:
1) /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
is about a different solution. I do not need to count the number of lines of the source message.
And the second variable is about concat line by line from unbound node to unbound node.
My issue is:
Souce:
Message line (0...unbound) ! ! ! ! ! ! ! !
.    ResultLine   (1..1)
Mapping:
=>   ResultLine1
       ResultLine2
       ResultLine........          => into UDF to an element  (1..1) in one mapping operation.
So that all "ResultLine"s are included.
The result is explained in the given link for Mail attachment with UDF.
So I am not sure how to use this thread for my issue.
In the comments of that blog Christoph Gerber writes that the new variable feature can only handle single values.
So it is not suitable for my purposes as I have a list of values here that needs to be moved into the target message field.
2) http://wiki.sdn.sap.com/wiki/display/Java/UsingEditJavaSectioninMessageMapping
shows where to find the button "Java section" which is not available here in 7.1
3) /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
too is about the nice little button for Java Section that is no longer existing on PI 7.1 screen for mappings.  
So my issue is: How to replace the Java section function with global variables in PI 7.1?
Best regards
Dirk

Similar Messages

  • Sending XI-Content as Mail Attachement with specific Filename

    Hi,
    I want to send the Message-Content as a mail attachment with a specific Filename (e.g. 2005-08-31.csv). The content is a CSV File, not a XML
    In the scenario an IDOC is sent to the XI mapped in a CSV-File (via Java-Mapping) and should be send as a Mail Attachment.
    Is this possible and how?
    Thank you for your help
    Thomas

    Hi Thomas,
    You can influence the filename with the ModuleTransformBean. You need at least SP9 for this feature.
    In the Mail Receiver Channel got to tab "Module"
    As first module (before the mail module) enter:
    localejbs/AF_Modules/MessageTransformBean as Local Enterprise Bean with any key
    For this module key you can use in the module configuration following entries:
    Transform.ContentDisposition inline|attachment;filename=<filename>
    Transform.ContentDescription <Filename>
    Transform.ContentType <MimeType>/<SubType>;name="<filename>"
    If you want to send an attachment, use:
    Transform.ContentDisposition attachment;filename="MyFile.csv"
    Transform.ContentDescription MyFile
    Transform.ContentType text/plain;name="MyFile.csv"
    If you use the Mail Package, you can set the file name that way:
    <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
      <Subject>Hello</Subject>
      <From>[email protected]</From>
      <To>[email protected]</To>
      <Content_Type>text/plain;name="MyFile.csv"</Content_Type>
      <Content>Here comes the CSV Data</Content>
    </ns:Mail>
    Hope that helps,
    Stefan

  • Sending a document as an mail attachment with approve and reject button

    Hi all,
         i have an infopath form where a user fills the form and on submit the form is saving as an document in the document library,
    now my question is, how can i get this document as an mail attachment with approve and reject option.

    Hello,
    You need to hide them on form load for user. Add one more hidden control in form and keep control value blank initially. Now add rule on button submit to set the control value to some other so you can hide/show the button.
    Now add rule on approve and reject buttons that, if field1 is blank then hide this control.
    http://office.microsoft.com/en-in/infopath-help/add-formatting-rules-HA101783371.aspx
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Mail Attachment with attachment name = mail subject name

    Hi,
    I am using the mail adapter and today I am using hard codes attachment names using the MessageTransformBean. I have read the blog /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution about dynamic filenames but how do I get the eMail subject as a viriable to create the attachment?
    Thanks
    Juergen

    Juergen my weblog was the simplest suggestion to your issue - you can put the mail subject anywhere in
    message get it (and remove) in the adapter module
    you can also try to get the
    Adapter-Specific Message Attributes from the adapter module 
    http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/content.htm
    but I'm not sure it the second solution works with adapter modules - but you can do an easy check
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Mail attachment with time stamp

    Hi
    My scenario is Proxy to Mail.
    On receiver side I am getting the data as an attachment but i want that attachment with time stamp.
    How to add time stamp to the attachment in reciever mail adapter.
    Regards
    Sowmya
    Edited by: Sowmya on Aug 28, 2008 12:24 PM

    hi sowmya,
       The bellow link for MessageTransformBean..
      [http://help.sap.com/saphelp_nw70/helpdata/EN/57/0b2c4142aef623e10000000a155106/content.htm]
      In that ContentDisposition is used to fill the value for Attachment file name..
      Its allows the value accordingly "RFC1806" Note..
      RFC1806 allows accordingly RFC822 ..
      Check RFC822 ..
        5.  DATE AND TIME SPECIFICATION
    Regards,
    Prakasu

  • Sapscript via mail: attachment with body

    Hi all
    I need your opinion in order to solve the problem in object
    I've an old bill message to be sent via mail, so I've set the customizing by NACE and now it works fine
    The problme is the sapscript is attached to e-mail as pdf but any text is inserted to body mail:
    any text can't be inserted: I saw the note 753622 (Sending of body text and PDF attachment with medium 5), it speaks clearly, it's not possible to add a text.
    So the only solutions seem to be:
    - to try to change the form function in order to add a text as note [like here|Setting Mail Subject and Body;
    - Send the mail by your self (getting OTF data) 
    How have you solve it?
    Thanks
    Max

    Hi Max,
    If I need any sort of email body for an output-based email, I always implement a custom processing routine with mode '5' or mode '8' and leverage existing data retrieval calls where possible.  As you've seen, SAP's output processing options are very limited and clumsy for email processing.  A more professional HTML email body is the way to go - your best option is to handle it yourself.
    Brad

  • Can you create a pdf e-mail attachment with working hyperlinks?

    I'm trying to figure out how to generate an e-mail with working hyperlinks where the recipient doesn't have to open the pdf for the links to work...in other words, when they open the e-mail and view the pdf as it is displayed, the links are visible and the viewer can click on them and go to a URL. I see this all the time, and can't figure out how to do it with a pdf (I've added the links with the link took in pdf and they display within the application window, but disappear when the file is an e-mail attachment) or with html. I've attached the pdf that I'm trying to make interactive within an e-mail message. Any help that can be provided is much appreciated!

    Michael your answer is colored by the fact you use an ASCII (Text only) News Reader.
    The answer is more along these lines:
    PDF's can be created with working hyperlinks.
    They can be automatically be brought over from programs such as MS Word, Open Office, and such  provided your on a PC Platform
    they can actually be viewed and clickable from Acrobat or Reader PC Versions, if created from a PC Version.
    they are not viewable or clickable if created from Mac version of Office.
    They are viewable and clickable from a PC if created from Mac version of Office (Word/Excel)
    The Mac can can not do so automatically you must do them Manually with in Acrobat.
    in Past it has been a Pain to do so though may be different in version 9
    If you use a browser Plugin such as Schubert's PDF Browser Plugin that works on Safari, fireFox, Camino, SeaMonkey Opera, OmniPage, iCab. Links you create in Mac version of Acrobat are viewable and clickable.
    Finally MS and Adobe have been having this on going problem since the day's PDF's first hit the market. (Version 1.) and MS  decided to support them. The hooks are there for both PC and Mac versions of Word. and either are capable of being created and acted upon on whether created by the Mac version of Office, or the PC version of Office, but only on a windows PC. Its clearly a problem of Acrobat/Reader on the Mac. Its either a problem Adobe won't own up to, or they can't solve or, this is one item they can't be bothered with to put in the Mac Versions.
    Some of this information is based on my participation in the msnews. nntp newsgroups for Office Mac. The experts there for the most part (MVP's) use both Mac and PC's and have investogated the problem themselves and been give information from the MacBU (Mac Business Unit) at MicroSoft. The basic internal code of Office 2003/2004 is the same. The UI is different and key cobinations are different. And same for 2007/2008 except office 2008 don't support VBA and Macros, and neither 2004 nor 2008 have MasterPages, And thankfully according the the MVP's Thankfully the Robbonis not supported on 2008.

  • Need Java Coding to sent File in a Mail Attachment with MIME Type with SMTP

    Hi Experts,
      I need java code to sent a file in an email attachment with MIME type.
      Please provide me.
    TYhanks
    Bhaskar

    Hi Stefan,
      Thanks for your Blog.
    The same java mapping is been used in my current system, but the legacy system cannot read
    some emails as they are asking us to send the email in MIME format.
    Already i am sending in MIME format itself.
    They can read some Emails and they cannot ream some Emails.
    I think the problem could be their exchange server.
    Can you please suggest on this.
    Regards,
    Bhaskar

  • Sending SmartForm as E-mail attachment, with email subject and content

    Hi,
    I'm, e-mailing a SmartForm using the SmartForm parameters (MAIL_RECIPIENT, MAIL_SENDER and MAIL_APPL_OBJ) using control device 'MAIL'.
    Create MAIL_RECEPIENT (swotobjid): CREATE_RECIPIENT_OBJ_PPF
    Create MAIL_SENDER (swotobjid): CREATE_SENDER_OBJECT_PPF
    Create MAIL_APPL_OBJ: This works a little different. The sender needs to have an SAP Office Inbox (SO_USER_AUTOMATIC_INSERT) where a folder is to be created using the marco's swc_create_object and swc_object_to_persistent (INCLUDE <cntn01>).
    Everything works fine.
    The mail is being send and the SmartForm can be accessed as attachment, the E-Mail subject (as the name of the attachment) is taken from the title of the SmartForm (output_options-tdtitle).
    QUESTION *
    No they want to change the E-mail subject en change the content(body) of the mail.
    Is this possible within the options of the MAIL_APPL_OBJ.
    Or do have to rebuild the SmartForm program, get the SmartForm as OTF, rebuild as PDF en mail the PDF to the recepient using the SO_NEW_DOCUMENT_ATT_SEND_API1.
    I was thinking of creating a container and set the elements of that container (swc_set_table ?) but I don't no in the end if this woll work.

    Refer the following Blog-
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417300)ID0426134050DB01517382336190791762End?blog=/pub/wlg/1798
    generate filename as yesterday's yyyymmdd format, and it must send file with same name with yyyymmdd
    You need to use the following UDF to generate yesterday's date-
    Imports: java.text.;java.util.;
    public String yesterday(Container container)
    long oneDay = (long) 1000.0 * 60 * 60 * 24;
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    java.util.Date today = new java.util.Date(System.currentTimeMillis());
    java.util.Date yesterday = new java.util.Date(System.currentTimeMillis()-oneDay);
    String b = dateFormat.format(yesterday);
    return b;
    Map this with Content_Disposition as mentioned in wiki.
    XI 3.0 message must be executed one a day automatically (for example at 9.00 Am).
    Use 'Availability Time planning' for CC as mentioned above.
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/06bd029da31122e10000000a11466f/content.htm

  • Sending PO in mail attachment with pdf format

    Hello,
    We are sending PO to vendor in a pdf attachment. The configuration is in place and as soon as the PO(ME22N) is saved the pdf mail is sent to vendor external mail address.
    The requirement however is to add some text to this mail body ( in addition to the existing PDF attachment ).
    The NACE config is using SAPFM06P program with entry_neu form and a custom sap script.
    can somebody help as where is this mail functionality added in this standard program so that I may try to customize the same for the above requirement.
    All I can see is 2 FM used in this ENTRY_NEU Form. Of which I guess ME_PRINT_PO is sending the mail ( I may be wrong here ) but where ?
    I will be thankful for any kind of hint to help solve this issue.

    In general you will have to do the following:
    1) Set NAST-NACHA = 8 (Special function)
    2) Before OPEN_FORM (maybe in In enhancement spot) if NAST-NACHA = 8, then set itcpo-tdgetotf = 'X' (to get OTF back from CLOSE_FORM!)
    3) During CLOSE_FORM, if NAST-NACHA = '8', get OTF output from TABLES parameter OTFDATA
    4) Convert this OTF output to PDF using following sample code:
    data: I_PDF STRUCTURE  TLINE occurs 0,
            I_OTF i_otf LIKE itcoo OCCURS 0.
        CALL FUNCTION 'CONVERT_OTF'
             EXPORTING
                  format                = 'PDF'
                  max_linewidth         = 134
             IMPORTING
                  bin_filesize          = w_bytes
             TABLES
                  otf                   = i_otf
                  lines                 = i_pdf
             EXCEPTIONS
                  err_max_linewidth     = 1
                  err_format            = 2
                  err_conv_not_possible = 3
                  OTHERS                = 4.
    5) Send email with PDF attachment using the method(s) mentioned in one of these excellent blogs:
    /people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    or you can follow below procedure as well:
    I suggest you make yourself very familiar with the SAP code that does this automatically. Once you understand the processing sequence SAP uses, it is much easier to add your customization and insert your enhancements. To debug it and step through the code, but a breakpoint in ENTRY_NEU, and process a PO. If you're sending your messages using a scheduled job, you'll hit the breakpoint when you process the message using RSNAST00. That's how I did it. I can tell you what I did to meet my requirements. You can change to meet your needs. It required a custom program, to use instead if ENTRY_NEU, and 3 enhancements to SAP code using the Enhancement Framework. You need to know how to use the framework. 1. configure your output type ZNE2 to to run a new program ZMRP_OUTCTRL, to run form routine ENTRY_ZNE2, to create form Z_PURCHASE_ORDER. 2. In ZMRP_OUTCTRL, call standard function modules, ME_READ_PO_FOR_PRINT and ME_PRINT_PO. 3. Drill down into ME_PRINT_PO to PREPARE_FORMULAR function module. Create new enhancement, and if NAST-KSCHL = ZNE2, then lookup the recipient's email address. Pass it as parameter to ADDR_GET_NEXT_COMM_TYPE. 4. Still in ME_PRINT_PO, PREPARE_FORMULAR, add another enhancement to set the value of itcpo-getotf to u2018Xu2019, to enable CLOSE_FORM to capture OTF data for PDF. Only set this OTF flag when the output is being run by RSNAST00, not when a user is simply previewing the printout. Sy-ucomm will be blank when RSNAST00 is running. 5. In ME_PRINT_PO, drill down to ENDE, and add an enhancement to check for NAST-KSCHL = ZNE2, and if so, call standard SAP function modules to END_FORM, START_FORM, WRITE_FORM, and END_FORM. Next call the function CLOSE_FORM, and set table parameter to capture the OTF_DATA as a table parameter OTF_DATA. 6. If OTF_DATA is found, then: If nast-kschl = 'ZNE2'. if NOT otf_data[] is initial. gs_OTF[] = otf_data[]. CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' IMPORTING bin_filesize = v_len_in TABLES otf = gs_otf lines = gt_pdf EXCEPTIONS err_max_linewidth = 1 err_format = 2 err_conv_not_possible = 3 OTHERS = 4. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'OTF Conversion failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'OTF Conversion failed.'. ENDIF. EXIT. ENDIF. CALL FUNCTION 'QCE1_CONVERT' TABLES T_SOURCE_TAB = gt_pdf T_TARGET_TAB = outbin. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'PDF Conversion failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'PDF Conversion failed.'. ENDIF. EXIT. ENDIF. *get email recipients (this is specific to my requirements) select single banfn ernam zuname1 into (lv_banfn, lv_ernam, lv_zuname ) from eban where ebeln = nast-objky. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'Requisition Data not found.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'Requisition Data not found.'. ENDIF. EXIT. ENDIF. 8. Build your OBJPACK and OBJBIN parameters: describe table mail_content lines lin. read table mail_content index lin. mail_data-doc_size = ( lin - 1 ) * 255 + STRLEN( mail_content ). clear objpack-transf_bin. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = lin. objpack-doc_type = 'TXT'. APPEND objpack. describe table outbin lines lin. read table outbin index lin. objpack-doc_size = ( lin - 1 ) * 255 + strlen( outbin ). objpack-transf_bin = 'X'. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = lin. objpack-doc_type = 'PDF'. objpack-obj_name = 'ATTACHMENT'. objpack-obj_descr = l_descr. APPEND objpack. CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' EXPORTING DOCUMENT_DATA = mail_data PUT_IN_OUTBOX = 'X' TABLES PACKING_LIST = objpack CONTENTS_BIN = outbin CONTENTS_TXT = mail_content RECEIVERS = 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. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'Send Email function failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'Send Email function failed.'. ENDIF. EXIT. ENDIF. 9. Call function CLOSE_FORM, and end enhancement
    Edited by: Devireddy omkar on Aug 2, 2011 11:15 AM
    Edited by: Devireddy omkar on Aug 2, 2011 11:17 AM

  • Sending mail attachment with long filename in 4.6C

    Hi everyone,
    Our requirement needs to have a custom program to send a mail with a pdf attachment, which we have managed to work so far.  The problem is that the filename is 37characters long, which is absolutely necessary.  For example, my pdf filename can be
    072346843023332201_20100720_120101.pdf
    In the function that we used, SO_NEW_DOCUMENT_ATT_SEND_API1, the field where the filename is stored (field SOPCKLSTI1-OBJ_NAME) is only 12 characters long.  This poses a problem when we try to attach the pdf file. 
    So my question is if there is an alternative function module or way that we can attach the pdf with the file name still complete?  The SAP version that we are using is 4.6C.
    Thanks in advance.

    helllllllllooooooooooooooooooooooooo
    anybody
    Sara

  • Mail Attachment with OCS10g Workspaces

    Hi All,
    In OCS Webmail or WAC, Is it possible to attach files which are stored in OCS10g Workspaces?

    Not directly, however we do have an enhancement request to allow users to browse Content Services and Workspace libraries from WAC and include a URL or actual document as an attachment to an email. A few options in the mean time
    1) If you are using the Oracle Drive(to be released in the coming weeks), you can attach content from a Workspace Library (or Content Services) by navigating to your mapped drive and attaching the content.
    2) You can use the Workspace Notify feature to send a link to any item in a workspace.
    3) Also with the Oracle Drive, you can right click on a document and 'copy url to clipboard' for easy access to past into an email.
    4) Many URLs in Workspaces will not change (see chapter 5 in the Workspaces Application Developers guide). You can copy and paste the URL from these pages and it any end user with access to the workspace can access these pages.
    Hope that helps.
    -Jason

  • I have failed to open my mail attachment with yahoo firefox despite having downloaded it

    i received an email with an attachment, downloaded it. but i have failed to open it

    Hi,
    These are for Android:
    *[https://play.google.com/store/search?q=read%20doc%20files&c=apps&hl=en Search on the play store for doc file readers]
    * I could not find any add ons for Android for this.
    *There is Doc viewer but this is for google docs
    These are for desktop:
    *[https:// support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file Change what Firefox does when you click on or download a file]
    *[https://support.mozilla.org/en-US/kb/cant-download-or-save-files]

  • Open e mail attachement with?

    I am using both safari and firefox and when I receive an e mail with an internet link, my computer uses safari to view. If i want to change to Firefox, how do 'i change this preference??
    In addition, I have just loaded office 2008 and it is now the default for word or excel e mail attachments. How do I revert to office 2004 as default?
    Thanks
    Allan

    Mac Allan wrote:
    Hi Matt & Joshz;
    I tried both of your suggestions, the apple + l creates an alias
    ah, sorry, that was a capital i (looks like: I), not a lowercase l (looks like l). I can see your confusion!
    the apple + i brings up the "open with" tab, I make the changes as suggested and apply to all but when I test this by going to an e mail that has been received, an excel document opens with excel 2008, not 2004.
    Do other excel documents open with '08 or '04? What about word and powerpoint? Did you maybe forget to change excel?
    Good luck!
    Josh

  • E-Mail Attachement with JSP

    i want to email with attachement throuhg JSP.
    is it possible to directly attach attachement File with email-message from client PC without uploading attachememt file to web Server.
    please provide code if possible
    thanx

    There is no way to send an attachment from the client's PC without first uploading the file to the server and then sending the email with the attachment.

Maybe you are looking for

  • Can't use iCloud on PC?

    I cannot sign into my iCloud account with my existing apple ID. Its saying my apple id is valid, but that it is not an iCloud ID. I just purchased ITunes match and want to be able to download my music. I am currently running a PC with Windows 8. And

  • How can I get rid of multiple pictures at the same time?

    how can I get rid of multiple pictures at the same time?

  • Automatic billing document creation upon saving credit memo request.

    Hi, I have a requirment where in : When a Credit Memo Request is created(va01) and upon saving the credit memo request an automatic billing document needs to be genereated i.e Credit Memo. How can this be achieved. Thanks

  • Window 8.1 Dose Not Play .mpg2

    Hello Everyone. I have a new computer window 8.1.  I noticed, when I Import my .mpg movies inside Premiere Pro, I do see the movie. But When I export It I can only hear the sound. Also, If I Double Click on any .mpg movies, In my Desktop, I can only

  • Detail info needed in the report

    Hi , We have a summary infomation for one key figures(say sales value for item - "T-shirt" for example), but I don't have the info about the detail level info inside the item("T-shirt" -- color red, yellow or green). I want to know in the report abou