on 03-21-2012 2:09 AM
Hello Guys,
One quick one - I am working on a idoc(Idoc with customer details) to flatfile scenario , My requirment goes like this - There is a possibility that for a particular customer there can be more than one contact details. These details will be captured in the E1KNVKM segment(Name1 and VRTNR fields), For every unique contact detail there will be a new segment created. We have to map these additional segments as seperate lines in the output file.
In the newline that will be created in the output file there should be only the Name1,VRTNR fields.
The output file looks like this :
For example if characters 'd' and 'e' are the Name1 and VRTNR fields in the idoc and these are more than one for a customer then the output should be like this :
a,b,c,d,e,f,g
,,,d1,e1,,
,,,d2,e2,,
Thanks,
Shashank.
Hi Shashank,
I'm afraid duplicating target structure won't work, unless you know in advance how many contact details will come for each customer (which is not the case here, I guess). But you have another option. Build the message mapping in such a way that for your example data, you had the following target XML data:
<customer>
<f1>a</f1> <f2>b</f2> <f3>c</f3> <f4>d</f4> <f5>e</f5> <f6>f</f6> <f7>g</f7>
</customer><customer>
<f1/> <f2/> <f3/> <f4>d1</f4> <f5>e1</f5> <f6/> <f7/>
</customer><customer>
<f1/> <f2/> <f3/> <f4>d2</f4> <f5>e2</f5> <f6/> <f7/>
</customer>
Just make sure that fields f1, f2 and so on are populated, although having no value (a blank " ", for instance). Then in the receiver communication channel use file content conversion with following parameters to achieve the expected target file:
Recordset Structure: Customer,*
Customer.fieldSeparator = ,
Customer.endSeparator = 'nl'
Refer here for further details on converting XML data to flat file with FCC: http://help.sap.com/saphelp_nwpi71/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shashank
Duplicate the target structure (Right Click on parent node of a,b,c,d,e,f,g and duplicate). Map the fields of first one as you were doing to generate all values (a,b,c,d,e,f,g). Do some logic to populate its parent once for each customer. (Map with Customer ID)
Map the fields of second to generate D & E only. Do some logic to populate its parent as many times as the additional contact detail (you can map with E1KNVKM but do suppress the first occurance of E1KNVKM as it will be already there.)
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Map E1KNVKM node to root node of file structure. i.e. repeat root node of file as many times E1KNVKM node occurs.
As to other fields of the file, you can use copy value or useone as many function.
Regards,
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to build mapping logic in PI to genarate XML output accordingly , insted of putting efforts in FCC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.