on 08-18-2006 11:16 AM
Hi,
I need to map source specific elements into target generic elements which are specialized with a "name" attribute.
I don't know how I can specify in the same time the "name" attribute's value ( currency or edi_currency or ) depending on the present source elements (CURCY, HWAER, KUNDEUINR) and copy this source elements value as the target elements value...
Thanks for your help
Adalbert
Ex:
Source:
<ORDERS05>
<IDOC>
<E1EDK01>
<CURCY>XXX</CURCY>
<HWAER>YYY</HWAER>
<KUNDEUINR>ZZZ</KUNDEUINR>
...
</E1EDK01>
</IDOC>
</ORDERS05>
Target:
<MYORDER>
<HEADER>
<PROP name="currency">XXX</PROP>
<PROP name="edi_currency">YYY</PROP>
<PROP name="vat_reg_nbr">ZZZ</PROP>
...
</HEADER>
</MYORDER>
Hi Adalbert,
you can do your mapping very easy with standard graphical mapping features. There is no need for a user defined function. Just do the following:
1. Do the following mapping:
CURCY --> PROP
Constant[currency] -->@name
2. Duplicate the structure PROP (right mouse click and pick duplicate subtree and map the second occurrence of PROP as follows:
HWAER --> PROP
Constant[edi_currency] --> @name
3. Duplicate the structure PROP again and map the third occurrence as follows:
KUNDEUINR --> PROP
Constant[vat_reg_nbr] --> @name
Check also the following <a href="/people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool">blog</a> on how to duplicate subtrees.
Regards,
Claus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
Thanks for your help.
I will test today and let you know.
Adalbert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just taking the UDF idea suggested by Abhy, you can do this,
1. The input to the UDF will be a constant ( which will have one of the 3 values CURR , HWAER , KUNDEUINR ) as well as FIELD
In your UDF , check for the constant value , and send out the corresponding value for the attribute .
Mapping will be as follows,
<CURCY> ---
<HWAER> --- <PROP>
<KUNDEUINR>--
For the mapping of the ATTRIBUTE NAME,
<CURCY> ---
CONSTANT -- UDF
<HWAER> ---
CONSTANT -- UDF NAME
<KUNDEUINR>--
CONSTANT -- UDF
Regards,
Bhavesh
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adalbert,
You can write a small UDF to achieve your requirement.
The input for the first UDF will be your "CURCY", "HWAER" and "KUNDEUINR"
if (CURCY.length>0)
return CURCY;
if (HWAER.length>0)
return HWAER;
if (KUNDEUINR.length>0)
return KUNDEUINR;
Use this UDF as the mapping program between "CURCY", "HWAER", "KUNDEUINR" and "PROP"
The input for the second UDF will be the same, but you will use it as a mapping program between your "CURCY", "HWAER", "KUNDEUINR" and attribute "name"
if (CURCY.length>0)
return "currency";
if (HWAER.length>0)
return "edi_currency";
if (KUNDEUINR.length>0)
return "vat_reg_nbr";
I hope it helps...
Regards,
Abhy
Message was edited by: Abhy Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.