on 02-07-2012 10:04 AM
Hi,
I have the mapping like this
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext-copyvalue(0)--targetfield(Underroot1)
001
Here the root1 is under root has the fixed value mapping with values 111,112,113 means if there is any value among these then only the root1 will be created.
Now I check the mapping with the roo1 mapping as
Qualf-equal-equals-createif-root1
113
whreas there is no value 113 in the input payload
I get the follwowing error when I check mapping with copyvalue for the targetfield
Insufficient number of values in argument queue for function CopyValue. Value with index '0' not found
It works well without copyvalue.
What can be done it to wok with and withou copyvalue?
Thanks
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Do the mapping without copyValue function
> IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext---targetfield(Underroot1)
> 001
Regards,
Venkata Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
> 1.THis UDF is the replacement of CopyVlaue node function,right?
No. This UDF is for getting the correct values based on context.
Ex: E1EDP03 comes multiple times and some times DATUM exists and IDDAT not exist or some times IDDAT exists and DATUM not exists at this time it takes the next context value as output but that is wrong. To avoid those conditions we can use this UDF.
> 2.THe parameters for this UDF are
Input parameters are Segment and Field
Exectuion Type:QUEUE type UDF
Regards,
Venkata Ramesh
Hi Venkata,
I declared 2 arguments as var1 and var2 and another thing came as Resultlist automatically.
Is it correct?
But I am getting error in the UDF at
for(int i =0; i<segment.length;i++)
if(segment.equals(""))
result.addValue(field[j]);
Also ,do I need to change the context of IDDAT and DATUM to IDOC?
Thanks
Dear Gayatri,
You really don't need a UDF for this purpose. Just do as I described earlier and you'll be fine:
Add an ifWithoutElse step. Put this as the if condition:
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext--exists()
and this as the "then" value:
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext
Simply put the result to: copyvalue(0)targetfield(Underroot1) and you got it.
Regards,
Greg
Hi,
The actual mapping is
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext-copyvalue(0)--targetfield(Underroot1)
113
The hierarchy is
Root
-
Underroot1
-
targetfield
Now as per the mapping of the Root,there are 3 values 111,112,113 for which it should create the Underroot1 and so targetfield
Now in my case targetfield is validated for IDDAT = 113,it is there also but gets populated only with CopyValue(0) and not without CopyValue nodefunction.
Can you please tell me how to skip CopyValue node function?
Thanks
Hi,
> I declared 2 arguments as var1 and var2 and another thing came as Resultlist automatically.
> Is it correct?
YES
> if(segment.equals(""))
Here you need to check Segment of i value // segment
> Also ,do I need to change the context of IDDAT and DATUM to IDOC?
No
After this UDF you need to map like below
UDF output --> mapwithDefaultValue --> Collapse context node function --> Split by value Node function --> Target Field name.
Regards,
Venkata Ramesh
Hi Greg,
Add an ifWithoutElse step. Put this as the if condition:
IDDAT(E1EDK03)--Equals--If--Then DATUM(E1EDK03)--removecontext--exists()
and this as the "then" value:
IDDAT(E1EDK03)--Equals--If--Then DATUM(E1EDK03)--removecontextSimply put the result to: --copyvalue(0)--targetfield(Underroot1) and you got it.
I need to skip CopyValue and the above method did not work.
The actual mapping is
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext-copyvalue(0)--targetfield(Underroot1)
113
The hierarchy is
Root
-
Underroot1
-
targetfield
Now as per the mapping of the Root,there are 3 values 111,112,113 for which it should create the Underroot1 and so targetfield
Now in my case targetfield is validated for IDDAT = 113,it is there also but gets populated only with CopyValue(0) and not without CopyValue nodefunction.
Can you please help me?
Thanks
Edited by: Gayatri Deshpande on Feb 7, 2012 12:30 PM
Hi Venkata,
Thanks for the reply.
I got 3 errors for the UDF
1.for(int i =0; i<segment.length;i++)
2.if(segment.equals(""))
Question:Should it be if(segment.equals("E1EDK03")),if so,it still gives error
Is it if(segment.equals("113")),the expected value of IDDAT?
3.result.addValue(field[j]);
The actual mapping is
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext-copyvalue(0)--targetfield(Underroot1)
113
The hierarchy is
Root
-
Underroot1
-
targetfield
Now as per the mapping of the Root,there are 3 values 111,112,113 for which it should create the Underroot1 and so targetfield
Now in my case targetfield is validated for IDDAT = 113,it is there also but gets populated only with CopyValue(0) and not without CopyValue nodefunction.
Can you please guide me?
Thanks
Edited by: Gayatri Deshpande on Feb 7, 2012 12:43 PM
Check this link and do the mapping like this
https://picasaweb.google.com/bvramesh2006/February72012#5706369834877618562
Regards,
VR
Hi,
>>>whreas there is no value 113 in the input payload
1. maybe you can write a simple UDF for the same and it will check all the things you want ?
is that an option ?
2. what I can also suggest is chapter: . 5.14 IDoc Message Mappings page 197
from:
http://www.sap-press.com/products/Mastering-IDoc-Business-Scenarios-with-SAP-NetWeaver-PI.html
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By using below code you can take the correct values
int j = 0;
try
{
for(int i =0; i<segment.length;i++)
if(segment<i>.equals(""))
{
result.addValue(field[j]);
j++;
}
else
result.addContextChange();
}
catch(Exception e)
{
result.addValue("");
}
This is queue type UDF and it takes 2 input values Segment and field.
In your case 2 times you have to use this UDF.
Map like this
E1EDK03 as first input value
IDDAT --> MapwithDefault node function --> RemoveContext node function as second input value
The above UDF output values checks with constants by using Equals function(UDF output Equals 113) this output gives to IfWithoutFunction, if this condition is true then give the same UDF output value instead of IDDAT value you can use the DATUM
Finally you can map this ifWithoutElse node function output value to Target Field
Note: some times if IDDAT value comes and there is no value at DATUM so at this time also it gives correct values, if you map without using this that gives wrong value.
Regards,
Venkata Ramesh
Hi,
Add an ifWithoutElse step. Put this as the if condition:
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext--exists()
and this as the "then" value:
IDDAT(E1EDK03)EqualsIfThen DATUM(E1EDK03)removecontext
The interpretation is: if the source value exists, then put it into Underroot1. Else, do not create the Underroot1 node.
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 |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.