Can XI Message be mapped to a flat file attachment in Mail adapter

Hi guys,
I have a requirement, where I have ECC system seding a XI message to XI.
Now XI has to convert this to a flat file may be tab delimited and send this as an attachment in email using receiver mail adapter.
I want to avoid BPM and make it simple.
Appreciate any help on this topic.
Regards
Sujan

Hi,
Here are some mapping examples.
/people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file
/people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
/people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi
/people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
/people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
Vishal

Similar Messages

  • Can we cleanse and transform data at flat file or external table level?

    Hi,
    I have some data that I want to cleanse and transform. I don't want to cleanse it after i populate the external table, I want to get done with it at flat file level or while populating the external table. Can we cleanse and transform data at flat file or external table level through Oracle or OWB 11.2? Is it possible to run a conditional load (i.e. having a where clause or if-else-then) for an external table? Can we call oracle functions for an external table at the time of creation?
    Thanks in advance.
    Regards,
    Ann.

    Hi Oleg,
    Thanks a lot for the clarification. :)
    So is there a way that I can clease the data within the text file through Oracle or OWB? I have datatype mismatches in the data and most of my data is getting rejected because of that. The way I can think of, for solving this problem, is to create the external table with all fields with datatype varchar and then cleansing the data. But it doesn't seem very effecient plus it will get very complicated because I have almost 80-90 fields.
    Any help?
    Thanks and regards,
    Ann.

  • How to determine the size of a flat file attachment in a mail sender cc?

    Hi
    I use PI 7.11
    I have a scenario where a flat file attachment is being picked up by a MailSender adapter and if the size of the attached flat file is larger that 500 bytes the receiver is A and if the attachment is less that 500 bytes the receiver is B.
    I have checked the Context Object list in the Conditions section of Receiver Determination, and it seems, that only the file adapter allows for validation on the file size.
    I contemplated an extended receiver determination but the attachment is a flat file which just needs to be passed thru without being converted to an XML document, so my source document is not of XML format.
    An other but not very nice way would be to use an intermediate folder to drop the attachment in and from there use a file sender adapter and thus get access to the filesize attribute in my receiver determination, but I would like to avoid this.
    Any suggestions?
    BR MIkael

    Hi
    I have decided to make a module, where I plan to place the size of the attachment in the Dynamic Configuration variable "ProcessStep", but to my surprise, it seems that all the context objects in the receiver determination condition section are of type String and hence it is not possible to make a condition where I test for whether the value is smaller than say 500!? Only equal, NOT equal and LIKE are available (EX seems to be disabled as this probably only works in an xpath.
    Would one way be to use the xpath expression like this ns1:Main\ProcessStep < 500 where ns1: http://sap.com/xi/XI/System?
    MIkael

  • I can't build an xsd for a flat file (txt) to handle repeating records

    Hi - have looked at many posts around flat file schema and they don't seem to address my question.
    I have a flat file that is \n delimited
    the pattern of the data is simple:
    record1 - 90 characters
    record2 - 20 characters
    record3 - n 248 characters - each of these records is parsed into children by the positional method
    record n+1 10 characters
    record n+2 20 characters
    so I used the flat file schema generator to generate the schema and built a map mapping the flat file schema to another xml schema. The schema looks ok - record1, record2, record n+1, record n+2 are child elements of the root. the repeating record
    section is showing up as a node with the parsed children.
    The transform is only mapping the children of the repeating records. When I test the map only the first repeating record gets parsed. No repeating happens (the actual flat file has 400+ repeating records). When I run the map in debug mode, the input
    xml shows that record1 is read in correctly, record2 is read in correctly, record3 is read in and parsed and record4 is treated like record n+1 and record5 is treated like record n+2 and the map thinks it's all finished.
    the section of the repeat part of the schema is and you can see that I set the minOccurs=1 and maxOccurs=unbounded for the node (INVOICE) and the complexType but this is not an affective syntax. I have looked at how the EDI X12 schema look and how they handle
    looping and it is a lot different than what the Flat File schema wizard is doing. Is there a good set of rules published that would guide me though this? otherwise I will basically have to read in the lines from the file and parse them out with functoids -
    seems so inelegant. Thanks in advance.
    <xs:element minOccurs="1" maxOccurs="unbounded" name="INVOICE">
              <xs:annotation>
                <xs:appinfo>
                  <b:recordInfo structure="positional" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
    />
                </xs:appinfo>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence minOccurs="1" maxOccurs="unbounded">
                  <xs:annotation>
                    <xs:appinfo>
                      <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003"
    />
                    </xs:appinfo>
                  </xs:annotation>
                  <xs:element name="SegmentType" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" pos_offset="0" pos_length="2" sequence_number="1" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>....... more children elements
    Harold Rosenkrans

    Thanks for responding
    I gave up trying to parse the repeating record into fields. Instead I just loop through the repeating record section with an <xs:for-each> block in the xsl and use functoids to grab the fields.
    So that works for having the two, shorter header records (structure is positional) before the section of repeating records. Now I just have to figure out how to get the schema to handle the two, shorter trailer (or footer, whatever you prefer) records after
    the section of repeating records
    the error I get in VS when I test the map is [BTW I changed the element names in the schema which is why you don't see INVOICE in the error]
    When I declare the last element as being positional with a character length of 10 I get the error:
    Error 18 Native Parsing Error: Unexpected end of stream while looking for:
    '\r\n'
    The current definition being parsed is SAPARData. The stream offset where the error occured is 1359. The line number where the error occured is 9. The column where the error occured is 0. 
    so the first record is 77 char in length and the second is 16 char and then the repeating records (5 in the file) are 248 char and the last record is 10 char
    so an offset of 1359 puts it beyond the last record by 16 characters - so the stream reader is looking for the next repeating record.
    if I try to declare the last element as delimited I get the error:
    Error 14 Native Parsing Error: Unexpected data found while looking for:
    '\r\n'
    The current definition being parsed is SAPARData. The stream offset where the error occured is 597. The line number where the error occured is 5. The column where the error occured is 0. 
    so the first record is 77 char in length and the second is 16 char and then the repeating records are 248 char.
    a stream offset of 597 puts me 8 characters into the third repeating record - at this point I have only declared one trailer record in the  schema, 10 characters long.
    Why is stream reader stopping at such a weird spot?
    The bottom line is I still haven't discovered the correct schema to handle the trailer records. even if I set the maxOccurs="4" (for the repeat record declaration) it still gets the first error. How does it find an unexpected end of stream looking
    for \r\n when the maxOccurs for the repeat record declaration should have the stream pointer in the 5th repeat record.
    I unfortunately don't have any options concerning the file structure.
    I have read a lot of posts concerning the trailer issue. I have seen a couple that looked interesting. I guess I'll just have to give them a try. The other option is to create a custom pipeline that will only take file lines of 248 characters.
    That's just disgusting !
    Harold Rosenkrans

  • Mapping idoc to flat file

    Hi Friends
    I Have to map one idoc to cvs flat  file , the file structure has 10 fields , those 10 fields have to be repeated as many times as there is segments in the idoc for instance
    the first line takes segmenta A and the second line takes segment B and so on
    segment A goes to line 1  f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
    segment B goes to line 2  f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
    segment n goes to line n   f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
    how ca I best do that and does any one have a solution example.
    many thanks in advance.

    Do like this,
    Create the target structure like this:
    <b>Records</b>     with 0.....unbound
    -<b>Line1</b>      with 0---unbound
    Field1   with 0:1
    Field2   with 0:1
    Field3   with 0:1 (and so on...upto Filed10)
    ---<b>Line2</b>
    Field1   with 0:1
    Field2   with 0:1
    Field3   with 0:1 (and so on upto Field10)
    uto n..
    Now map the IDOC segments to Line1, Line2...upto n.. & aslo map the respective fields of idoc to field1, field2, and so on....
    Use FCC in ID to convert it into CSV see the below mentioned blog.
    <b>File Receiver with Content Conversion</b>
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    I hope it will help you to get your result.
    Regards,
    Sarvesh
    ****Rewards Points for helpful ans..

  • Can we handle content convertion for TabDelimiter flat file in JMS

    Hi,
    Is it possible to handle content conversion for TabDelimiter flat file in JMS (Not in FILE adapter).
    If possible .. can you please explain.
    Regards,
    Siva.

    Hi, Siva:
    Yes, this is possible.
    The way that JMS adapter to handle content cnversion is similar to the way file adapter does.
    Different from file adapter, you do not have to specify "Content Conversion" as transport protocol, you need to use transformation bean (localejbs/AF_Modules/MessageTransformBean) in Module tab.
    Check page 23 of the following link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a05b2347-01e7-2910-ceac-c45577e574e0
    Liang

  • How can I download from R/3 to flat file?

    Hi
    My requirement is to download Material and Supplier data from R/3 to flat file...
    These are the fields I have to bring it from SAP R/3 but I don not want to DOWNLOAD FM. I want to Concatenate from Internal Table and put it on application server.
    There are my following fields...
    Material and Supplier
       1. Selection criteria
             - Based on plant
             - Hubs and FSL/Hubs
             - Hubs can pull both Repair and NewBuy vendor
             - FSL/Hubs pull only Repair vendor
       2. Material – EORD-MATNR
       3. Region – Determined by 9* plants
       4. Site
             1. plant-(W) and plant-(C) for FSL/Hubs
             2. plant-(S) for DCs
       5. Supplier
             1. Menlo/Repair for DC
             2. Repair only for hub/fsl
       6. Supplier-type – PURCHASE or REPAIR
       7. Leadtime - (The number of days between placing an order and receiving an order)
       8. Order Horizon – “2”
       9. Minimum OQ – “3”
      10. Order cost – “50”
      11. Supplier part number – EORD-MATNR
    Waiting for some help and (or) sample code for this...
    Thanks in advance.

    Here is an example program showing how to write a tab-delimited file to the application server.  All you need to do is get all your data into an internal table, then loop at it, concatenate all fields into a string and then transfer that string.
    report zrich_0001.
    parameters: d1 type localfile default '/usr/sap/TST/SYS/Test.txt'.
    data: begin of itab occurs 0,
          field1(20) type c,
          field2(20) type c,
          field3(20) type c,
          end of itab.
    data: str type string.
    constants: con_tab type x value '09'.
    * if you have a newer version, then you can use this instead.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    start-of-selection.
    itab-field1 = 'ABC'.
    itab-field2 = 'DEF'.
    itab-field3 = 'GHI'.
    append itab.
    itab-field1 = '123'.
    itab-field2 = '456'.
    itab-field3 = '789'.
    append itab.
      open dataset d1 for output in text mode.
      loop at itab.
        concatenate itab-field1 itab-field2 itab-field2 into str
                      separated by con_tab.
        transfer str to d1.
      endloop.
      close dataset d1.
    Regards,
    Rich Heilman

  • Create Mapping As a Flat File Source

    Hi,
    I'm new to OWB, my first project is to load data through flat file to oracle.
    step i follow is,
    =>Create Flat File Module
    =>Create Location Directory
    =>Create Flat File
    =>Create External Table (Synch with my Flat File)
    =>Create Mapping (Simple External Table mapped to table operator)
    =>Create and bind table Operator
    Mapping successfully deployed and but when i want to run it gives me following Error
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file IPDirectory.txt in FLAT_FILE_MOD_LOC_0 not found
    When I directly mapped flat file to Table in mapping it gives another error
    RPE-01013: SQL Loader reported error condition, number 4.
    SQL*Loader-522: lfiopn failed for file (\\sfs\Analytics\Reference\SIMPLE_MAP.log)
    I mention here that im working on my pc with OWB Client not on server and want to load data through flat file which is on my pc or on our sharing drive.
    Please help me on this issue
    Regards

    Hi,
    OWB generates SQL * Loader code for Flat File operator, if you try to change the configuration parameter to PL/SQL it results in error.
    External tables would be a better choice as it reduces the processing time, disk space required and also makes it possible to use SQL and other complex transformations.

  • From message to attachment in Mail adapter

    Hello,
    I am searching for information about this issue:
    An incoming message from a WebService needs to be mapped to a target structure . SAP PI has to create a file (csv) and add it as an attachment to a mail.
    So this is the process:
    WebService -> Mapping -> File -> Attachment in eMail
    I am not sure if this is possible to move the target structure as a csv-file attachment into the eMail.
    Please can anybody help!
    This is really appreciated!
    Best Regards
    Dirk

    Thank you, Hareenkumar!
    The first link seems to be the right one to help me!
    So the solution should be to use a Java mapping to generate the required file structure
    and add it then as an attachment to the mail.
    And thank you, Abhishek!
    I will try this first as it seems to be easier to implement for me.
    But this needs some weeks as we are analyzing requirements currenly and need to find out what is possible with PI and what is the effort for impolementation!
    So I will come back later!
    Regards
    Dirk
    Edited by: Meinhard Dirk on Dec 7, 2010 12:09 PM

  • Mail adapter flat file attachment

    Hi,
    From my limited knowledge of XI, I know that we can send an email attachment as an .xml file or a binary file. My question is how can I send a flat file as an attachment using XI's mail adapter? If this is possible, please suggest steps how to do this as I am clueless!!
    Thanks for your help...
    Chandu

    Hi,
    check out this Blog you will be able to do it.
    You can do either using Mail package or just using Mail adapter.
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm
    Thanks,
    Prakash

  • IDOC to email (flat file attachment) scenarion

    Hello everybody,
    I'm working with XI 3.0
    I have a scenario IDOC - XI - flat file, but the file need be sent by email and not by FTP.
    Using normal configuration of email communication Channel , i notify is not possible sent a flat file, but only XML.
    So i decided to devide interface in 2 step.
    1- IDOC - XI - FTP for create the file
    2- FTP - XI - EMAIL for send file to destination as a email attachment.
    this is a correct approach?
    IT's possible take a file from a FTP server and send by email as an attachment (without any mapping)?
    There is an document example?
    thanks in advance
    Alex

    Hi,
    its possible in one scenario as well,
    one of following example will help you have attachments.
    http://www.riyaz.net/sap/xipi-sending-emails-using-xi-mail-adapter/83/
    http://wiki.sdn.sap.com/wiki/display/XI/DynamicEmailAttachmentnameforReceivedMails
    Besides these you also need to use module adapter.
    use MessageTransformBean for content conversion.
    use link - http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/frameset.htm
    Also it is possible that you may have to use another module as payloadswapbean.
    But first 2 suggestion will work.

  • TS3276 Hi.  Just started using Mac Mail on a macbookpro v10.6.8.  I tried to send a message with two excel (for mac) files attached.  One attached as a file, one inserted all the text into the message body.  Help?

    Just started using my Mac Mail program instead of web mail.  When I went to attach two pdf files, one attached as a file, the other inserted all the text into the body of the email message.  How do I get it to attach both pdf's as files?

    I think you're confusing two different things. If you attached PDF files and one of them displayed the PDF icon in the message window, that means it was more than one page. If you saw what appeared to be the actual document for the other PDF file, that means it's only one page and it's normal for it to display that way.
    However, I seem to recall there may (or should) be a button at the bottom-right of the message window that allows you to display those files as icons, even if they're one page. If not, there's a third-party addition you can use to add that feature:
    http://lokiware.info/Attachment-Tamer

  • How can i send a folder containing multiple excel file to a mail address?

    hi ,
           i have report showing details sales report. Key field is customer id.  my requirement is to send the output of this report as excel file  to a mail id according to customer id. suppose there are 100 customer id , so 100 excel sheet will go to the mail. I have done it. But now  i want to send a folder or zip folder that's containing all the excel file to the mail id  so the mail user can download that folder at a time containg all the excel file. Is it possible ? if then how.  i have used cl_bcs , cl_document_bcs and if_recipient_bcs  these class and interface.
    I need your suggestion.

    Hi Sandipan,
    You can use some of this classes: CL_ABAP_ZIP or CL_ABAP_GZIP
    For example:
    DATA: OBJ_ZIP TYPE REF TO CL_ABAP_ZIP,
                ZIP_FILE  TYPE XSTRING.
    CREATE OBJECT OBJ_ZIP.
    OBJ_ZIP->ADD( NAME = <file_name>   CONTENT = CONTENT ).
    OBJ_ZIP->ADD( NAME = <file_name2> CONTENT = CONTENT ).
    ZIP_FILE = OBJ_ZIP->SAVE( ).
    You can also visit this Otto Frost detailed post on GZIP:
    http://wiki.sdn.sap.com/wiki/display/profile/GZIP
    I hope that helps.
    Regards,
    John
    Edited by: John Smith on Feb 5, 2012 2:21 PM

  • Creating Flat file using AS2 Receiver adapter

    Hello everyone
    This is my first AS2 scenario,we are sending 850/Purchaser order  information from SAP to partner.
    what is the processing sequence and module configuration parameters we need to mention for converting the target structure to flat file?
    Regards
    Uday

    Try to search Seeburger scenarios on SDN. There are many blogs and wikis availble now. There you may refer to BIC, classifier and split modules. Understanding of all these will help you in configuring the scenario. If you are stuck somewhere, come up with specific doubt.
    Regards,
    Prateek Raj Srivastava

  • Can anyone explain me the meaning of Minimum File age in FTP Adapter?

    I have set Polling frequency as 10 seconds and Minimum File Age as 2 minutes, but my file is getting picked up in first 10 seconds.
    But i want it to wait for 2 minutes and then pick the file from FTP location.
    Can anybody help in this to understand the meaning of Minimum File age ?

    Richa,
    As already explained above by another user it means that every time SOA looks for files (in this case every 10 sec) SOA should pick all the files that are atleast 2 Minutes Old. (i.e., the "Current Date Time" - "File Creation Date" >= 2 Minutes).
    It has nothing to do with the size of the file, as you mentioned in your example.
    e.g. File A of 2 MB requires 1.5 mins to write itself on FTP server completely, it is getting picked up in 2 mins only.
    File B of 8KB required miliseconds to write itself on FTP server completely, it is getting picked up in 10 seconds.... ISSSUE?
    Here the time when File A and File B arrived in the location matters.
    Say the same File A and File B are copied into location (say "D:/FilesToBeRead") at 10:20:30 AM, then the poller should pick up both these files at 10:22:30 AM as you had set your minimum file age property to 2mins.
    Hope this helps
    Thanks,
    Deepak.

Maybe you are looking for

  • Cant Access windows 8 after upgrading to mountain lion

    a few weeks ago i upgraded my lion to mountain lion i had windows 8 installed with boot camp on a seperate partition (i only use windows 8 for my astrophotography as certain specilised apps i use are sadly windows only) now as i hadnt had any clear s

  • Document message bar not visible when participating in Shared Review

    Hi, I have initiated a Shared Review using Acrobat Pro 8 Immediately after I finished sending out the notification to other reviewers, the _Review.pdf version of the document is opened for me and the Document Message bar is visible. Therefore I have

  • Regarding Weak Refrence

    Dear All, i am developing one application in jsp . i have been getting out of memory error in that,so i googled and found that using weakreference class will remove this,i have been implemented like this XYZ xyzobj = null; Reference ref = new WeakRef

  • Page with two iviews

    Hi all, I created in portal (portal content) a new page with two iviews. The first iview it is a bsp site with different links (html links). At the moment if I press a link in this iview WAD web template opens, but it open in the same iview and I wis

  • I need to transport R/3 Report in BW

    HI gurus,                I have a requireemt where in I need to pull a R/3 Sales report into BW , load the report daily into BW . Can anyone please tell me how to go aout doing it? Points Guranteed!!