cancel
Showing results for 
Search instead for 
Did you mean: 

Designing a generic transaction for different set of master data values

former_member1231563
Participant
0 Kudos

Hi Experts,

I am using SAP MII 12.2 and performing integration for an Oil and Gas major.

We have 8 interfaces to design for which we will be getting data in the form of XML's from SAP PI.

For each interface we have some data eg Plant,Material,StorageLocation,Tag,UOM for one interface.Similarily for other interface we may have 2 or more fields like cost centre etc.

We will mantain separate tables in MII also where all the master data corresponding to an interface will be stored.

The operation that has to be performed is almost similar for each interface that is for each master data key combination we have to fetch a quantity from SCADA and append it with same master data key combination values and send it back to SAP PI.

Now,My requirement is to design a generic Transaction which would serve the purpose for all the interfaces ,but the problem is that for each interface the set of master data key combination is diffrent and when i use a repeater to repeat through the rows of the data how can i dynamically assign a XPath so that the repeater works for any data(with different fileds) pertaining to any interface.

Although the actions performed are almost similar that is getting a quantity from SCADA corresponding to each master data key combination but is it possible to have one such generic transaction that could serve the purpose??

Please help me out on that one or if anyone has faced some similar issue do provide your valuable inputs.

Thanks,

Praveen.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Praveen,

As per my understanding from your question, I am giving you an idea hopefully it will help you.

1) for the "Dynamic XPATH", few conditions are there,

  • XML structure for each interface should be constant, then only you can use some fixed xpath for each interface.

So if I consider the above condition is satisfied for you then, you can keep all the xpath in shared memory as a map variable where you can use the interface identifier (considering that you should have some indicator to identify the interface) as a key and xpath as a value.

So when ever you are calling the xpath in the repeater then you have to use this,

Persistent.XPath{#Transaction.Identifier#}

So it will return the XPath and will repeat on it.

2) for generic solution while fetching the data from SCADA, few condition are there,

If the SCADA destination is same for all the interfaces then you have to set one destination only, but if there have separate SCADA destination then you have to maintain a map variable also for that in the shared memory (like above)

As per my understanding, creation of generic transaction is possible.

Regards,

Suman

former_member211944
Active Participant
0 Kudos

Hi Praveen,

One approach could be that you create 2 transactions:

First one containing the common functionality. For example it would get quantity from SCADA corresponding to each master data key combination. You could send the master data key combination as input to this transaction and then get quantity as output to this transaction.

Second one would iterate on the different interfaces(8 in your case) and then internally call the first transaction to get the quantity.

Another approach could be as follows:

This approach would extend the first approach. You could store the XPath of the elements in different XML's in a List in the transaction properties and then use them in the transaction. But this would work if the XML schema is constant for the interfaces i.e. each interface would send the data in the same XML structure each time.

Algorithm could be like this:

Iterate on the Interfaces{

XPath of the interface = List.getValue(index of iterator);

key = XML.getElementValue(XPath);

quantity = call to another transaction(key);

}

Note: Here the order of the interfaces and the namespaces in the collection should be same.

Note: Use #XPath# for getting the value from the collection during runtime.

Basically what I am telling here is that you can save the XPath of different XML's in the transaction properties and then use them while iterating through the XML's.

Could you share the XML's you are expecting from different interfaces?

Regards,

Rohit Negi.