on 07-01-2014 6:50 PM
HI Experts,
I am new in sap pi, do not kow how to write UDF.
In my complex mapping scenario, I need to write UDF.
Source IDOC :
Z1WHCONS
Z1WHCUSTC
Z1WHCUSTCH
Z1WHCUTM
comment
Z1WHCUTM
comment
Z1CUSTCD
Target:
BOX -- Z1WHCUSTC when Z1WHCONS is initial
MIXPLT -- Z1WHCONS
BOX -- -- Z1WHCUSTC when Z1WHCONS is not initial
Line -- Z1CUSTCD
comment --- Z1WHCUTM-comment field
comment --- Z1WHCUTM-comment field
I am not getting proper data when BOX and BOS with MIxplt data is coming in source xml.
How can I do it using graphical mapping or UDF.
Source IDOC :
Z1WHCONS 0..n
Z1WHCUSTC 0..n
Z1WHCUSTCH 0..n
Z1WHCUTM 0..n
comment 0..1
Z1CUSTCD 0..n
Z1WHCUTM and Z1CUSTCD are at same level under node Z1WHCUSTCH.
Target:
BOX 0..n -- Z1WHCUSTC when Z1WHCONS is initial
Line 0..n -- Z1CUSTCD
comment 0..n --- Z1WHCUTM-comment field
MIXPLT 0..n -- Z1WHCONS
BOX 0..n -- -- Z1WHCUSTC when Z1WHCONS is not initial
Line 0..n -- Z1CUSTCD
comment 0..n --- Z1WHCUTM-comment field
First Box and Mixplt are at same level.
I am not getting comment data when BOX and BOX with MIxplt data is coming in source xml.
How can I do comment mapping using graphical mapping or UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when Z1WHCONS-fields not exist then we populated data in first BOX. ans it is working fine.
comment lines are also populating when only BOX or only Mixplt data is there.
Only problem is when multiple BOX data is coming out.
Target:
BOX 0..n -- Z1WHCUSTC when Z1WHCONS is initial
Line 0..n -- Z1CUSTCD
comment 0..n --- Z1WHCUTM-comment field
MIXPLT 0..n -- Z1WHCONS
BOX 0..n -- -- Z1WHCUSTC when Z1WHCONS is not initial
Line 0..n -- Z1CUSTCD
comment 0..n --- Z1WHCUTM-comment field
Hi Ranj,
This needs UDF indeed. The trick is to combine all the values of the COMMENT field so that it will have the same number of contexts as Z1WHCUSTC.
1. First UDF for combining the values:
2. Second UDF for splitting the values:
Mapping for first comment
Mapping for mixPlt comment
Test:
Only CU0 and CU4 have comments which is the desired output.
Regards,
Mark
Hi Ranj
The structure/requirement provided is not clear.
You have mentioned about BOS field, but i cannot see it in the target structure.
Can you provide more details? Also provide the cardinality of the fields.
Regards
Osman
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 | |
10 | |
7 | |
6 | |
6 | |
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.