on 07-04-2007 3:25 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.
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
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> 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?
> 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
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.
> 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
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] -
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.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.