on 2006 Mar 29 1:16 AM
Hi everyone,
I have a following scenario..
Source Message
<Maintag>
<tag1>
<number>1</number>
<message>This is</message>
<Date>03/27/2006</Date>
</tag1>
<tag2>
<num>1</num>
<mes>crazy</mes>
<Time>11:30</Time>
</Maintag>
Target Message
<Result>
<number>1</number>
<message> This is crazy</message>
<Date>03/27/2006</Date>
<Time>11:30</Time>
</Result>
How can I do this mapping? Can I do it in GUI or need Java mapping??
Thanks for the suggestions...
Thilothama
Hi,
Its not required to go for Java mapping. Graphical mapping can slove problem. If standard functions are not statisfying your requirement, a small user defined function to chk the number and then to concat message will work.
-Kavita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You can solve this using graphical mapping.
Use the if then clause.
If <number> isequal to <num> then, map <number> to <num>, source message to <mes>, source time to <Time> etc.
Regards,
Smitha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thilothama,
You can use the user defined functions present.
->use the equals function to check if the two numbers are equal.
-> give the output of the equals step to the input of an if without else function.
So then the mapping will take place only if the two numbers are the same.
Hope this helps.
Regards,
Jesse.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thilothama,
If you have same number of tag1 and tag2 nodes in source message, you can use the standard function concat on <message> and <mes> nodes. And assign the <number>, <date> and <time> directly to the result.
praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
comparing using ifThenElse will not serve the purposes as it doesnt compare the corresponding values..
Eg. tag1...1,2,1,3
tag2...1,1,2,3
so u need to sort both the queues and apply the formatByExample function..then u'll get the desired result. Check out the documentation..http://help.sap.com/saphelp_nw04s/helpdata/en/67/7ca04267deb111e10000000a155106/content.htm
praveen
Praveen,
Actually, I have an RFC - which has BAPIRET - it takes a table of input values and after execution, returns back a table of BAPIRET for each row in the input table. Ineed to mix the message, type I get from BAPIret and the input values and map to the output - for the input values sent - this is the message output...So Do I need formatbyExample even to check within a single message??
Praveen,
I dont have the row number in the table - but I can create one field in the datatype and in the mapping I can increment for each row created right? If so how do i do it?? just could u throw some light on it..plz.. and in the rfc I can assign the row number in the ROW field. Can you give some sample code for formatByExample??
Its a custom RFC - not the standard one. But do you think I can do anything else otherthan comparing the message for Row number? If I just do plain graphical mapping, like pick from both the nodes and map to target one, what kind of problems will occur - given that the number of bapiret is equal to the number of rows in the other table.
You can do the plain Graphical mapping with the following assumptions.
No of entries in BAPIRET and Input table are equal
The matching order is maintained in these queues correctly (as desired).
If you are not sure about the order...you have to sort bot the queues on one common field and then apply formatByExample.
For more clarity, go thru the examples in /people/sundararamaprasad.subbaraman/blog/2006/02/21/real-example-for-formatbyexample
If you still not clear...gimme the src and target xsd fo ur messages...In case of ur custom rfc....copy-paste the XSD after importing it into IR.
http://help.sap.com/saphelp_nw04s/helpdata/en/67/7ca04267deb111e10000000a155106/frameset.htm in this link the advanced user defined function has String as arguments. Can I send integer values?? For example that ID is integer, can I still use this function? or do I have to convert integer to string?
Praveen,
Thanks for such a help...I am planning to use the user defined java function which they have mentioned in the above link. I have added Row to my other table and going to treat as a common entry for bapiret and my input table. Is this solution fine or u think i will need formatbyExample??
Thank you
Thilothama
User | Count |
---|---|
57 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
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.