on 05-04-2006 6:24 PM
hi,
i have 5 suppliers. Source is IDOC.
I have to generate an xml. There are is a field in the header tag in the xml that vary from supplier to supplier.
I have to determine what needs to go into the <identity> tag based on the idoc supplier.
<header>
<identity>123</identity>
</header>
Supplier 2:
<header>
<identity>444</identity>
The only option i think is in the Graphical mapping we can check for PARVW and determine the Supplier and map the corresponding identity value.
What options do i have to generate the <identity>?
I can achieve the above using Graphical Mapping.
Other than Java and XSLT what other options do i have?
Thanks,
Tirumal
PS: If tomorrow more suppliers are added i should not be in a situation to change the whole mapping.
Message was edited by: Tirumal Kumar Pappu
Hi Tirumal,
You can write one simple User Defined Function and set the incoming value into a Global Container. And use this COntainer Value whenever you required in the Mapping. Atter this, put just if then inbuilt function and go forward.
http://help.sap.com/saphelp_nw2004s/helpdata/en/22/e127f28b572243b4324879c6bf05a0/frameset.htm
Hope this helps,
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mohan -
This example has output split into multiple lines.
This is not my requirement.
I want to map one-to-one value in source and target but based on the values in PARVW.
I am able to map this but the mapping has become too complicated(Graphical). So just wanted to know if there is any other way.
The example that you pointed me to is splitting the messages into multiple lines.
Thanks,
Tirumal
Hi Tirumal,
<i>I am able to map this but the mapping has become too complicated(Graphical). So just wanted to know if there is any other way.</i>
I know that , it is more lengthy, unreadable rather than complex. That the reason I have given the idea of Global Container.
The blog shows the example, how to write Global Container. You are requested the same right ? ANd blog is not talking baout your scenario.
Thanks,
Moorthy
hi,
I created a User defined function and i have the mapping as shown below:
String[] a = new String[100];
int i,j ;
j = 0;
for(i=0; i<parvw.length; i++)
if (! parvw<i>.equals(ResultList.CC) &&
! parvw<i>.equals(ResultList.SUPPRESS) )
a[j++] = parvw<i>;
for(i=0; i<a.length; i++)
if (a<i> != null && a<i>.equals("LF"))
<b>if (partn<i>.equals("0000010283"))
result.addValue("123123123");
else if (partn<i>.equals("0000011239"))
result.addValue("170368430");</b>
If you look at the highlighted statements i am hardcoding the values that i need to map to the header in the addValue.
Is there a dynamic way to do it instead of hardcoding the values inside the UDF ?
If i have add a new supplier and addValue then i have to change it in UDF.
Thanks,
Tirumal
Message was edited by: Tirumal Kumar Pappu
Hi,
>><b>if (partn.equals("0000010283"))
result.addValue("123123123");
else if (partn.equals("0000011239"))
result.addValue("170368430");</b>
You can try this aproach, use <b>FixValues</b>. So that if any new supplier is there then you can add the needed value in FixValue.
Give the output of FixValue (say <i>fa</i>) as the input of the UDF.
So the above highlited code can be changed as
<b>result.addValue(<i>fa</i>);</b>
Regards
Suraj<b></b>
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.