cancel
Showing results for 
Search instead for 
Did you mean: 

File to File Scenario (File splitting)

NishantChavan
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

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..

NishantChavan
Participant
0 Kudos

Yes, i have FCC to convert that to XML.

Should i create 2 target messages? or it will create individual files even if i use order number ->remove contexts-> split by value(value changed) -> target message.

former_member184720
Active Contributor
0 Kudos

only one message but change the occurence to 0.. unbounded in the mapping (signature tab)

it should create separate file for each order..

NishantChavan
Participant
0 Kudos

Hi Hareesh,

I have below mapping

Here is mapping on S_ISA

it still not creating individual files. am i missing something?

former_member184720
Active Contributor
0 Kudos

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

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/600b455f-01cd-2b10-0cab-a50e47a8f...

former_member187010
Participant
0 Kudos

Hi Nishant,

Under signature tab change the occurrence to 0..unbound and then do the mapping at ASC850_004010 as you did for S_ISA.

Regards

Jitender

NishantChavan
Participant
0 Kudos

Thanks Hareesh,

If i change the signature of target message then it will add 2 more parent segments. I am using EDI converter module to convert this into EDI file. This module is not expecting these 2 extra parent segments. Whats your suggestion on this?

Thanks,

Nishant

former_member184720
Active Contributor
0 Kudos

It's just to split the files and post interface determination i don't think you'll have these tags..

You can give a try..

NishantChavan
Participant
0 Kudos

Hi Hareesh,

It has actually added those 2 additional segments, check this.

Thanks,

Nishant

former_member184720
Active Contributor
0 Kudos

Unable to find the screenshots... Can you attach them again?

try testing end-end scenario...

NishantChavan
Participant
0 Kudos

Here you go

former_member184720
Active Contributor
0 Kudos

That is just the mapping test.. actual split happens during the interface determination post mapping.. so test it end-end and see if you get any errors..

NishantChavan
Participant
0 Kudos

Hi Hareesh,

Just to let you know that i have java only scenario (ICO) so i think it will take care irrespective of java or conventional scenario.

Doing the test, will let you know as soon as i am done.

Thanks,

Nishant

NishantChavan
Participant
0 Kudos

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

Former Member
0 Kudos

Hello,

Use this mapping:

Order number -> remove context -> split by value (value change) -> collapse context -> target node

BTW, did u check ur mapping output?

Edited - there is no need to use sort function so removing the same from mapping.

Thanks

Amit Srivastava

NishantChavan
Participant
0 Kudos

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

Former Member
0 Kudos

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

NishantChavan
Participant
0 Kudos

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?

former_member184720
Active Contributor
0 Kudos

Hi Nishant - Did you change the occurence in the operation mapping too?

After changing the occurence just refresh the "read operation" and then select your mapping again.

Your operation mapping should also return multiple messages..

former_member184720
Active Contributor
0 Kudos

Also make sure you are testing it with valid data.. (test the message mapping and operation mapping with same payload)

NishantChavan
Participant
0 Kudos

Thanks Hareesh for that hint however the link which you had given me yesterday says the Operation mapping should have 1.1. I have changed it now and the OM shows the result but its creating only one file with below data.

NishantChavan
Participant
0 Kudos

Yes, my data is valid

former_member184720
Active Contributor
0 Kudos

In your ICO, under receiver interfaces.. delete the interface mapping and select it..

What is the multiplicity it is showing?? it should be 0..unbounded..

Harish
Active Contributor
0 Kudos

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

NishantChavan
Participant
0 Kudos

Hi Harish,

This is resolved. Thanks a lot for your help. The ICO had multiplicity 1 and i was looking only in ESR . You are great!!!

Thanks,

Nishant

former_member184720
Active Contributor
0 Kudos

Finally..

So no issues with EDI splitter too right..

NishantChavan
Participant
0 Kudos

Yeah, no issues with EDI splitter as well. Soon i will create a blog on creating end to end B2B scenario. 

Answers (0)