on 12-03-2009 9:27 AM
Hi all,
The Idoc we are using is ORDCHG.
My requirement is if PARVW= we or LF or LS or Z1 or AG or EK then need to send name1 values
For this I wrote a java function
//write your code here
if(((inValue[0].equals("AG") || inValue[0].equals("EK") || inValue[0].equals("LF") inValue[0].equals("Z1") inValue[0].equals("WE") inValue[0].equals("LS")))
{
result.addValue(inValue[0]);
}else{
result.addValue("");
}}
for testing i used concat to combine both.
then name1->>>first parameter of use1asmany
second parameter if E1EDP01exists then E1EDp01 else constant[]
Third parameter if E1EDP01 exists then Posix else constant
up on executing this i have error
RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_FILE_MUL/Recordset/Records/Del_To_name1. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class
Please help.
Thanks,
Srinivasa
Hi,
I am not sure why you are using UDF for this when you can achieve this with standard functions.
Please use following mapping. I have created it for case PARVW = WE.
1. Use If then else
u2022 Input for If condition = PARVW --> map with default = Constant with value WE
u2022 Then pass name 1--> map with default
u2022 Else pass constant with blank value
2. Output of if then else --> remove context --> Sort (Property descending) --> collapse context --> Target field
This mapping will pass value of name 1 to target field, whenever the value of PARVW = WE in same segment occurrence.
Please modify it as per your requirement. Let us know if any issue.
Regards,
Gouri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure if I understand your requirement, but if you want to send Name1 for only the selected partner types, then you will end up with up to 4 instances of Name1 with all instances within the same context as your code is currently written.
I don't know your target message structure, but generally the useOneAsMany-function requires there to be the same number of contexts for all three inputs. In your case you would need to change the context (right-click on field and select the context above the current context) from line-item level to header level. This way you would get only one context with instances also for input2 and input3, in addition to your input1 (list of Name1 values) and the function should work.
Let me know how it works out for you.
Br,
Kenneth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.