on 07-29-2012 9:08 PM
Hi experts
I have an idoc with E1EDKT1 node having many E1EDKT2 nodes under it (these are text lines).
I have written a UDF to conatenate all the TDLINE fields in E1EDKT2 nodes into a single target field which is working fine.
I need to conditionally send the E1EDKT1 => E1EDKT2 node contents to target field.
However the E1EDKT2 node has 2 fields as below
TDLINE always present, populated with text lines
TDFORMAT present only on some nodes and populated with /
What I need to do is in the target field insert a new-line character before the TDLINE (text line) wherever there is \ in the TDFORMAT field.
Please can you suggest appropriate mapping since I am struggling with unequal contexts and hence not getting the desired results.
I am struggling with context mappings since I am new to PI
Idoc example
E1EDKT1 ABCD Send to destination target field.
E1EDKT2 TDLINE TDFORMAT
E1EDKT2 This is the first line of text /
E1EDKT2 This is the second line
E1EDKT2 This is the third line /
E1EDKT2 This is the fourth line
The desired result i want is : \nThis is the first line of textThis is the second line\nThis is the third lineThis is the fourth line
HI Gary,
Please go through below links,it may be helpfull for you to understand concepts(formatByExample) needed to
complete your task..
http://help.sap.com/saphelp_nw04/helpdata/en/67/7ca04267deb111e10000000a155106/content.htm
Regards,
$HRI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can use this mapping:
TDFORMAT -----------------------> concat: -> replaceString -> UDF -> Target
TDLINE -> mapWithDefault -> / Constant: / -> /
Constant: \n -> /
Hope this helps,
Mark
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.
Hi Amit
I am getting closer to what I want as the output so thanks for that. However I have one question. I changed the mapping given by you as below
I want to send the output only if E1EDKT1-TDID (parent node value = ZABC). So I have introduced the useOneAsMany and put an if condition to check this.
But the problem is though Displayqueue shows all text lines coming out from if node, the formatByExample context comes out empty. Due to this I get the below error
Runtime exception when processing target-field mapping /ns0:XX_XXXXXXXX_XXXXXXX_XXXXXXX/Header/dbTableName/access/XXXXXX; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Function formatByExample: Queues do not have the same number of values] in class com.sap.aii.mappingtool.flib7.NodeFunctions method formatByExample[[Ljava.lang.String;@723a25f4, [Ljava.lang.String;@4791f0c2, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@3e557543, com.sap.aii.mappingtool.tf7.rt.Context@5c85a1ad]
How can I acheive this?
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.