cancel
Showing results for 
Search instead for 
Did you mean: 

FILE TO IDOC SCENARIO

Former Member
0 Kudos

Hi ,

I have a scenario in which my source structure is somewhat like this .

<header >

</header>

<body >

</body>

<body >

</body >

<body >

......

.....

.....

</body>

<trailer></trailer>

to be more precise .

Root

A 1 to 1 .

_B

1 to unbounded .

_

C 1 to 1 .

and the IDOC structure is like

IDOC

H ( header)

|

B child of header ( body within the header )

Now the problem is after reading a flat file from the file adaptor in the mapping part of the scenario for each body structure repeating itself in the source file I have to generate a separate IDOC with the same source structure so that for each of the <body></body> tag encountered in the source xml file a separate IDOC needs to be posted in the R/3 system .How can I achieve that . Can anybody help me on the same .

Regards ,

Ashish .

Accepted Solutions (0)

Answers (1)

Answers (1)

cdumont69
Contributor
0 Kudos

Hello,

See this link to get your file with the file adapter :

Then you can use BPM with a foreach block to create all your Idocs and send them.

Or your can use one mapping that create one IDOC that contains multi idocs.

Hope it help !

Regards,

Chris

Former Member
0 Kudos

Hi ashish ,

The structure of file adapter will be .

Header ,1

details , *

trail ,1

recordset per message 1.

it will generate separte message for each record.

What u need to do in IDOC .

u will have segment wilh occurance 1

and occurance 0..999(many..)

map header or trail directely to occurance 1 as applicable in IDOC.

map details directely to occurance many as applicable.

the field of header or trails which are required to map to occurance many segment use copyvalue function to duplicate the header values.

Hope this will help.

Thanx & regards

Vinod Ahir

Former Member
0 Kudos

Hi,

Thanks for the reply.

We are able to do the mapping successfully.

But, we when test the scenario, the call adapter step is showing up the error "unable to interpret MI_IDOC_PACKAGE'

the integration repository has the following details

1. Idoc is imported into XI

2. XSD of the IDOC is downloaded and modified the max occurence of IDOC element to unbounded to accept the multiple IDOCs (IDOC package)

3. The modified XSD is uploaded as external definition and an Message Interface is created based on that.

4. Message mapping is created with souce and target(MI_IDOC_PACKAGE) as the external definition message type.

5. Interface mapping is created with source and target as the MI created out of external definition(MI_IDOC_PACKAGE).

In Directory

1.We have given MI creted out of the external definition as receiver interface.

But we are wondering how does the IDOC adapter knows the IDOC to be posted, as we are only specifying the MI (MI_IDOC_PACKAGE)created out of external definition.

Could anyone have experienced this?

Regards

Ashish