Idoc to multiple file...

Hi Experts,
My Scenario is : Idoc to File We are using PI 7.1..
Requirement is when i trigger an Idoc,  at the target end at one location some fields of Idoc needs to be dropped as an .txt file and some fields of idoc needs to be dropped as an XML file in the other location of same FTP server.
Eg: If Idoc has 40 fields, in the txt file first 30 fields and in the XML file lat 30 fields needs to be dropped there is no condition checked for dropping the files, when an idoc triggers the contents of IDocs needs to be passed to both text and as well as XML file.
The file names for the both should be dynamically configured.
In ESR: --> Idoc needs to be imported, one data type for text file and another data type for xml file. so 2 data types & 2 message types, 2 services interfaces, one message mapping ( Need to use Multi Mapping), one Operation mapping.
In ID:  -->  My doubts: How many receiver communication channels are required? As we are using multi mapping  i think we need to use only one reciver comm channel ( Correct me if i am wrong).
what are the other configurations required here the receiver system is one so one reciever determination and one interface determination.
Note: File names for both the files ( Text and XML) needs to be dynamically configured.
Suggest me whcih one should be used either Variable substitution or Dynamic UDF..
Your valuable inputs are appreciated..
Thanks,
--Kishore.

Hi Mike & Abhi,
At the target end we are using File Adapter and it basically relies on Java Stack, Since we are using multimapping with out checking any condition both the files needs to be dropped at the target directory,
so as the receiver system is one do we need more than one receiver determination i think it is not required ..
how many Interface determinations are required. (If we use the both message types in single service interface, i belive with one interface determination can we achive this.. else anyone will execute)
Correct me if i am wrong
Thanks,
--Kishore

Similar Messages

  • Idoc to Multiple file scenario

    Hi Experts,
    My scenario is IDOC to Multiple files..
    IDOC will be triggered from the ECC system and i have three differient structures and need to drop those 3 files in the ftp server at the target system.
    Here we can use multimapping for such scenario but the problem here is ..
    In my scenario for all the 3 mappings i am using combination of message mapping and xslt mapping as below
    1st case:
    Idoc -
    Message mapping -
      Target First File.
    XSLT Mapping1
    XSLT Mapping2
    XSLT Mapping3
    XSLT Mapping4    -
    The output of the xslt 4th mapping will go to the target ftp server
    In similar for the other 2 mappings also uses the combination of messag mapping and xslt mapping.
    Here as the receiver system is one in the interface determination (PI 7.1-- NO Enhanced determination)when i add these operation mapping in the interface determination when i execute the scenario all the operation mappings are not getting executed.
    For example;; If the first target file has no records then it is not executing the 2nd operaion mapping, does the occurence of the operation mapping needs to changed.
    could anyone suggest on this..
    Thanks,
    sai

    Hi,
    Why cannot you use three mappings when you want to generate the three files for the same input instead of multimapping as the multimapping generates either of the three messages only...
    you can later provide the condition at the interface determination to execute the mappings if not all mappings to be executed..
    if there are no conditions provided by you at the interface determination level then mappings will get executed automatically..
    provided your mapping is working fine..so in your case check /test the message mapping..
    HTH
    Rajesh

  • IDOC to (multiple) file design help

    Hi all,
    i am trying to do a IDOC to multiple file scenario.
    Requirement:
    An outbound idoc has 4 segments.
    now i want the output of first 2 segments in one file and second 2 segments in another file.
    How to approach this design (without BPM).
    Waiting for reply,
    Senthilprakash.

    Hi,
    Use multimapping (use external definition of Idoc in source side) in which target message occurance should be 0..unbounded.
      write one UDF like below
    for(int i=1;i<=4;i++)
         if(i==2||i==4){
         result.addValue("");;
                     so that it will split the target structure 2 time(when i=2 and i=4). so that you map all the source fields to target fields(all one to one mapping except UDF).
    start doing this so that you will get the required output easily.
    thanks,
    madhu

  • IDOC to multiple file with dynamic file names with same content

    Hi,
    My scenario is from IDOC to file.
    The number of files which i need to create is dynamic, which depends on the number of plants.
    I have a Z-table where i will maintin list of all plants ( non SAP plant names).
    I need to fetch the data from this z-table and depending on the nunber of plants i need to create the file for each plant and fiel name should contain plant name in it. EX: abc_<plant>_datatype.txt
    I want to use only receiver one CC, and files should be created in the same directory.
    Can we do this without BPM?

    Hi,
    You can use the Mapping lookup concept to fetch the plant names from Z-tables and then you can use the variable substitution technique to resolve your purpose.
    Here you need to create multiple interfaces ie.e per plant to create multiple files. You can use common Communication channel for all.
    Mapping Lookup
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/frameset.htm
    Mapping Lookups - RFC API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/frameset.htm
    Variable Substitution
    An interesting usage of Variable Substitution in XI
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    SP12 -Variable Substitution option
    Receiver File Adapter:Variable substitution :FATAL  ERROR
    Thanks
    Swarup

  • Multiple Idocs to Multiple files

    Hi,
    I have a Idoc to File Scenario, where I get multiple Idocs and I need to generate multiple files with different file names
    Assume I am using file XML port at SAP to collect the Idocs.
    Target files are generated based on two field values (Delivery Type and Shipping Point)from Idoc.
    Eg:
    I have three Idocs at a time.
    Idoc1 has Delivery Type = EL & Shipping Point = 2550 --> Target file name is test1.bpr
    Idoc2 has Delivery Type = LF & Shipping Point = 2551 --> Target file name is test2.bps
    Idoc3 has Delivery Type = NL & Shipping Point = 2552 --> Target file name is test3.bpr and test3.bps
    1) Does Mult-mapping support in the case... ?
    2) Do I need to change the Idoc Occurrence 0 to unbounded ?
    3) What will be the Occurrences in the interface Mapping
    4) Can i generate Multiple fileswith different names at one time as specified above using Dynamic Configuration?
    5) What will be the Target Structure Occurrence ?
    Thanks,
    Varun

    Hi,
    Though I am using Multi - Mapping only 1 file is being created. I tested with two Idocs, where 2 files should be created.
    In Moni, under Payload,  I can see 2 sets of Main Document and SubMainDocument been created.
    How to generate 2 files/multiple files ?
    If Dynamic Configuration is not supported in case of Multi Mapping, If I want to use Variable Substitution, then What will be the Target path to be defined in the comm channel since Multi mapping is there. I am trying to define for Action field. Does Variable Substitution support Attributes in the aml payload ?
    My target structure
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:Root xmlns:ns1="urn:ap:xi:dwn:Logi:100">
    - <Shipment Company="XX" Warehouse="01" ErpOrder="0830001212">
      <Action>0830001212_2551.bpr</Action>
      <Customer Customer="DEMO" Company="DEMO" />
      </Shipment>
      </ns1:Root>
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
    <Shipment>
    <Action>0830001212_2551.bpr</Action>
    </Shipment>
    </root>
    Shipment Occurrence is 0 to unbounded and above root I have Messages and message1 node (since Multi mapping)..
    so How do I specify Path for variable substitution in this case, i tried all possibilities, but i am getting error as
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var2: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var2
    I am working on PI 7.0 SP 21
    Thanks
    Edited by: Varun Reddy on May 9, 2011 4:38 PM

  • 1:N mapping without using BPM -- IDOC to multiple files

    Hi all,
    I am facing a problem while sending multiple files,
    I need to send files ( File1, File2 or FIle3) ...
    I was able to successfully send the first 2 files and along with it the 3rd file is being created without any data... How to stop this file( either file2 or file 3 should be created) in creating..
    I have done the sceanrio like this, )ALL the source and target files are XSD's imported)
    In the Message Mapping <b>Messages Tab</b>
    <b>Source is AFS_DELVRY03   occurence is 1,
    Target files
    rootI8 occurence is 1,
    rootI9 occurence is 0...1,
    rootIB occurence is 0...1</b>
    I have done all the maping part , problem is all 3 files are being created(eventhough 2nd or 3rd has no data) , I need rootIB, either rootI9 or rootIB based on condition,
    So any one has done the similar scenario, If please suggest me how to hadnle so that only 2nd or 3rd file should be created,
    In Interface Determination i have selected the extended option also...
    Should i do any specific handling in the Configuration part or should i create more than one mapping?..
    U r suggestions are welcome and will be rewarded with points,
    Regards,
    sridhar

    Venu,
    Using a BPM, you can do the mapping / Split as needed and then send the files individually, using a Sens Step as needed. There are multiple ways in which this can be done with a BPM.
    But, for a solution without a BPM, as the requirement is such that only 2 of the 3 target messages need to be created, multimapping would not work and the need for conditional routing occurs.So, this would require additional mappings.
    The solution is either use a BPM or  do the logic using Conditional Routing. Ofcourse the second solution requires 3 mapping programs , but you are avoiding a BPM which can cause a perfromance bottle neck.
    If perfromance cannot become a bottle neck, then using BPM would make much more sense , but again it all boils down to the exact requirements and the feasibilty of the solutions!
    Regards,
    Bhavesh

  • Single iDOc to multiple files based on a condition

    Hi Friends
    need your help in one scenario which is something like this:
    there is one iDOC as the sender and this iDOC has to be mapped to files based on a condition means let us say if there is a particular field "R" in iDOC(WPDBBYY01) than it should go and create the file "ABC"
    and if the particlar field is P or G or M than it should create another 2 files named "XYZ" and "WUV" .
    Please guide me how can i put this condition ?
    Any help would be rewarded with points
    Thanks

    Have a single receiver and 2 inbound interfaces.
    So you will have 2 different mappings. In the first mappng source is IDOC and the target is file ABC.
    In the second mappping the source is IDOC and the target is 2 files XYZ and WUV.
    In Interface determination, add both the inbound interfaces and put the condition for each interface.
    Regards,
    Jaishankar

  • Creation of multiple files as per  segment repeating multple times  in IDOC

    Hi SapAll.
    i have got a  requirement where in an IDOC to File Interface pi need to create 3 different files with same content but with different names based on single Idoc-Segment.
    its an IDOC to 3 File Inteface.
    the file names will be determined by the IDOC-SEGMENT(Zregion)-Field (where Zregion Which will repeate for 3 times )
    for achiving this
    i just created 3 message (Service )Interfaces and one message mapping,3 Interface(Operation) mappings in the design and In the configuration i created three reciever communication channels with one reciever detarmination ,one Interface determination and 3 reciever agreements (with 3 communication channels 1 for each)
    in the Interface Determination i just defined 3 operation mappings,3 reciever Service Interfaces with one condition each.
    the condition is like below
    (/ZARTMAS05/IDOC/Z1EDRMDFRH_REGION01/REGION = JNB) then Rec Interface1
    (/ZARTMAS05/IDOC/Z1EDRMDFRH_REGION01/REGION = DBN) then Rec Interfacde2
    (/ZARTMAS05/IDOC/Z1EDRMDFRH_REGION01/REGION = CPT) then Rec Interface 3 where (/ZARTMAS05 is the sender idoc.
    but iam getting only one file in the reciever side instead of 3 files.
    can any body help me in providing me the differnt solutions for this without use of any script executions.
    will be waiitng for response.
    regards.
    Varma

    what ever you designed if you want to create always three files then your approach is correct.
    if you want create multiple files based on all the condition you you have to change the logic as like below.
    your message mapping sould me - one source target message type -> three traget message type all are occurance is 0..1
    and check the message type level contion if the region=ABCD create the first message type..
    same thing in your interface determination one source interface -> target three interface occrance is 0..1
    ID Steps - 1 RD, 1 ID, 3 Receiver coom channesl and 3 receiver aggreee...
    after develope this scenario it will split different message types in SXMb_MONI under the Technical Routing...payload level.
    hope it will help you to solve your requirement...
    Regards,
    Venu.

  • HR - XI - External System: one IDOC to multiple XML Files

    Hi,
    I have a scenario where I need, out of one HRMD_A07 IDOC send multiple XML files:
    The IDOC and the XML files can the Master data for many employee (IDOC has max of 200 as of SAP, external system, max of 1000).
    The IDOC will be generated with change pointers with all the needed filters (I can add/remove if needed).
    My goal is to generate 3 types of XML files:
    - 1 for the persons (containing basic info like name, firstname, persnr,etc)
    - 1 for the various unit (with basic info of unit like number, description & name)
    - 1 for the links between persons and units (this person is linked with that unit)
    The structures of the 3 XML files are know and can be imported via XSD definition.
    Do I need to use BPM for doing so or is there a way to do that with simple mapping?
    If BPM is needed, as I new to that, if you have a link to a begginer guide, fell free to send it
    Cheers,
    greg

    hi,
      For your scenario there is no need of BPM.
      In message mapping select the message tag.
      In the target add 3 message types.
      Just map the fields.Go to Interface mapping add the 3 message in the target.
      Get the mapping.
      In ID sender agreement,Receiver Determination is same.
      In Interface Determination select extended.Get the mapping.
      Create 3 Receiver agreement for each Receiver.
    Regards,
    Prakasu

  • Conversion of multiple xml idocs to flat file

    Hi,
    I did ABAP mapping to convert xml idoc to flat file by using the reference how to do abap mapping in xi3.0.pdf
    It is working for only one idoc at a time.
    If I have multiple idocs in a single xml file, the above code is not working.
    Please let me know what cchange to be done to work out for this.
    Hope am clear.
    Regards,
    Anil.

    Look For the Occurances of target Field node...It should be 1 to unbounded

  • Multiple idocs in a file

    Hi,
    How to transfer multiple idocs in a file? ( We can use BPM)  but i dont know how to implement using BPM.
    Kindly help.
    Regards
    sai

    Do you wish to  have multiple idocs coming through SAP merged into a single file
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/906fda31-0e00-2c10-4fb4-e264988a9263
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30ea2fdf-f047-2a10-d3a2-955a634bde6b?quicklink=index&overridelayout=true
    saptechnical website /Tutorials/XI/CollectMultipleIDocs/Collect1
    Regards
    Ninad

  • MATMAS05 Idoc to Flat File : Multiple material into same file

    Hi ,
      I am struck in simple scenario .Sending Materail Master data to flat file using idoc MATMAS05.  I made following changes to MATMAS05.xml file.
    I added MaxOccurs -=Unbounded and imported it in the interface mapping.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="MATMAS05"><xsd:complexType><xsd:sequence><xsd:element name="IDOC" type="MATMAS.MATMAS05" maxOccurs="unbounded"
    I am able to get multiple materials extracted in same file .However the XML fails to open the file completely saying there is error.
    Can anybody send me an xml file of Material Master having 2 matrials so I can compare it?
    Regards
    Prashanta

    Hello Prasanta,
    If I understand correctly you are sending MATMAS from SAP to File.
    And you want to split the Matmas into multiple files .
    If this is the case then do not change the Idoc field occurance on the target side. In the Message mapping , messages tab change the occurance of the target to unbounded.
    And use enhanced interface determination for the same.
    Cheers,
    Himadri

  • How to generate multiple files for each segment in the IDOC

    Hi,
    I have a IDOC with multiple segments, for each segment, a file needs to be generated,
    There is only one target structure. Please let me know as to how do we handle this requirement in XI.
    Regards,
    Younus

    Use multimapping in message mapping. Then map the Idoc node to the Message Type of File.
    Illustration of Multi-Mapping and Message Split using BPM in SAP Exchange Infrastructure
    Regards,
    Prateek

  • Problems with multiple idocs in one file ( Inbound file )

    HI,
    Thanks in Advance for your suggestions.. Highly appreciated.
    We have problems with multiple IDocs in one file.
    We are using XIB ( Amtrix ) as Middleware to receive the files.
    Curretenly When the file contains one IDoc then there is no problem. IDoc is created and everything is ok.
    If file contains two IDocs ( for example two messages ORDERS and DELVERY ) then it is creating two IDocs but both IDocs contains ORDERS plus DELIVERY segements information. That is the problem. Some how SAP unable to differentiate the IDocs in the file.. But it knows that how many idocs are there in the file..because it is creating exact number of idocs.
    We are using TRFC port ... Do I need to change it to File port..
    When we have more than one idoc do we need set any parameter in the file ...

    Thanks for the swift response. Always ideas are useful.
    As of now , Middleware cannot split the file.
    Thing is SAP is creating two Idocs with different message types. Problem is First IDoc contains ORDERS message type but also DELIVERY segments as well. Second IDoc with DELIVERY message tyoe but ORDERS segments as well... This is the problem... I think we are missing some field activation in file for EDIDC record.
    As far as I know file port supports the number of IDocs in one file.. Hope TRFC port also supports that

  • Idoc outbound to file with multiple records

    Hi Friends,
    I want to export multiple materials into one flat file per ale (idoc).
    I know I can create îdocs per "bd10" and download into file per WE19,
    but only several files not many idocs in one file.
    Can somebody help me with this requirement.
    Actually I want to extract material data per Idoc and import it later per LSMW.
    Many Thanks.
    Jimbob

    Your file port defintion (WE21) specifies the function module for creating the pathname (path + filename) for the IDOC file; most likely , it's EDI_PATH_CREATE_CLIENT_DOCNUM.  You can replace this with your own Z-function or one of the other EDI_PATH_CREATE_ functions that will use the same path name over and over.  You would not need to change the write mode, since it's already append mode by default in the system.  Of course, you are correct, there are many other approaches available to get the data moved...

Maybe you are looking for

  • Music not appearing on mini ipod

    I bought my mini ipod 2 weeks ago. I loaded one set of music on it fine, but now i've updated my itunes library and am trying to transfer the rest of the music to my mini ipod. When I connect my ipod to the computer(it's set on automatic, but I've tr

  • How can I export an image from Illustrator same canvas size and custom resolution?

    Hey all.  i am using Adobe Illustrator CS5 for creating images for iPhone app icons the size of image 374 px 374 px and 264 ppi. i created an image same size and ppi .the problem after export the image file size changing to  1371px x 1371px and 264 p

  • SQL Server 2008R2 Standard edition

    Hi, I'm trying to add replication on an existing SQL 2008 server. While adding replication I should see all other things that are already installed but I don't. SQL installation thinks it's a brand new installation. What can I do about this ? thanks

  • Textausrichtung in Elements 9.0 - Blocksatz?

    Hallo, gibt es in PSE 9.0 eine Möglichkeit den Text als Blocksatz auszurichten (wie in LR4 - Blocksatz letzte Zeile Blocksatz) um in der letzten Zeile den Text an beiden Absatzrändern auszurichten? Wer kann mir eine Auskunft geben. Besten Dank vorab.

  • When will the wiki compontent be available in the portal?

    Hello, does someone knows when the portal will have the wiki feature? When is it shipped to the public? Thx, Vanessa