cancel
Showing results for 
Search instead for 
Did you mean: 

1:n JDBC to IDOC

Former Member
0 Kudos

Is this possible without BPM? I have a SQL-query that can give n rows, each of these rows should result in one IDOC message (same type, same receiver).

I have done some tests now, and I get the error "Split mapping created no messages". Is this related to something else? Or is this because one cannot have multiple IDOCS in the receiver?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

IDOC structure:

The ZBXXX node is 0..unbounded since I have set occurrence to 0..unboounded under message in the Message Mapping. I have mapped the ZBXXXX node to row.

ZBXXXX 0.unbounded

IDOC 1..1

MATNR 1..1

DATE 1..1

justin_santhanam
Active Contributor
0 Kudos

Ketil,

Thanks for your co-operation! Please note that, if you change the messages in message mapping to 0..unbounded, then this concept is Multimapping. If your using IDOC adapter, then Multimapping is not possible in IDOC Adapter.

As Chirag pointed above(Michal's Blog), you need to export yout Custom to your desktop and change the Occurrence of IDOC from 0..Unbounded, and then re-import again as External Definition. Now you need to use this External Definition and you need to do the mapping.

Note: Please don't change target messages occurrences either Message or Interface Mapping. Coz Multimapping is not supported by IDOC adapter.

Please let us know your proceedings, we will be happy to help you out!

Thanks,

raj

Former Member
0 Kudos

check this link if helps

justin_santhanam
Active Contributor
0 Kudos

Anand,

I would appreciate, if you go through the whole thread and provide the correct reference document.

Thanks for your understanding!

raj.

Answers (10)

Answers (10)

Former Member
0 Kudos

Finally! Problem solved, the last error was an error in the JDBC configuration that made the message root-node not compatible with the mapping.

Thank you for all you help.

Former Member
0 Kudos

Sorry, no. Lets diffrensiate between the real custom IDOC, and the one imported as an external definition (as described in Michal's blog). My Interface mapping is like this:

Source Interface: MI_O_System_ObjectName

Target Interface: ZIDOC (This is the real IDOC from Imported objects)

Source Message: MT_ObjectName

Mapping program: MM_SystemAtoSAP

Target Message: ZIDOC (This is also the real IDOC. I would except to use the one imported as external definition for this, but I am not allowed to select that one.)

Since I only use the IDOC imported as an external definition in my Message Mapping I can understand why this goes wrong, I just can't understand how to fix it.

Thank you for all your help so far.

Update: This is the error I am receiving:

cin.sap.aii.utilxi.misc.api.BaseRunetimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ZIDOC/IDOC. Check XML instance is valid for source xsd ad targe target field mapping fulfils requirements of target xsd at mappingprogram.start.

Edited by: Ketil Stadskleiv on Nov 2, 2008 2:11 PM

justin_santhanam
Active Contributor
0 Kudos

Ketil,

Did you ran your message mapping in Test Tab of Message Mapping?

raj.

justin_santhanam
Active Contributor
0 Kudos

Ketil,

Did you ran your message mapping in Test Tab of Message Mapping?

raj.

Former Member
0 Kudos

Thanks a lot for the help so far. I have followed Michal's blog, and now I am getting a "RuntimeException in Message-Mapping-Transformation".

I do understand why (I think) since my interface mapping now is from my source Interface to the (real) IDOC, and this automaticallly includes the real-IDOC as the target message (which makes the message mapping incorrect).

My guess is that i have not followed step 6 correctly (). Can anyone please elaborate on this? Should I create an interface mapping where "specify the source and the target of this interface mapping as the standard IDOC"? This does not make any sense to me, same target as source? Where should I put my original interface "MI_O_System_Message"?

Best regards

justin_santhanam
Active Contributor
0 Kudos

Ketil,

Nope.I think you have interpreted it wrongly.

Specify the source Your Source Message -- and the target of this interface mapping as the standard IDOC In your Case you need to give your Custom IDOC

is it clear?

raj.

Former Member
0 Kudos

No, I still have the same problem.

I have the IDOCS as an imported object, not external definition. The root-node of the IDOC is mapped to row. As I said when testing this is the mapping tool it works fine with several messages.

Raj: I tried to change to occurrence of the target interface in the Interface Mapping. Then I got this error when activating: "Mapping program Message Mapping MM_AtoB does not match the interfdace mappin. The number of frequencies of source or target message for the message ampping are not identical to the number or frequencies of source or target interface."

Former Member
0 Kudos

u have to follow the below weblog which again i m sharing with u for changing the occurance of IDOC to unbounded.

Not u dont have to use the Imported IDOC instead use as external definition.

check the below log.

after that u need to import the IDOC XSD struture to external definition and use that structure in message mapping which will solve ur problem.

chirag

justin_santhanam
Active Contributor
0 Kudos

Ketil,

Which IDOC are u using? Is it Standard or Custom IDOC.

raj.

Former Member
0 Kudos

Custom.

justin_santhanam
Active Contributor
0 Kudos

Ketil,

If you don't mind could you please reply the IDOC structure with the occurrences, not the complete strcuture, till the root node is fine.

raj.

justin_santhanam
Active Contributor
0 Kudos

Ketil,

You don't need to change the occurrence of messages in your target Interface mapping. Only changing the occurrence of the IDOC would solve the issue.

raj.

Former Member
0 Kudos

In design I have set occurence of the target message (the imported IDOC) to 0..unbounded. In the interface mapping I have set the source interface occurence as 1 and the target interface as 0..unbounded. When I test the mapping in the test-tool the mapping works fine (creating multiple IDOCS).

When looking in the Payload of the message everything seems to work fine from the source. The Payload looks like this:

<resultset>

<row>

<ARTK>543534</ARTK>

<DATE>2008-10-10</DATE>

<NR>123</NR>

</row>

<row>

<ARTK>5555</ARTK>

<DATE>2009-10-10</DATE>

<NR>222</NR>

</row>

I use SAP PI 7.0.

rajasekhar_reddy14
Active Contributor
0 Kudos

your problem got resolved right.?

Former Member
0 Kudos

Did u mapped the root row node to IDOC root node,

if not then map the same.

also r u using IDOC structure as external definition?

chirag

prasad_ulagappan2
Contributor
0 Kudos

its possible...without BPM...i guess the error is because of some mapping issues....debug the mapping...

Former Member
0 Kudos

Split mapping created no messages is related to mapping issue because bydefault IDOC has max occurance of 1.

u need to change the occurance of IDOC from 1 to unbounded and use that IDOC structure as external definition, then it will not throw that error.

check the below log.

chirag

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi KETIL.

You can implement 1:n maping using Message Mapping or JAVA Mapping OR xXSL.

i implemented same requirement using Java MAPPING.

1:N Mapping without BPM you can implement easily.

select interface mapping 0 to unbounded

search for thread in sdn you wil find.

and alos explain your requirement so that i wil give the code.

reagards,

raj

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

There is either something wrong with your UDF (SQL Query) or that the mapping for the parent Node of the IDOC is wrong.

Regards,