cancel
Showing results for 
Search instead for 
Did you mean: 

Writing messages that flow within XI to a File System

Former Member
0 Kudos

All,

When a transaction happens or a message flows between a sender system and a receiver system thru SAP XI, then I have a requirement where in I have to write that information to a File System.

Information like,

  • Who is the sender or receiver?

  • Message content (does not matter whether the transaction is successful or unsuccessful)

  • Timestamp of the message

I need all the details of the messages to be written into a flat file when there is a transaction that involves SAP XI.

This is an urgent requirement and any help would really be appreciated.

Thanking you all,

Manisha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello

I have done almost the same thing using an adapter module...,, you'll have to write code in java and deploy it in form of an EAR to java stack,, there is a very good tutorial on it in SDN's how to guides

you can find that file Link: [Here|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e]

this would allow you to do what ever u want with payload and other info,, as soon as adapter engine recieves any data..

good luck

regards

Zahid

Former Member
0 Kudos

Hi Zahid,

Thanks a lot for your reply.

I want to know more about the module which you have developed, is it specific for a single adapter or scenario or will it work for all the scenarios running on the XI server?

Basically my requirement is to access the SOAP msgs whenever messages flows within XI irrespective of the scenarios. To be specific, whenever a transaction happens thru XI, all the related messages that are generated in XI should be handed over to an external system(in my case its a File System).

As I am an ABAP developer and very naive in Java, please provide a little further info on the developement that you have done before.

Waiting for your valuable reply.

Thanks

Manisha

Former Member
0 Kudos

I wrote my module for FTP adapter,,, and I am pretty sure that it should work for SOAP adapter as well...

what i did was ,,, I was expecting a coma separated file... and managed few error management procedures and used message id and and file parameter related info to write the file to another location in case of error and pass on dummy data to adapter engine for content conversion procedures....

the link mentioned in the previous message was the one I followed.... It should enable you to write your code in java as well....

afterward u may contact for any particular info... I would love to help you out in any problem for which I have domain knowledge...... moreover.. if the previous post was help ful than dont forget to award points

good luck

regards

Zahid

Answers (7)

Answers (7)

wilsonrsantos
Active Participant
0 Kudos

Hi Manisha !

My previous message was intended to be for you, but for a mistake, I put it in the name of Ravi.

As you are an abapper, take a look at the link that I´ve sent:

http://209.85.215.104/search?q=cache:JOwoNxe-F-0J:searchsap.techtarget.com/tip/0,289483,sid21_gci127...

This sample code find general data of the messages processed by Integration Engine and, makes use of some abap objects to read the XML Payload and, in this specific example, find a String in the XML Payload, but I think that can be easy to change this code to achieve what do you need.

Additionally, you can use the function SXMB_SELECT_MESSAGES to make the selection of the messages for what do you want get details. This function is used by the transaction SXI_MONITOR to filter the messages processed, according to the parameters that you fill in the transaction. Start the transaction, fills the parameters that you need and execute it, with the debugger on, and looks for the call of this function, and you will find out how to fill its parameters.

You can combine the use of this function, with the code sample in the link that I mentioned in the start of this message, to find out the data that you need.

I think that to generate the data what you want, to be used in a external tool to monitoring, will be better done using an ABAP program. How was mentioned in the other responses to you, it´s possible to write a adapter module to save data processed by the adapters but, this will need additional configuration in each Communication Channel that you have in your scenarios(and additional training to the people that will configure the communication channels).

If you solve your need using an abap program, the file(s) containing the data you need, can be generated calling a (Z)transaction, or configuring a Job to start your program periodically, to read the messages processed and generate the file(s) that you need.

Thank you for your attention.

Best regards,

Wilson

Former Member
0 Kudos

This is solely depent on the requirement.

and most os these queries can be resolve by Functional people or client.

Former Member
0 Kudos

Hi manisha,

I think u can add these details in the targt filename u r creating. U have all the details in the mapping itself, so u can create a dynamic file by mapping the target header to the file format u want. Please try this.............

wilsonrsantos
Active Participant
0 Kudos

Hi Ravi !

Look at this link:

http://209.85.215.104/search?q=cache:JOwoNxe-F-0J:searchsap.techtarget.com/tip/0,289483,sid21_gci127...

At this link you will find a sample ABAP program used to search XI messages by its XML contents, I think that you can change this ABAP program to extract all data that you need.

Best regards,

Wilson

Former Member
0 Kudos

Hi,

A pipeline represent a fixed processing run for particular XML messages and differs from other pipelines depending on the configuration of the Integration Engine. There are pipelines for a local Integration Engine in the sender or receiver system, or for a central Integration Engine that is configured as the Integration Server, for example.

The individual processing steps that an XML message must pass through when it is processed are called pipeline elements. Each pipeline element calls exactly one pipeline service.

Pipeline services provide functions for processing XML messages. They read and can change inbound XML messages, for example, the mapping or routing. They can also call processing processes, for example functions to create business data in an SAP component. The service type, number, and sequence are specified for each pipeline and cannot be changed.

When a source message reaches to the Integration server, it performs six steps before the message reaches the destination. These steps are:

1) Receiver Determination: This steps determines the system that participates in the exchange of the message.

2) Interface Detremination: For each receiver determine which interface will should receieve the message.

3) Message Split: If more than one receievers are found, Xi will instantiate new message for each receiver.

4) Message Mapping: Mapping to transform the source message to destination message format.

5) Technical Routing: Bind a specific destination and protocol to the message.

6) Call outbound Adapter: Send the transformed message to the adapter or a proxy.

One can examine these steps in Runtime Workbench using the Transaction: SXMB_MONI.

XI pipleine steps are-

Sender Agreement->Reciever Determination->Interface Determination->Interface Mapping->Reciever Agreement.

1) Sender adapter will poll the data into XI . This is carried out by Adapter Engine

Once it reached XI, it will in XI Message pipeline in the integration engine.

2) Reciever Determination is executed - to look into who is the reciever

3) Then Interface determination- Sender Interface and Reciever Interface Mapping

4) reciever Agreement- with adapter or proxy structure.

for further details refer

http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

Regards,

suresh

Former Member
0 Kudos

Monisha,

I dont understand the need of this requirement. WHy do you need to write the transactions involving XI in a File system? If you are doing this for monitoring, error handling then you have all SAP standard tools like SXI_MONITOR for checking IE msgs and RWB Message Monitoring for msgs in ae and IE.

There is no standard mechanism available to achieve your requirement. This has to be implemented pas part of your Interface design in XI. Even with that the information you capture will not be as complete as the standard tools.

Former Member
0 Kudos

Hello Jaishankar,

Firstly, thanks a lot for ur response!

This is basically to trap the SOAP meta data within XI which will be used by an external system for monitoring purposes. So what we are trying to do is: whenever there is a msg. flow within XI, immediately it should write the relevant (which I have mentioned in my question) info to an external system. For demo purpose, I have chosen it as a file system.

So basically, do we have to write a module which would be triggered whenever there is a transaction occuring with XI and the same module will have the logic to write the data to a file system? If yes, is there any blog or any help on how to develop this?

Can I have your id to discuss further on this?

Any help on this is appreciated!!!!

Thanks,

Manisha

former_member181962
Active Contributor
0 Kudos

Method 1.

1) Create separate message and interface mappings for each interface in your IR, to a structure that you want to maintain, in your file.

In each of the receiver determination step of your scenarios, add one more line with your PARTY and a SERVICE for your file system and create the corresponding interface determination(Using the mapping that you have created in IR) and receiver agreement.

This method is pretty cumbersome.

Method2)

As all the messages are stored in the XI system, you can write an abap report which pulls out the required information.

The tables involved are: SXMSPEMAS

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Thanks for the response!

As you said first method is quite cumbersome bcoz it can't be done for each and every scenario running on an XI server at each and every customer location.

The second method makes sense but again the info shud be spontaneous. I mean, suppose a transaction happens at 6.30PM, the data shud be written at that instant... it can't wait for the ABAP report to run at 8.30PM. The data becomes very much older at 8.30 PM.

So is there any way... to extract the info as and when a transaction happens.....

And the other question is: can u give me the list of other tables which has all the msg details? Like...the table SXMSPEMAS has all msg id's but whr the detailed info about these msgs id can be retrieved?

Awaiting for ur reply....thanks again for ur valuable response....

-Manisha

former_member181962
Active Contributor
0 Kudos

Check the tables that start with SXMS* and press F4 in se11 transaction in XI to find the relevant tables from which MONI pulls out the data.

REgards,

Ravi

Former Member
0 Kudos

What do you mean by Soap meta data? Do you mean the SOAP envelope that you can see in SXMB_MONI? If so, the process is very tough. Infact it will add more load on XI server than the original interface itself, if at all it is possible.

You can find my email-id in my business card

Regards,

Jaishankar

Edited by: Jaishankar on Jun 24, 2008 12:02 PM

Former Member
0 Kudos

Try to take all the details from the namespace http://sap.com/xi/XI/Mail/30