cancel
Showing results for 
Search instead for 
Did you mean: 

Sending multiple idoc from one idoc (reoccuring node).

Former Member
0 Kudos

In follow up to my previous question today.

I have a idoc-xi-2 idocs scenario:

I am receiving CREMDM with multiple E1LFA1M segments. This Idoc needs to be split towards CREMAS and ADRMAS. I do this with a BPM. However, then only the first E1LFA1M comes through.

Should I then use BPM with a foreach block step??

How can I send one idoc for every E1LFA1M node in the inbound idoc????

Please help.

Greetings.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hans,

I suppose u need to send multiple CREMAS and ADRMAS IDocs for every occurrence of E1LFA1M segments to same target SAP system.

If correct, u can use the following approach for the same which uses BPM.

Use a message mapping inside BPM where u have single source and two targets.

Now in the target structures, change the cardinality of IDOC segments to 0..* and mapp these nodes to "E1LFA1M" segement.

BPM will have to be used for splitting here since in case of IDOC adapter on receiver side we cannot make use of multi mapping (enhanced Interface Determination) capability.

In case u are sending the IDOCS to different SAP systems, u will not require BPM as you can define two receivers in the receiver determination and then use two different mappings based on (IDOC packaging Blog - Multiple IDocs on the target side).

This should probably solve your problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes Raj,

It;s the split mapping I am having trouble with. In normal mode it works fine. However, when I change the outbound message occurance to unbounded, I do not get the structure of the idoc in the result pane.

I get

- Messages

- Message1

and then nothing.

What's wrong?

greetings

justin_santhanam
Active Contributor
0 Kudos

Hans,

May I know wht logic ur using. Ur changing the occurrence of target message only right!!!

I'll tell u the logic, can u please paste here some top level segments alone. Coz it would be easy for me to tell. Not the entire structure, juz top 7-10 nodes.

Best regards,

raj.

Former Member
0 Kudos

It's very easy actually:

on the left side we have

- Messages

-- Message1

--- CREMDM4

-


IDOC

-


BEGIN

-


EDI_DC40

-


E1LFA1M (This node appears multiple times in the source structure, contains the address)

and on the right side we have (this is where the multiple occurence is introduced)

- Messages

-- Message1

--- ADRMAS03 (maxOccur="unbounded")

-


IDOC (maxOccur="unbounded")

-


BEGIN

-


EDI_DC40

-


E1ADRMAS (this is where the address node is under)

So, for each E1LFA1M on the left I want one idoc one the right containing the address. The MDM server (source) places XML files with multiple E1LFA1M nodes in the file, these need to go to the R/3 system as separate IDOCs

Is this a clear description.

Thanks Raj, for your help so far!

justin_santhanam
Active Contributor
0 Kudos

Hans,

Thanks for providing the struture. The mapping which u did does it referring to split as per my previous replies. No Hans. Actually the source and target has to be same.

<b>Source</b>

Messages

-- Message1

--- CREMDM4

-


IDOC

-


BEGIN

-


EDI_DC40

-


E1LFA1M (This node appears multiple times in the source structure, contains the address)

<b>Target</b>

Messages

-- Message1

--- CREMDM4

-


IDOC

-


BEGIN

-


EDI_DC40

-


E1LFA1M (This node appears multiple times in the source structure, contains the address)

Map everything node to node straight mapping.

Don't map Messages in target and for Message1 map the following

E1LFA1M -


Split by value -


Message1.

What do u say, Please try the above logic n let me know the results. Next we will proceed to next mapping.

Best regards,

raj.

sridharreddy_kondam
Active Contributor
0 Kudos

Hi hans,

Since you need n no of idocs to be generated you have given in messages tab as 0...Unbounded... Thats fine..

Just map <b>E1LFA1M</b> with target ADRMAS03 ,IDOC,E1ADRMAS and try now...

But my question is how did you change the <b>IDOC</b> (in target struc) occurence to 0...Unbounded..

If you have used Extenal Definition of the idoc then only you can change the occurence to 0...unbounded for IDOC Node...

Am i right?

Regards,

sridhar

Former Member
0 Kudos

Hi Raj,

I'm getting your idea. However, when trying and testing this the result is:

cannot produce target element <b>/ns0:Messages/ns0Message1</b>. Check xml instance for source xsd and target-field mapping fulfills requirements of target xsd.

I have done exactly as you said. But the target Message node has a 1..1 occurence. How can I then map the splitbyvalue on this?

Do I need to map it differently?

Do you know what to do with this error?

Greetings and thanks

justin_santhanam
Active Contributor
0 Kudos

Hans,

U changed the message occurrences in Message tab right? So in your target structure above IDOC node u can find anyone of the node with occurrence 0..unbounded can u tell me which node it is. U have to map to that node.

Best regards,

raj.

Former Member
0 Kudos

Raj,

the node above the idoc node is the CREMDM node. It's like follows:

Messages 1..1

-Message1 1..1

--CREMDM 0...UNBOUNDED

---IDOC 1..UNBOUNDED

Greetings

justin_santhanam
Active Contributor
0 Kudos

Hans,

Let me confirm, that CREMDM becomes 0..Unbounded only bcoz u changed the message occurrence from Message tab right? If yes then,from IDOC node to sub level map directly to the target. For CREMDM E1LFA1M -split by value- CREMDM.

Try it out.

Best regards,

raj.

Former Member
0 Kudos

of course!

I don't need the multiple occurence in the message tab. Just 1 message containing multiple lines of idocs.

however, the split by value does not quit work yet for me.

Greetings

justin_santhanam
Active Contributor
0 Kudos

Hans,

It can be easily done using BPM. In previous thread u had Michals weblog right for changing occurrences. You have to use it now. U don't want for-each block. Change the IDOC occurrences of CREMAS and ADRMAS.

Now create 2 mapping programs .

Mapping 1 Source CREMDM Target CREMAS(External Definition)

Mapping 2 Source CREMDM Target ADRMAS(External Definition)

In BPM.

Receive IDOC -


> Use Fork

In Fork Branch 1 -


Transformation(Mapping 1) -


Send IDOC(CREMAS)

In Fork Branch 2 -


Transformation(Mapping 2) -


Send IDOC(ADRMAS)

Does the above logic make sense? I'm sure it will work.

Best regards,

raj.

Former Member
0 Kudos

> Hans,

>

> It can be easily done using BPM. In previous thread u

> had Michals weblog right for changing occurrences.

> You have to use it now. U don't want for-each block.

> Change the IDOC occurrences of CREMAS and ADRMAS.

>

> Now create 2 mapping programs .

> Mapping 1 Source CREMDM Target CREMAS(External

> Definition)

> Mapping 2 Source CREMDM Target ADRMAS(External

> Definition)

>

> In BPM.

>

>

> Receive IDOC -


> Use Fork

>

> In Fork Branch 1 -


Transformation(Mapping 1)

> -


Send IDOC(CREMAS)

> In Fork Branch 2 -


Transformation(Mapping 2)

> -


Send IDOC(ADRMAS)

>

>

> Does the above logic make sense? I'm sure it will

> work.

>

> Best regards,

> raj.

is this also possible without the fork? Just change the cardinality and then create a mapping from one idoc to two idocs and send them one by one?

justin_santhanam
Active Contributor
0 Kudos

Hans,

Please correct me if i'm wrong. You don't want to change the occurrences, instead you want to send for each E1LFA1M in source am I right? Its possible u have to use For-each block in this case.

Best regards,

raj.

Former Member
0 Kudos

> Hans,

>

> Please correct me if i'm wrong. You don't want to

> change the occurrences, instead you want to send for

> each E1LFA1M in source am I right? Its possible u

> have to use For-each block in this case.

>

> Best regards,

> raj.

Could explain me how Raj?

I have tried the occurences trick but it does not work. I have created a target idoc structure with unbounded idoc segments and the appropriate mapping. It's not working now.

However, when I try foreach statement, i cannot select a cuurent line in the block...

any suggestions?

greetings

Message was edited by:

hans vremden

justin_santhanam
Active Contributor
0 Kudos

Hans,

I think I confused you. See there is two approach

--If you are using For-Each block then there is no need for changing the occurences of the IDOC.

--If you are not using For-Each block then u have to chang the occurrences of the IDOC.

Best regards,

raj.

Former Member
0 Kudos

but if i'm using the foreach block i am not "allowed" to enter the current line parameter of the block.

And in the occurence version in bpm, I'm getting a To Be Delivered status from the workbench.

Could you please elaborate on the foreach block step?

Greetings

justin_santhanam
Active Contributor
0 Kudos

Hans,

I'll explain you the For-each block with an example. Bu before that I've doubt in your scenario. In you target mapping u are using CREMAS and ADRMAS am I right? Ok Fine . I'll ask u onething, while defining Interface Determination and receiver agreement which Inbound interface u will give can u clarify me the doubt.

Best regards,

raj.

Former Member
0 Kudos

> Hans,

>

> I'll explain you the For-each block with an example.

> Bu before that I've doubt in your scenario. In you

> target mapping u are using CREMAS and ADRMAS am I

> right? Ok Fine . I'll ask u onething, while defining

> Interface Determination and receiver agreement which

> Inbound interface u will give can u clarify me the

> doubt.

>

> Best regards,

> raj.

Raj that would be great.

CREMDM is the inbound interface

greetings

justin_santhanam
Active Contributor
0 Kudos

Hans,

Thats fine then , so CREMDM is the combination of both CREMAS &ADRMAS.

Please ignore my first reply then , it will not suit in your case.

Now let us come to an For-Each example. Take ur scenario itself. First u need mapping in order to split input message based on each E1LMAFM.

So here the source will be IDOC and the target will also be IDOC( Go to Message tab and choose the occurrence for target IDOC as 0...Unbounded)

Now we have to do the logic to split each messages.

For example.

<MT_Outbound>

<Records>

<Dealer id=0001>

<Saleorgn>Test1</Salesorgn>

</Dealer>

<Dealer id=0002>

<Saleorgn>Test2</Salesorgn>

</Dealer>

<Dealer id=0003>

<Saleorgn>Test3</Salesorgn>

</Dealer>

<Dealer id=0004>

<Saleorgn>Test4</Salesorgn>

</Dealer>

</Records>

</MT_Outbound>

You have to split the message , after splitting u will get the output as follows.

Here my constraint is I want to split the message for each dealer.

<Messages>

<MT_Outbound>

<Records>

<Dealer id=0001>

<Saleorgn>Test1</Salesorgn>

</Dealer>

</MT_Outbound>

<MT_Outbound>

<Records>

<Dealer id=0002>

<Saleorgn>Test2</Salesorgn>

</Dealer>

</MT_Outbound>

<MT_Outbound>

<Records>

<Dealer id=0003>

<Saleorgn>Test3</Salesorgn>

</Dealer>

</MT_Outbound>

<MT_Outbound>

<Records>

<Dealer id=0004>

<Saleorgn>Test4</Salesorgn>

</Dealer>

</MT_Outbound>

Thats it!!!

Now let say for example my target is IDOC I have to map each dealer to the IDOC and send to target system. Then you have to follow the below steps.

Receive ->Trasnformation[Mapping_Split]Block open-Transformation[Mapping source to CREMDM] -


Send IDOC-Block Close.

Please see below how u've to choose the container for FOR-EACH Block.

Source Message [Abstract Interfcae] [Don't check multiline]

Source Message_ML [Abstract Interfcae] [Check multiline]

Hans, does it helps.Is it clear.

Best regards,

raj.

Former Member
0 Kudos

Thank you very much. I will see and try to complete this.

I will come back to you on this

Tanks again!!!

justin_santhanam
Active Contributor
0 Kudos

Sure hans!!!

Best regards,

raj.

Former Member
0 Kudos

I'm goin nuts.

When I make my mapping it does not copy the structure.

When testing the message mapping the target result is:

- Messages

- Message1

And then nothing. How is this possible? Where should my first mapping be? Cuz I tried everyting now.

justin_santhanam
Active Contributor
0 Kudos

Hans,

Which mapping u are referring here, the mapping for split.

Best regards,

raj.