cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping: Single iDoc at Source and Multiple Maps for Destination

Former Member
0 Kudos

Hi There,

I have a scenario in which R/3 will send PO (ORDERS05) to SAP SNC via SAP XI. The PO will be of 2 types (normal PO and Stock Transfer Order). For normal PO I have scenario in XI which conver the iDoc into "ReplinishmentOrderNotification" xml. For STO I have to convert the ORDERS05 to "DespatchedDeliveryNotification" XML.

Source and Destination systems in this case are same, incoming iDoc is also same. Please sugget me how I can configure the scenario so that it will select the correct map.

Thanks,

Nishant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nishant,

Based on some condition you may need to map the IDoc to 2 messages.

1. In case target system receives 2 messages,

You are already having scenario for normal PO.

Now create another Mapping program for STO PO in the same scenario.

In Interface Determination of ID of the same scenario, you can find '+' symbol to add

Interface mapping programs. Add another Interface mapping program created for STO PO.

Now put condition for both Interface mappings.

2. In case target system receives only one message at a time based on the condition,

No need of creating another Mapping Program.

You can add STO PO message also in the Message tab of the target structure of the mapping

program.

Based on condition, map the IDoc to 2 messages. Change the Interface mapping program and

accordingly do updations in ID also.

If any qs, let me no.

Regards,

Ravi.

Answers (3)

Answers (3)

former_member183908
Active Contributor
0 Kudos

Hi

U want to map the src idoc multiple destinations?

In ID at Receiver Determination level using condition u can send the message to the respective destination.for that we need to create the context objects or using X Path we can achive it.

Thanks

Former Member
0 Kudos

Hi,

They this,

In IR, Creat a mapping program and interface mapping for ORDERS05 to "DespatchedDeliveryNotification".

In ID, Where you have configured your first scenario,Go to the interface determination. THere you will see '+' to add another inbound interface and interface mapping.Add your second IB interface ther and put the condition on the IDOC field which tells it is STO. You need to put the condition for your first IB Interface aslo. There the condition will be Normal PO. And add your interface mapping program.

Let me know if you have any qs.

Regards,

Shweta.

siddhesh_pathak4
Contributor
0 Kudos

Hello Nishant,

Is there any field in IDOC which can tell that the PO is normal PO ot STO PO.

If there is any then use Dynamic configuration while passing the file name.

On that field put a condition check if the IDOC is STO or normal then accordingly pass the values to this function (to header of your file stracture).

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key,a);

return "";