on 05-16-2011 5:14 AM
Hi All,
I have a mapping requirement as
1.Target field 1
LIST/...../..../...../......./C_C080/D_3036
Source field
CustomerName
Mapping rule:First 35 characters of CustomerName sholud be mapped to the Target field 1
Target field 2
LIST/......../........./........./......../C_C080/D_3036_2
Source field
CustomerName
Mapping rule:Next 35 characters of CustomerName should be mapped to Target field 2
2.Target field
LIST/S_UNB/S_UNH/D_0062
No source field
Mapping rule:Unique sequence number of ORDERS messages within this transmission ( incremented by 1)
As far as ORDERS is concerned ,it is the constant value assigned to one of the Target fields that is LIST/S_UNB/D_0026
3.Target field
LIST/S_UNB/S_UNH/S_UNT/D_0062
No Source field
Mapping rule:Fixed mapping sequence number is equal to field 0062 in UNH,that is ,the mapping rule mentioned above in the second mapping requirement for the target field LIST/S_UNB/S_UNH/D_0062.
4.Target field
LIST/S_UNB/S_UNZ/D_0036
No source field
Mapping rule:Calculated in mapping: Number of messages in one interchange
Please help on these things.
Thanks in advance
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Shweta,
For 2 & 3,Please create following three UDFs
import com.sap.aii.mapping.api.*;
public String UNHCounter(Container container) throws StreamTransformationException{
try {
CounterBean be = CounterFactory.getCounterInstance();
return "" + be.nextCounter("COUNTER_UNH_ORDERS");
}
catch (Exception e) {
return "exception_in_UNHCounter" + e;
}
}
import com.sap.aii.mapping.api.*;
public String SetLocalVariable(String a, String b, Container container) throws StreamTransformationException{
/*Store value in local data container
a: mapping value and return parameter
b: name for stored value
*/
GlobalContainer myGlobalContainer;
myGlobalContainer = container.getGlobalContainer();
myGlobalContainer.setParameter(b.toUpperCase(), a);
return a;
}
import com.sap.aii.mapping.api.*;
public String GetLocalVariable(String a, Container container) throws StreamTransformationException{
/*Get value from local data container
a: name for stored value
*/
GlobalContainer myGlobalContainer;
myGlobalContainer = container.getGlobalContainer();
if (myGlobalContainer.getParameter(a) == null) {
return "";
}
else {
return (String)myGlobalContainer.getParameter(a.toUpperCase());
}
}
2.Target field
LIST/S_UNB/S_UNH/D_0062
Mapping logic:
UNHCounter(UDF)
\
SetLocalVariable(UDF)---> D_0062
/
UNHCounter(Constant)
3.Target field
LIST/S_UNB/S_UNH/S_UNT/D_0062
Mapping logic:
UNHCounter(Constant)---> GetLocalVariable ---> D_0062
4.Target field
LIST/S_UNB/S_UNZ/D_0036
You can map any dummy value (ex- #messages) ,this field is calculated automatically after conversion
Please let us know if this helps.
Best Regards,
Shweta Kulkarni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use substring function to achive 1 & 2 mapping logics.
4&3 not clear.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja Shekhar,
Thanks for the quick reply.
use substring function to achive 1 & 2 mapping logics.
Means,the substing should have hte value form 0 to 34 or 1 to 35?
How can this mapping implemented useing the substing ?
2.Target field
LIST/S_UNB/S_UNH/D_0062
No source field
Mapping rule:Unique sequence number of ORDERS messages within this transmission ( incremented by 1)
As far as ORDERS is concerned ,it is the constant value assigned to one of the Target fields that is LIST/S_UNB/D_0026
As far as 3 is concerned,I think it is the fixed mapping with the value mentioned in the second mapping that I mentioned that is for LIST/S_UNB/S_UNH/D_0062
Please help me on this.
Thanks in advance
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.