cancel
Showing results for 
Search instead for 
Did you mean: 

How to map IDOC POIPRO to B2MML in MII transaction (SAP MII 12.0)?

Former Member
0 Kudos

Hi all,

I would like to map Message LOIPRO01 (Production Order) to B2MML message (B2MML-V0401-ProductionSchedule) to send to external system.

Actual situation: Message LOIPRO01 has been stored in Database Buffer with Type Categorized.

To process this message LOIPRO01, I have created a transaction in MII Workbench with Message Services actions as below:

1. Create Query Messages action to query this Message LOIPRO01 in Database Buffer.

2. Create Repeater action to process multiple IDOCs.

3. Create Read Message action to read this Mesasge LOIPRO01 via its ID. And I would like to map IDOC LOIPRO01 to B2MML here (in Outgoing of Link Editor): Read_Message_0.MessageDocumentXML => Transaction.OutputData:

a. Transaction.OutputData has B2MML structure and is OK (It is configured OK by Reference Schema Loader action before). It's OK.

b. But Read_Message_0.MessageDocumentXML don't has IDOC LOIPRO01 structure, it has only one XML field which contains all content XML of IDOC LOIPRO01. It's not OK.

Therefore, I can't specify each field in IDOC LOIPRO01 to map to each field of Transaction.OutputData (for example, map field AUFNR (in IDOC) -> ID (in B2MML) can't be done because field AUFNR (in IDOC) can't be specified in XM file Read_Message_0.MessageDocumentXML).

So anyone know how to get the structure of IDOC LOIPRO01 from XML field Read_Message_0.MessageDocumentXML, please help me? Or we have another solution to get structure of IDOC LOIPRO01 from Database Buffer?

Best regards,

Vinh Vo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Vinh Vo,

after processing the Read Message action, the MessageDocumentXML property contains the LOIPRO, right? To map the LOIPRO data to a target XML node (which you might have initiated using the Reference Loader), you can use a Assignment action like this:

Example values Expression Editor of theLink Editor:

Target XPath:

Load_ProdSched_B2MML.XmlContent{/ns1:ProductionSchedule/ns1:ProductionRequest/ns1:ID}

Expression:

Transaction.Input_LOIPRO{/LOIPRO01/IDOC/E1AFKOL/AUFNR}

Is this what you are intending to do?

Michael

Former Member
0 Kudos

Hi Michael,

Yes, it's my purpose.

But when I added the mapping (in Outgoing of Assignment action) following your direction:

Target XPath:

Load_ProdSched_B2MML.XmlContent{/ns1:ProductionSchedule/ns1:ProductionRequest/ns1:ID}

Expression:

Read_Mesasge_0.MessageDocumentXML{/LOIPRO01/IDOC/E1AFKOL/AUFNR}

And then click on 'Evalute' button, I got the Evaluation result is empty while value of field AUFNR is '60003445'.

In this case, the path of node AUFNR is OK, but we can't get its value.

I think that we can't access to each node of MessageDocumentXML property because this property have XML type, this property don't have POIPRO01 IDOC structure explicitly.

Is it right or I have to choose another solution?

Thanks a lot Michael,

Vinh vo

Former Member
0 Kudos

Hi,

You check this run time by pressing F5 or F6. Evaluate is only for our offline testing purpose. What you do is put a tracer action block and map the message of tracer with your expression :

Read_Mesasge_0.MessageDocumentXML{/LOIPRO01/IDOC/E1AFKOL/AUFNR}.

Then press F6, see the results.

-Suresh

Former Member
0 Kudos

Vinh,

when using expression Read_Mesasge_0.MessageDocumentXML{/LOIPRO01/IDOC/E1AFKOL/AUFNR}, you will access the value of the node AUFNR from the Idoc directly. To see if this works ok, please follow the proposal from Suresh.

When you see how to get the value, then you can use it in the assigment action. As target of the value you will use a node from the B2MML structure. In the Link editor, you can drag the source value (the LOIPRO node AUFNR) to the target node ID in the B2MML B2MML.XmlContent{/ns1:ProductionSchedule/ns1:ProductionRequest/ns1:ID}. (the namespace ns1: is automatically set by MII).

You have to map a LOIPRO node to a B2MML node to assign the values. The structure in the MessageDocumentXML property is exactly the same as the LOIPRO structure, of whatever your message contains, so you will be able to use XPath to extract the values you need.

Good luck

Michael

Former Member
0 Kudos

Hi Suresh and Michael,

You are right!

Now I can get whatever I need, so my problem was solved.

Thank you all very much. ;-D

Many thanks,

Vinh

Answers (0)