on 07-15-2016 7:07 AM
Hi Experts,
We have 1 requirement in our new PI Interface :
We need to generate multiple idocs based on the value of this first field of the record and for the value change of the first field we need to create multiple IDocs .Our structure is like :
Record :
VendorNo
VendorType
Posting Key
AccountNo
POSTING_DATE
TRANSACTION_TYPE
So based on the change value for VendorNo , we need create multiple IDocs .So in this case :
123,PS,40,20105452,20160715,CN
123,PS,50,20103492,20160715,CN
456,PS,40,20105452,20160715,CN
456,PS,50,20103492,20160715,CN
789,PS,40,20105452,20160715,CN
789,PS,50,20103492,20160715,CN
In this case , 3 IDocs will be created and that i have achieved by the mapping :
VendorNo :-- Remove Context -- > SplitByValue(ValueChange) --- > IDoc
But the issue is that , for each idoc (if the same VendorNo comes multiple times) we need to create different segment for the different values .
Here it does not come .In the IDoc it took only the first value and it create only 1 IDoc segment .
So the posting is not done successfully in the functional end .
So can you please help me how can i solve this problem and generate multiple segments also in the same IDocs.
Thanks and Regards ,
Anik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
this is the point where I am saying graphical mapping will become too complicated. I suggest here to use XSLT mapping and and use muenchian grouping
https://en.wikipedia.org/wiki/XSLT/Muenchian_grouping
http://stackoverflow.com/questions/2146648/how-to-apply-group-by-on-xslt-elements
Here it would be absolutely easy to achieve what you want and the code is absolutely easy to understand and maintain.
Regards
Helmut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Usually you can change context of source field but in your case you need to write UDF. As input you should have VendorNo (to add context change once values change) and other field that should be returned based on index.
I do recommend you to sort date before e.g. like
VendorNo :-- Remove Context -- > SORT -> SplitByValue(ValueChange) --- > IDoc
otherwise you will not be able to handle
123,PS,40,20105452,20160715,CN
789,PS,50,20103492,20160715,CN
123,PS,50,20103492,20160715,CN
456,PS,40,20105452,20160715,CN
456,PS,50,20103492,20160715,CN
789,PS,40,20105452,20160715,CN
You will get 4 IDocs instead of 3.
/k
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anik,
The same logic u used for root node should help for segments as well or try with format by example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.