cancel
Showing results for 
Search instead for 
Did you mean: 

How to define IDOC as 'type' in 'Data types' ?

Former Member
0 Kudos

Hi all,

I am trying to define a data type which accepts multiple occurences of IDOC type in the same message. The required XML should be like this...

<All_IDOCs>

<ZUPFIN_> <--- this is the IDOC imported into XI

<IDOC>...

:

</IDOC>

</ZUPFIN>

<ZUPFIN_> <--- this is the IDOC imported into XI

<IDOC>...

:

</IDOC>

</ZUPFIN>

<All_IDOCs>

Now, there are more than 800 fields under <ZUPFIN_> IDOC. So I am trying to find out an easy solution to create the above data type without manuall adding each element.

Any idea ?

Thanks.

- Atul

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It sounds like something you might have to fix in the ID.

Former Member
0 Kudos

Hi,

To add more to it, I have already successfully set the scenario (by setting maxOccurrence as 'unbounded' in xsd) to receive multiple IDOCs at 'IDOC' element level. But now I want it at top (root) level, at <ZUPFIN_> level.

Thanks.

- Atul

Former Member
0 Kudos

Sorry Atul don't understand you,

you first question was easily answered by setting the unbound parameter but if you want to have the same way in the root level simply create a type with one object from type ZUFIN with maxOccurances unbounded. that shouls give you the desired result.

uri.

Former Member
0 Kudos

The problem is, I cannot make 'ZUPFIN_' as root, because otherwise it cannot be for multiple times. To add one more element above 'ZUPFIN_', I have to define a 'Data type' (as I believe so). Now how can I add the elements of the IDOC automatically in the data definition ?

Thanks.

- Atul

Former Member
0 Kudos

Hey

see if this helps you

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

this is for IDOC bundling,but i guess you can make any changes in xsd and re-import that.

the other way around would be to make a ZIDOC on R/3 side which will be same as the standard SAP IDOC but since its customized you can make any changes in it and then import this in IR,make sure you import the metadata too in IDX2

Thanx

Ahmad

Former Member
0 Kudos

Hi Ahmad,

As I have already mentioned above, I do not want multiple occurences of 'IDOC' element. Instead I want the multiple occurences of 'ZUPFIN_' (in Michael's blog you given by link, it is 'MBGMCR02'). So the example does not help here as roots cannot occur more than once.

I cannot have anything changed on R/3 side.

Thanks.

- Atul

Former Member
0 Kudos

hey

>>So the example does not help here as roots cannot occur more than once

yes,you are right,you can't have more than one root coz that will make the XML invalid,

you need to change the structure of IDOC,wrap the multiple occurences of root under one main node like <MainNode>.and then use this.

Thanx

Ahmad

Former Member
0 Kudos

You are absolutely right. That is what I want to do. But the question is HOW ?

I tried to tweak the xsd but did not succeed.

Any other idea ?

Thanks.

- Atul