on 06-24-2008 8:13 PM
Hi All,
I have a field (Partner) which can have WHL,GPOI,GPOO , WHL corresponds to xyz.xyz and GPOI/ GPOO corresponds to abc.abc rest of the entry's will have 'Independent'.
I have used FixValues function to do the mapping but when there is no name entered (blank) in the Partner field, I'm getting message mapping transformation error.
I even left a blank in the key column and 'Independent' in the value column, but no use.
Any way to solve this?
Thanks,
Srini
You can provide default value as 'independant' in fix values
page 68
The FixValues function provides a simple generic value mapping (or key mapping) in the Integration Repository
Edited by: Gabriel Sagaya Selvam on Jun 25, 2008 1:20 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In PI 7.1 you can have the options like
Return inital value,
Return a default
Throw an exception
But if you use PI 7.0 you dont have the option to provide blank value in default.
Hi,
Create UDF and you can achieve that. sample UDf for doing the same below.
public String fixValueMapping(String a,Container container){
-
String finalStr="Independent";
if(a.equals("WHL"))
{
finalStr="xyz.xyz ";
}else if (a.equals("GPOI"))
{
finalStr="abc.abc ";
}else if (a.equals("GPO"))
{
finalStr="abc.abc ";
}
return finalStr;
-
}
Thanks
Amit
Reward points if it works
Hi,
Have you created a normal UDF or Advanced UDF. Normal UDF always as return type String. How it can be void?
Have you selected the Cache option as "value" or some other thing. please check it again. If it doesnt work send me screen shot of your udf and mapping.
Thanks
Amit
<ASKING FOR POINT AFTER TODAY WILL RESULT IN A REMOVAL OF YOUR USER>
Edited by: Craig Cmehil on Jul 16, 2008 10:29 AM
I'm still getting the error:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:MT_SPGPDS010_CUSTDATA/CUSTOMER_INFO_RECORDSET/CUSTOMER_TYPE. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram.start
Amit,
Issue is linked with this problem:
I have a DEBMAS06 structure,
DEBMAS06
E1KNA1M
KUNNR
LAND1
NAME1
ORT01
PSTLZ
REGIO
STRAS
BRAN1
E1KNVVM
E1KNVPM
PARVW
KUNN2
and PARVW can have AG, RE, WE
Ex:
KUNNR PARVW KUNN2
0000300027 AG 0000300027
0000300027 RE 0000300016
0000300027 WE 0000300016
I'm having problem mapping, I have a situation where,
if WE partner = KUNNR , assign PRIMARY else rest all Independent.
So here I need to query PARVW and see weather it has WE and later compare its KUNN2 with KUNNR.
This is a complex mapping so we have to use UDF any suggestions or code would help.
--
Srini
Hi,
You can still do it. The code will be something like this. Define three string parameters in your udf while defining the signature a,b, c
public String generateIndependent(String a,String b,String c,Container container){
-
String finalStr;
if(a.equals("WE"))
{
if(b.equals("C"))
{finalStr= "PRIMARY";}
else{ finalStr ="Independent";}
}
return finalStr;
-
There might be some errors. pls let me knwo in case of any error.
Thanks
Amit
Reward points if it helps .
Amit,
This is the error:
.java:201: variable finalStr might not have been initialized return finalStr;
I have intialized finalStr = "Independent", but still the code is not working.
I have one more doubt, what if there is no parvw field coming from the idoc, i.e the field itself is missing in the idoc.
Then the source structure xsd and target xsd will not match right there will be mesage mapping trasformation error right.
--
Srini
Edited by: Srinivas Davuluri on Jun 26, 2008 1:22 PM
Hi,
Do like this
String finalStr ="Independent"; instead of String finalStr. It will work.
If there is no field coming and you have used that in your udf for mapping, yes it will fail. To avoid that you can use the standard Node function "exists" to check if the node is coming or not. If it is coming pass it else map udf input parameter with constant.
Hope this solves all your problems.
Thanks
Amit
Hi,
It is not possible. It must be some problem with data. If still it doesn't work, the code is very simple to understand. Just understand the above code and do some tweaking as per your requirement. It is very simple if else logic. See if your conditions are getting satisfied or not else change the logic. I gave you solution now you have to make it working and surely it will work.
Thanks
Amit
Hi,
Why you need Partner in FixValue? I am not able to see any thing named Partner in FixValue.
Are you referring to Value Mapping?
Thanks
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.