on 11-27-2007 5:47 PM
I have the follwoing scenarion where flat file is passed to xi and and than xi do mapping and outputing Idocs based
on the file and based on mapping logic.
I have the following Input Stricture:
- <Header>
<RecordType></RecordType>
<Field1></Field1>
<Field2></Field2>
</Header>
- <Detail>
<RecordType></RecordType>
<Ssn></Ssn>
<Field1></Field1>
<Field2></Field2>
<Field3></Field3>
</Detail>
- <Trailer>
<RecordType></RecordType>
<Field1></Field1>
<Field2></Field2>
</Trailer>
I WANT TO BE ABLE in Outbound File Adapter to split all the records so for ONE EMPLOYE and this way TO HAVE ONLY ONE IDOC generated from my mapping.
So With other word if my input flat file looks like this :
01Field1Field2 - this is the Header
02111111111Field1Field2Field3
02111111111Field1Field2Field3
02111111111Field1Field2Field3 6 detail records
02222222222Field1Field2Field3
02222222222Field1Field2Field3
02333333333Field1Field2Field3
03Field1Field2 - this is the Trialer
where 01 Record type for header
02 Record type for Detail
03 Record type for trailer
111111111,2222222222,333333333 is SSN - Identifier for employee
My mapping is already done so one record can generate the right IDoc!
From this file I want to be able to GENERATE 1 SEPARATE IDOC FOR EACH EMPLOYEE!
So in the case above I will have to 3 Idocs - for Empl 11111111, 22222222, 33333333...
The number of record per employee will be handled by Idoc itself in the mapping - so this is not my concern.
I think if I can split somehow my file based on different employees and pass separate message to Adapter -
this wil lbe the easiest and clean way to do it.Than Mapping will generate separate Idoc for each employee and
I will not have to complikate my mapping.
Please let me know if think this can be done in Adapter in file content conversion and if it is possible - how.
Appreciate ASAP you reply!
Jon
Hi,
Check out this Blog: <a href="/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change: IDOC bundling - the "trick" with the occurance change</a>, this could be helpful for your scenario.
Regards,
S.Santhosh Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Santosh
This is excactly what I need to acheive .I hope this solution will work for me and will solve my problem. I am planning to go ahaed and try it now.I will let you know if it works. BTW - my mapping is already done and I do not want to change anything in mapping.
-Do you know if way would involve some mapping changes or not??
-If I do it this way -Are we sure that each generated separate Idoc will be in form where can be posted with no problems?
For all, in case this do not work - if someone feel and know other ways of doing it - please let me know..I am exploring all the options..
Thanks for your help!
Jon
Hi,
Since you have created the Message mapping already,
1. Export the mapping as Mapping Template from the current Mapping object.(Select the Message Mapping, in graphical mapping editor, do CTRL + SHIFT + Right Click --> Tools -> Export Tools --> Export).
2. In the New Message Mapping object, select the source MT and target with the occurance change done.
3. Now import the Mapping template which was exported in the step 1, then change the occurance mapping for the Target node IDOC with the Node underwhich the employee field comes, so that the Number of IDOC generated equals the number of times the employee field's node occur.
Regards,
S.Santhosh Kumar
Message was edited by:
Santhosh Kumar Subramanian
you need to use formatByExample standard function to group all the IDOC's with same SSN together,once the occurence of IDOC has been changed to unbounded,XI will create as many IDOC's within a single XML as many different SSN fields you have,when its posted in R/3 it will be posted as a separate IDOC's
Thanx
Aamir
Santosh
The idea that you gave me ( Michael's trick) worked great for splitting message to multiple Idocs.
It did the job and it did it great . Right now as Aamir said I am able to post many Idocs in R/3 generated from 1 message.
Of course I had to play with the mapping a bit .For me the right mapping was :
ssn->splitbyvalue(valuechange)->collapsecontext->idoc
For other interfaces of course it could differ.
Thanks a lot for your help!
Jon
HI
With the logic given by experts above. I would like to add. If you want to have seperate IDOC sent to seperate applications. You can go for split mapping technique and employ seperate Reciever Determination in ID. This will send similar pay load to multiple IDOC and even seperate destinations.
Thanks
Gaurav Bhargava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Jon,
from file to multiple idoc senario and setting kindly follow tha below links
http://www.sap-hefte.de/download/dateien/1156/100_leseprobe.pdf
/people/prateek.shah/blog/2005/06/08/introduction-to-idoc-xi-file-scenario-and-complete-walk-through-for-starters - IDoc to File
**If useful then reward points**
regards,
Sumit gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.