cancel
Showing results for 
Search instead for 
Did you mean: 

How to send User defined error to SXMB_MONI......?

Former Member
0 Kudos

Hi

1 . I have done one file to file scenario. And my requirement is if i get same file again for ex: i have file is source directory (MyFile.txt20071012) if i get the same file by mistake on the same day, content may be different i have to send an error message to SXMB_MONI. How to send an userdefined error to SXMB_MONI.

2 . I have written one adapter module. In this i am getting host name inside my module and i have to send this host name to destination.

ex if source file is

<id>100</id>

<name>abc</abc>

my destination file should be like this

<id>100</id>

<name>abc</abc>

<host>host name</host>

I have mentioned my module in Sender communication channel . And i am successfully getting the host name and i am appending that host name to xmlPayload which i got from sender.After appending my host name to xmlPayload i have displayed the message in audit log like :<b> msg.getDocument().getText()</b>. Here i am able to see the result including host name.After this I am retruning input module data<b>(inputModuleData.setPrincipalData(msg))</b>. But in destination file i am not getting host name. source file as it is coming to the destination

Please help me

Best Regards

Ravi Shankar B

Best Regards

Ravi Shankar B.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Well you havent checked my answer in this threadfor your earlier problem?

Regards

Bhavesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Please raise an exception from message mapping and control it in determination.

see the below link how to throw an exception from MM

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

Regards

Chilla

Former Member
0 Kudos

Hi-

check these blogs

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

/people/sravya.talanki2/blog/2006/12/20/accessing-system-parameters-in-mapping-runtime

Former Member
0 Kudos

Ravi

Check this pdf file for writing back into the payload

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c0...

Regards krishna

Former Member
0 Kudos

ravi

You can get the host name by setting the dynamic configuration parameters (including Host name) in the File adapter Comm Channel and access it in ur java code

This is exactly what you do

<i>the info like "Directory", "FtpHost" etc are set as dynamic cinfiguration parameters in the cm channel. This info can be viewed within sxmb_moni.

So, actually , we have to invoke the getMessageProperty() method of the message to access the dynamic configuration info like

sourceDirectory = msg.getMessageProperty("http://sap.com/xi/XI/System/File","Directory");

to retrieve the Directory value.</i>

Similarly you can get the ftp host like

sourceFtpHost = msg.getMessageProperty("http://sap.com/xi/XI/System/File","SourceFTPHost");

Cheers

krishna