on 03-22-2016 2:17 PM
Hi Experts,
In the scenario IDOC (INVOIC02) -->EDI(EANCOM) I am facing an issue in the mapping part.
below are the Idoc source fields:-
KSCHL -- ZDR3 and ZDR5 (Constants)
Can anyone please help me to create the mapping based on the below cases:
case 1) Suppose if a Idoc contains only ZDR3 (field KSCHL) then the mapping has to be created that accepts the value of 621.16
case 2) If a Idoc contains both ZDR3 and ZDR5(as per above screenshot) then it should accepts the value 13.20(target node D_5004)
The above mapping displays the value 13.20.
Thanks,
Gopi
Hi Gopi,
Use below mapping.
UDF:
Execution Type: All Values Of Context.
public void mapD5004(String[] kschl, String[] betrg, ResultList result, Container container)
throws StreamTransformationException {
Map<String, String> map = new HashMap<String, String>();
for (int i = 0; i < kschl.length; i++) {
map.put(kschl[i], betrg[i]);
}
if (map.containsKey("ZDR3") && map.containsKey("ZDR5"))
result.addValue(map.get("ZDR5"));
else if (map.containsKey("ZDR3") && !map.containsKey("ZDR5"))
result.addValue(map.get("ZDR3"));
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick response.
@Ramesh, I have tried mapping part but the result is, target value assigned only for the first Idoc.
Suppose in the source structure contains 2 IDOCS then mapping resulted the value for the first IDOC and for rest all of the Idocs the target value is missing/empty.
1)IDOC>EIEDK05
KSCHL BETRG
ZDR3 10
2) IDOC>EIEDK05(2)
ZDR3 12
ZDR5 2
Resultant:
1)IDOC --- D_5004 10
2)IDOC --- D_5004 (empty) the actual value is 2
Please suggest on how to resolve this.
Then I tried UDF and worked finally.
Regards,
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.