on 01-25-2006 2:00 AM
Hi All,
I have the following message structure
Source:
-
<messsage>
<header>
m
c
</header>
</message>
For each element under the header ,a seperate target tab " subject" should be generated.
Desired Target structure:
<message>
<Header>
<sub>
m
maths(constant)
</sub>
<sub>
c
chemistry(constant)
</sub>
</Header>
</Message>
Can somebody help me out in this mapping.
Thanks.
Sudha.
Hi Sudha,
Your source cannot be created in the format that you want. You can explore any of this tow formats,
<message> <message>
<header> 1... UB <header> m </header>
</header> <header> c </header>
</message> </message>
or,
<message>
<header>
<elem> m </elem>
<elem> c </elem>
</header>
<message>.
Once your create your source of any ofthe above 2 formats, the mapping will be easy.
Do let me know if you have any further clarifications,
Hope this helps,
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 Sudha,
One solution for this canbe as follows if you are using SP14.
Sp14 allows you to use the concept pf global variables. So, you can use a Global variable that will contain if the value is 'c' or 'm' and you can write an userdefinde function that will look into the value of this global variable and return the coresponding constant "MATHS", "CHEMISTry", etc.
Check this link out for the GLOBAL VARIABLES,
/people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
hope this helps,
regards,
bhavesh
Message was edited by: Bhavesh Kantilal
Hi Piyush,
Thanks for the continious efforts. here is the exact structure,
Source:
salesorder --- 1
header --- 1
soldtoparty(0-1)
shiptoparty(0-1)
billtoparty(0-1)
payer (0-1)
Desired Target Structure:
salesorder
Partners(0-1)
partner(0-4)
partnerfunctio(0-1)
partnernumber (0-1)
Example instance;
source:
<saleesorder>
<header>
<soldtoparty>3000</soldtoparty>
<shiptotoparty>3100</shiptotoparty>
</header>
</salesorder>
Desired target:
<salesorder>
<partners>
<partner>
<partnerfunction>sp</partnerfunction>
<partnernumber>3000</partnernumber>
</partner>
<partner>
<partnerfunction>sh</partnerfunction>
<partnernumber>3100</partnernumber>
</partner>
</partners>
,/salesorder>
Thanks.
sudha.
Hi Bhavesh and Piyush,
Hi Piyush,
Thanks for the continious efforts. here is the exact structure,
Source:
salesorder --- 1
header --- 1
soldtoparty(0-1)
shiptoparty(0-1)
billtoparty(0-1)
payer (0-1)
Desired Target Structure:
salesorder
Partners(0-1)
partner(0-4)
partnerfunctio(0-1)
partnernumber (0-1)
Example instance;
source:
<saleesorder>
<header>
<soldtoparty>3000</soldtoparty>
<shiptotoparty>3100</shiptotoparty>
</header>
</salesorder>
Desired target:
<salesorder>
<partners>
<partner>
<partnerfunction>sp</partnerfunction>
<partnernumber>3000</partnernumber>
</partner>
<partner>
<partnerfunction>sh</partnerfunction>
<partnernumber>3100</partnernumber>
</partner>
</partners>
,/salesorder>
Thanks.
sudha.
Hi Sudha,
With the help of UserDefined Functions, you can easily achieve this.
There will be 3 inputs like soldtoparty,shiptoparty,billtoparty.
You just have a "exists"
soldtopart--exists-userdefinedfn-----partner
shiptopart----exists-
billtopart----exists-
userdefined unction as
if(a[0].equals("true")){
result.addValue("sp");}
if(b[0].equals("true"))
result.addValue("sh");
if(c[0].equals("true"))
result.addValue("bp");
This will help you to achieve occurence of partner in target.
And generate the value for partnerfunction.
Just use split by value infront of this user defined function and map to partner function.
And for the partner no just use 6 input user defined function,
if(a[0].equals("true")){
result.addValue(d[0]);}
if(b[0].equals("true"))
result.addValue(e[0]);
if(c[0].equals("true"))
result.addValue(f[0]);
I hope you have got what you desire.
Cheers
Piyush
Hi Sudha,
There are two ways to proceed with this
<i>1.User defiend function</i>
a.header->user defined func->partner
User defined function
input(sold,ship,bill,payer)
if(!(a.length==0))
result.addValue(a[0]);
same for other three inputs)
b.header->user defined func->partfunc
if(!(a.length==0))
result.addValue("sp");
same for other three inputs
2.<i>Duplicate the target partner field 4 times</i>(since occurence is 0 to 4).
now
<b>sold->exists->createIf->partner</b>
<b>ship->exists->createIf->partner</b>
same for the rest.
user-defiend function (b) given above for partfunction
Cheers,
Rashmi
Hi Sudha,
One important thing this is not message splitting. Since as par your requirement speified. this doesnot require message splitting.
Please explain the desired output structure.
As if you want maths followed by m in single element then you have to use Concate function.
But i don't think you require this.
And if you require maths followed by m in different elements then you have to use element for holding the value m and maths.
In this case your output structure will be
<Header>
<sub>
<ele>m</ele>
<ele>maths</ele>
</sub>
<sub>
<ele>c</ele>
<ele>chemitry</ele>
</sub>
</Header>.
Pleae clarify what do you want.
Regards
Piyush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi if you want that target structure.
Then your input data type should be
header 1:1
Elemen 0:un
And mapping stuff
During mapping Element -
Sub
and with the help of fix value mapping, you can get constant value for each occurence of Element.So you will sub for every occurence of element like m,c,....
So
Element--
Element-fixValue----
User defined function as
for(int i=0;i<a.length;i++)
{
result.addValue(a<i>);
result.addValue(b<i>);
result.addValue(result.CC);
}
I hope this will serve the issue.
regards
Piyush
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
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.