on 11-12-2008 9:41 AM
Hi Guys
Here is a mapping requirement
Source
MT_MATMAS 1.1
msgfn 1.1
matnr 1.1
ersda 1.1
laeda 1.1
TARGET
Specifying partiular Segement
E1MTXHM 0...9999
SEGEMENT Attribute
MSGFN 0.1
TDOBJECT 0.1
TDNAME 0.1
TDID 0.1
TDSRAS 0,.1
TDTEXTTYPE 0.1
SPRAS 0.1
Now " ersda " of source contains a very long text of more than 400 characters length
now i need to cut those text into each of 132 of size and each 132 sized characters are to be populated to the TDTEXTTYPE of target.
i know i should generate the node E1MTXHMM based upon the number of 132 character and after creating those i have to populate each 132 characters into TDTEXTTYPE under each Node E1MTXHM
How can we handle this is there any way i could use message mapping r udf
if any how can kindly give me a essence
rgds
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Followed the thread was useful to step further
but the target Subnode has has occurence 0.1 but the parent node has 0..unbound.
i have mapped the udf to parent node it's occuring many times , but under this subnode first one is getting populated rest is not getting populated
any views
regards
srini
Hi,
You need to use the UDF in link for the target parent as well as child node. Just handle the context of child node.
I guess you can use splitBy function for that.Try and let us know.
Just use ERSDA --- > UDF ---> E1MTXHM and ERSDA --- > UDF --->NodeFunction SplitByValue ---> your text Target field
Thanks!
Edited by: sudhir tiwari on Nov 12, 2008 11:42 AM
Yes by using the function SplitByValue will do the trick, anyway have you tested you interface for less that 132 char, it will give you suppressed value if you have not done the changes in the UDF as shown below.
The modified UDF is as below.
//write your code here
while(a[0].length() >132)
{
String tem = a[0].substring(0,132);
a[0] = a[0].substring(132,a[0].length());
result.addValue(tem);
}
if(a[0].length() < 132)
{
String res = a[0].substring(0,a[0].length());
result.addValue(res);
}
Regards,
Sarvesh
Hi Srini,
Breaking the string into 132 char can be done by using some UDF see the link which Sudhir has recomonded, main thing is to create the segment E1MTXHM, depending upon how may times you got 132 char e.g. if incoming text is of only 132 char then you will create only one E1MTXHM... am I correct??
If yes then just duplicate the segment E1MTXHM 3 times and map each segment with ERSDA as shown below:
1st E1MTXHM
if ERSDA length u2265 132 then create E1MTXHM.
2nd E1MTXHM
if ERSDA length u2265 264 then create E1MTXHM.
3rd E1MTXHM
if ERSDA length u2265 396 then create E1MTXHM.
you can use the standard function to calculate the length of ERSDA.
I hope this will help you.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh
Wat i did was
created a UDF
//write your code here
while(a[0].length() >132)
{
String tem = a[0].substring(0,132);
a[0] = a[0].substring(132,a[0].length());
result.addValue(tem);
if(a[0].length() < 132)
result.addValue(tem);
}
then since to create a number of parent nodes i just did below mapping donno know if it is right way but worked
ERSDA --- > UDF ---> E1MTXHM
Created many 15 nodes , my next step to popukate the :TDNAME filed with occurence 0.1 under the parent node E1MTXHM.
This is not getting populated. any workaround and inputs
regards
srini
Hi
U can see highlted one first element get's populated rest not getting populated
E1MTXHM 0 ..outbound
SPRAS_ISO 0..1
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
<SPRAS_ISO> Bharat Heavy Electricals Limited (BHEL) is the largest engineering and manufacturing enterprise in India in the energy re</SPRAS_ISO>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
<E1MTXHM SEGMENT="String">
<TDNAME>/</TDNAME>
</E1MTXHM>
</E1MARAM>
</IDOC>
</MATMAS05>
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.