A few months ago I had what I thought was a unique problem when I was asked to process payment confirmations for a supplier. The supplier would FTP XML documents to us and the content would be used to update our R/3 system. The problem was the documents would be one of three types, which isn’t an issue in itself. However, they would have the same file name prefix (the suffix was a timestamp in case you are wondering) so it would be impossible to identify the contents by referring to the file name. As I would be using a single communications channel to import the files how would I process different XML documents through single interface? I found most of the information I needed in Weblogs and Forum postings but it took a while to put it together. So I thought I would blog the solution for future reference.
1) Create the Data Types, Message Types and Message Interface as normal. Remember to create a generic Data Type/Message Type with a single element.
2) The Message Interface is shown below. You will notice that the ‘Output’ Message refers to the Generic Message Type.
3) Import the RFC’s. I’ve picked a couple of random RFC's used in the past.
4) Create two Interface Mappings. One of the IM’s is shown below. You will notice that the Source Message refers to the Generic Message Type. This isn’t a problem and I’ll explain why later.
4) Double click on the Mapping Program name to create the Message Mapping for the request. When the Message Mapping program is created the inbound Message Type will refer to the Generic Message Type. Change this to the required Message Type and map as usual. 
Now create the Message Mapping for the response. Unlike the mapping for the request the correct message type will be prepopulated. Then repeat the process for the second message.





