on 02-24-2014 7:45 PM
Experts,
I am working on B2B scenario. I have a source purchase order flat file with multiple orders in it I want to converted that into EDI file and create individual file for each purchase order.
I am able to convert he file however i want to know how to split the files or create individual files. Do i have to write any java function for that?
eg.
Sourcefile
Order1, Vendor, date
Order1,Vendor, Line1
Order1,Vendor, Line2
Order2,Vendor, date
Order2,Vendor, Line1
Order2,Vendor,Line2
Order2,Vendor,Line3
Expected output
File1
Order1, Vendor, date
Order1,Vendor, Line1
Order1,Vendor, Line2
File2
Order2,Vendor, date
Order2,Vendor, Line1
Order2,Vendor,Line2
Order2,Vendor,Line3
Thanks,
Nishant
Hi Nishant - Are you converting the flat file to XML using file channel FCC?
If you have the mapping may be you can split the file at the mapping level (multi mapping)
order number ->remove contexts-> split by value(value changed) -> target message..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nishant - Go to the signature tab and change the occurrence to 0..unbounded of your message tyep ASC850_****
Then you'll get two additional segment.. messages..messages1
After changing the occurrence ->apply the above logic to your Message type i.e. ASC850_***
Have a look at the below blog for reference
Hi Hareesh,
Thanks for your quick responses, I am still struggling with it. Here is the problem. The mapping test shows result (its showing only one message even though I have 2 orders in the input file, I am still working on the map). but when i creates the file it does not show any data.
My mapping
File output on NFS
Any idea
Hi Amit,
Why i need collapse context when i have to split the message on order change?
Order number -> remove context -> split by value (value change) -> collapse context -> target node
Yes, i have checked the mapping output, it creates only one structure and when i test it under Operational mapping it does not create any structure.
Thanks,
Nishant
Hello,
Did u test ur mapping after implementing above logic (using CC)?
To create multiple order messages u have to make sure that ur Target Node is created as many times as the order number changes and in case u don't use CC after split by value (value change) then ur target sequence will be disrupted?
>>when i test it under Operational mapping it does not create any structure.
Did u change the occ of target Service interface as O..unbounded?
Thanks
Amit Srivastava
Hi Amit, Hareesh
For now, I have created simple mapping and disabled some child structures. First i want to generate individual files for each order and then i will work on the remaining mapping. Now, in message mapping different nodes are getting created for each order however when i test in Operational mapping it does not show anything.
Message Mapping output
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns2:ASC850_004010 xmlns:ns2="http://sap.com/xi/B2B/Examples/ANSIX12">
<S_ISA>
<D_I01>00</D_I01>
<D_I02> </D_I02>
<S_IEA>
<D_I16>1</D_I16>
<D_I12>500113244</D_I12>
</S_IEA>
</S_ISA>
</ns2:ASC850_004010>
<ns2:ASC850_004010 xmlns:ns2="http://sap.com/xi/B2B/Examples/ANSIX12">
<S_ISA>
<D_I01>00</D_I01>
<D_I02> </D_I02>
<S_IEA>
<D_I16>1</D_I16>
<D_I12>500113243</D_I12>
</S_IEA>
</S_ISA>
</ns2:ASC850_004010>
</ns0:Message1>
</ns0:Messages>
OM output.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1/>
</ns0:Messages>
When i ran end to end scenario, it created one file with above data in it
Any idea?
Hi Nishant,
Pleaes check if below sap note applied to your issue.
1774773 - AEX: Multi Mapping fails for multiple msgs for one
interface
regards,
Harish
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.