cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to dynamically determine the SENDER Message Interface?

Former Member
0 Kudos

Hi,

We have a scenario where customers want to send us HTTP messages containing an XML payload to XI. We are using the Plain HTTP SENDER Adapter for this. We will then map that XML file to an IDOC and use the IDOC RECEIVER Adapter to send it to R/3.

Here is our problem:

The XML payload in the HTTP message sent by the customer can contain one of MANY different types of XML messages. I would like to be able to parse that message and then dynamically determine, and set, the Sender Interface. Then routing and mapping will happen like normal based on the new Sender Interface etc.

Note that Interface is a mandatory field in the URL for the XI Plain HTTP Adapter and the customers CANNOT send data to more than one URL on our side. Many Interfaces means many URL's we can only have one URL.

Is dynamically setting the SENDER Interface based on message payload possible? Has anyone done this?

Is it possible to do this using Java Mapping? I can't see how because mapping is a 'later' step once routing based on Interface etc has already taken place, and interface determination has started to take place.

If anyone has any suggestions or ideas that would be greatly appreciated.

Thanks,

Brendan

Accepted Solutions (1)

Accepted Solutions (1)

prabhu_s2
Active Contributor
0 Kudos

u can have one MT that has all the field combination. so when the message (different xml) is recv all the fields will be intact with the MT and mapping can be done to the idoc for posting in r3

Former Member
0 Kudos

Hi Prabhu,

I tried this before and it didn't work, plus it is a messy solution even if it did work. I would like my message interfaces to match 1:1 to the documents being sent.

I just want to simply parse the payload (even as a String) and set the Sender Interface. Sounds pretty simple, but maybe SAP assumed everyone would be able to use lots of URLs to call the same system (poor design).

Do you have this working as you have described? If so, can you please give the exact steps you did to get it to work.

I have read in SAP documentation that by using Interface Determination and Java Message Mapping that the SENDER Interface (and other fields of sender) can be set in the mapping program dynamcially. But I cannot understand how this is possible because mapping is a number of steps AFTER routing/interface determination. The SAP documentation is very poor and list only high level information.

Here is the documentation which clearly says that the Sender Interface can be changed dynamically using Java mapping, but I couldn't get it to work. I also cannot understand how XI can route to the mapping program based on an interface and then 'go back' and change that interface - it's like going back in a time machine?!?!?! Unless the entire flow of events is evaluated 'completely' first and executed later - which would allow modification during mapping??? But I dont think this is the case??

Accessing Adapter Specific Attributes (example given is File Adapter, but same concept for all adapters):

http://help.sap.com/saphelp_nw70/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

Java Mapping Runtime Constants available:

http://help.sap.com/saphelp_nw70/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

I'd like to know if anyone has got this working as described in these two documents to manipulate the Interface field of the SENDER Plain HTTP Adapter??

Maximum points rewarded for those who have done this before and can explain all the steps.

Thanks,

Brendan

prabhu_s2
Active Contributor
0 Kudos

hi

<b>>>>>Do you have this working as you have described? If so, can you please give the exact steps you did to get it to work</b>

nope i havent configured such real time scenario but had just configured a sample scenario in my early days where a http client is used to send message to xi and map to idoc for master data creation. In my http client i just had added/removed few soruce fields for data trasnfer (cardinaltiy set to 0..1)

Former Member
0 Kudos

Hi Brendan,

I think along with Prabhus idea can you also see if you can use

Continue Message Processing with the following receiver?

btw.. Can you please copy and paste from the links which you pasted earlier where it is mentioned specifically that the Sender Interface can be changed?

btw.. is the structure different for all the XML?

Thanks.

Sumit

Former Member
0 Kudos

Hi Sumit,

I am not sure what "Continue Message Processing" is? Can you explain further?

The links are posted on this page, 3 messages above this one.

The structure of each XML that can be sent in the HTTP Request is different.

Thanks,

Brendan

Former Member
0 Kudos

Hi Brendan,

XI documentation infact is correct.

ASMA and Runtime constants are not the same, they are different.

Both ASMA and Runtime constants' values can be read from with in a mapping (using the sample java code given in the documentation) but only ASMA values can be changed and not runtime constants' value.

Sender interface is a Runtime constant, so you can only read its value with in a mapping.

P.S: For accessing runtime constants, ASMA you dont need a java mapping, it can be done using java codes with in a UDF in graphical mapping itself.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Brendan,

I saw those links but no where it was mentioned that we can change Sender Interface in mapping. so thought would confirm from you if i missed somethign. cause to me it doesnt make sense to change the sender interface in mapping.

Continue msg processing wont work in ur case..

Just a idea.. Mite not be the best one..

Let your sender send messages to a single interface(link)..

you make BPM as receiver.. and then iside BPM you can use the source msg to figureuo out which mapping to call .. so u can call the relevant mapping which would be fit for source to target..

btw-- you do have a interesting problem..

Regards,

Sumit

Former Member
0 Kudos

Hi Jai,

Thanks for the clarification.

So do you think it is therefore impossible to change the Sender Message Interface dynamically at Runtime?

Any idea on how else I might achieve what I am trying to do? Or is this just 'impossible' with XI ? (having one URL to post to for HTTP into XI)

Would I have to write an Adapter Module? I notice that the 'Module' tab is greyed-out in my HTTP Sender Comms Channel - so maybe that is not possible too?

Regards,

Brendan

Former Member
0 Kudos

Hi Brendan,

>>So do you think it is therefore impossible to change the Sender Message Interface dynamically at Runtime?

True. As you already said this is like time reversal. Impossible.

>>Would I have to write an Adapter Module?

No way again Since HTTP adapter is implemented as a service in ABAP engine directly no modules are possibe.

>>Any idea on how else I might achieve what I am trying to do?

Upto my knowledge using HTTP adapter with same URL for multiple scenarios is impossible.

I can suggest you some work arounds if you can tell me how the XMLs are different from each other. Can you post 2 or 3 sample XML messages here.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Sumit,

As Jai just pointed out, I was looking at the Adapter Specific Attributes (which can be changed) and I thought it also meant that the Runtime Constants could also be changed - obviously incorrect.

Thanks for the BPM suggestion, but I don't think that will work either. The problem with all of this is that I "don't know" what the source message is unless I can parse it and set it, so I cannot assign it to the correct Message Interface (not even Abstract Interface) to then map from at all. I can parse the Payload using Java and in a Java program I can easily determine what the Message Interface needs to be - that bit is easy, it is just that XI has no functionality it seems to allow dynamic setting of the correct Message Interface, or even just the correct Message Mapping because Message Mapping is linked to the Interfaces.

I will keep digging for an answer. I have to think of another approach. I can write this in ABAP or Java very easily, but just cannot get XI to co-operate !! This is such a SIMPLE thing I am trying to do, just very annoying that XI doesn't cater for this. SAP Business Connector/WebMethods catered for this very easily (we are upgrading from BC).

Hopefully someone will have some more suggestions.

Thanks,

Brendan

Former Member
0 Kudos

Jai,

The XML documents are different xCBL documents, such as "Order", "ChangeOrder" etc. Although they have a lot of similarities, their key lower level tags are different.

We will have other XML documents in the future also.

It would have been perfect if XI could be like SAP Business Connector (and it is not an option for us to leave our Business Connector system turned-on just to do routing, although that would work fine.)

For example, here are 3 different XML document that we want posted to the exact same URL:

Order:

http://www.xcbl.org/xcbl35/SOX/samples/ABCScenario/OrderSample-ABC.shtml

ChangeOrder:

http://www.xcbl.org/xcbl35/SOX/samples/ABCScenario/ChangeOrderSample-ABC.shtml

OrderStatusRequest:

http://www.xcbl.org/xcbl35/SOX/samples/ABCScenario/OrderStatusRequestSample-ABC.shtml

Thanks again,

Brendan

Former Member
0 Kudos

Brendan,

One possible work around that I could think of now.

>>> I "don't know" what the source message is unless I can parse it

Configure 2 scenarios.

1. HTTP (Same URL) -XI - File

2. File - XI- Your desired target

In the first scenario, in the mapping parse the XMl and find out the desired interface to be used. Then access the ASMA "Directory" and for each type you can specify a different directory.

In the 2nd scenario you can configure one cc each for one type of interface.

Cons: If there is a large number of different type of XMLs, then you need to configure that many scenarios.

Do update me on how you plan to proceed.

Regards,

Jai Shankar

Former Member
0 Kudos

Jai,

Good suggestion under the circumstances, but I don't think I want to introduce reading/writing to a file system. I want to keep it as simple/robust as possible.

I will think on this some more in the next day or two.

I have awarded you points.

Thanks,

Brendan

Answers (2)

Answers (2)

prabhu_s2
Active Contributor
0 Kudos

i dont think that dynamic determination of sender MI is possible....even in java mapping.

Former Member
0 Kudos

Hi,

To can dynamically set the SENDER Interface based on message payload. When you define conditional Mapping in the Design time. This is possible when defing the Datatypes in that you can anyone of the field to some value(and this value will descide the Sender/Receiver). And if u want to test this then come to Intergration Directry----Configuration there you can test the mapping by giving some values to the feild........Hence by following this process you can have the required option

IF helpful reward with points

Regards

Sai Ganesh