on 02-06-2012 3:02 PM
Dear experts,
i have a problem mapping an incoming Idoc to XML file. Here's the situation:
1) Structure of inbound Idoc
ZTST00
ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z1", FIELDVALUE = "4";
ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z2", FIELDVALUE = null;
ZTST01 Structure: FIELDNAME, FIELDVALUE, Values: FIELDNAME = "ZABC", FIELDVALUE = "5";
ZTST01 Structure: FIELDNAME, FIELDVALUE. Values: FIELDNAME = "Z4", FIELDVALUE = "6";
ZTST02
2) Resulting XML:
LINEHEADER (1 line)
LINEDETAIL (1 line, Structure: VALUE)
LINEFOOTER (1 line)
3) I need to map ZTST01-FIELDVALUE to LINEDETAIL-VALUE, but only if the FIELDNAME equals "ZABC".
In my message mapping, i put an IF FIELDNAME = 'ZABC' THEN FIELDVALUE->VALUE, on context ZTST00. But because of the null value in line 2 of the Idoc, the value that is returned to the XML is "6", as the null value is disregarded and not in the queue of FIELDVALUE.
How can I put the correct value ("5") to LINEDETAIL-VALUE?
Regards
William
use " REMOVE CONTEXT" after segment!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dont change the context...u wil get the desired result.
However after if function u have to use removecontext to get the output value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi William,
Simply go back to the default context ZTST01 (for both: FIELDNAME and FIELDVALUE fields) and it should be fine.
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.
User | Count |
---|---|
85 | |
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.