cancel
Showing results for 
Search instead for 
Did you mean: 

1:n Transformation using JAVA Mapping Scenario

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Frnds,

I done a scenario using 1:n Transformation Scenario using XSLT,Graphical Mapping.

But i want to develop scenario Using JAVA Mapping.

Can anybody done the same scenario using JAVA Mapping share the links..

Regards,

Raj Sekhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi raja sekhar

check the help link

Java Mapping of Adapter-Specific Message Attributes Locate the document in its SAP Library structureUse

http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm

Developing Multi-Mappings for Integration Processes

http://help.sap.com/saphelp_nw04/helpdata/en/42/f3ca2529491bc7e10000000a11466f/frameset.htm

regards

kummari

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi unable to find the appropriate answer..

I want to develop the scenario using JAVA Mapping 1:n scenario,

If anybody having the scenario screen shots pls help me.

Regards,

raj

former_member190389
Active Contributor
0 Kudos

How many target messages do you have?

rajasekhar_reddy14
Active Contributor
0 Kudos

4 target messages i have in receiver.

can you tel me the procedure to write JAVA Mapping..if u do have any program pls send.

its very urgent requirement ..

Looking for your replay

Raj

former_member190389
Active Contributor
0 Kudos

Could show the source structure and what target structure you require?

I can give you the steps to create one.

rajasekhar_reddy14
Active Contributor
0 Kudos

Source

Test

Target

Test1

Test2

Test3

Hi if u give solution for this.. i will do it.But i am thinking wheathere it is possible using Java mapping or not.

if so how should proceed. Which parcer we should use.

Regards,

Raj

Edited by: Raja Sekhar Reddy T on Jul 4, 2008 1:36 PM

former_member190389
Active Contributor
0 Kudos

You can use SAX parser for this

firstly create a StringBuffer sb object which will store our target output

when startDocument() gets called append the xml declaration in this method

sb.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");

sb.append("<Root>");

....

next for the Test element you have your startElement() method called which will contain the name of your source tag i.e Test

for this , you will need to set a variable boolean isTest to true which was initialised as a false value.

in the characters method you will get the value present in this tag.

test the variable isTest for true value.

if it is true then append the following

sb.append("<Test1>"name"</Test1>"); //name is the buffer passed in characters method

sb.append("<Test2>"name"</Test2>");

sb.append("<Test3>"name"</Test3>");

at the end your endelement() will be called

here reset the value of isTest to false.

in your endDocument()

sb.append("</Root>");

lastly convert to byte[] and then to outputStream format

Edited by: Progirl Progirl on Jul 4, 2008 2:00 PM

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi ProGirl,

Thanks for your replay but my requirement little bit different

I have a source message

Purchaseorder

*ProduletLineItem

If suppose 2 product line items occur

the target message should occur 2 times

Purchaseorder

ProductLineItem

Purchaseorder

ProductLineiItem

i have to see 2 messages in SXMB_MONI.

Using JAVA SAX Parsing mechanism i have to implement, its little bit tricky...Can u give the snippet code...

THanks for your replay..I awarded points too..

Lokking forward

Raj

Edited by: Raja Sekhar Reddy T on Jul 5, 2008 8:06 AM

Edited by: Raja Sekhar Reddy T on Jul 7, 2008 10:08 AM

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

resolved

bhavesh_kantilal
Active Contributor
0 Kudos

Hello,

When closing a thread, please provide approproiate comments on how the issue was resolved rather than just saying Thanks and Resolved.

As you have closed multiple threads at the same time, as you can see you have ended up with 5 threads on the forum page with single word closures.

In case you haven't please read the rules of Engagement,

Step 3: Provide Feedback and an Update

Finally, it's nice to follow up with a brief update if you found the solution. People may try to help not because they know the answer, but because they are interested in solving the same problem; or people may just encounter the same issue in the future and be searching the archives. It's a good way to give back to the community, irrespective of whether you are a beginner or an expert.

Regards

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

You need to manually create the <Messages> & <MessageX> tags within the target message (and consider that the input message will have these tags also).

Check my reply on this thread:

Regards,

Henrique.