cancel
Showing results for 
Search instead for 
Did you mean: 

Exit Module Processor

Former Member
0 Kudos

Hi,

My scenario is File ->XI->File. On receiver side, file should not be created if there is a perticular value for a perticular field. For that i have written a module to check that value, but after checking the condition how can i specify that file should not be created.Do i need to change any parameter of the adapter or call any method that directly exits from the Module processor as well as Resource Adapter.

Regards,

Gowtham K.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi guys,

Thanks for the reply,

Now i am more clear on my doubt. Is there any way to call CallSAPAdapter module from our module.

I need a module here why because i have to go for some more enhancements in this like reading PDF files, storing into Excel files and some more tasks for which i should use module.

Currently i was stuck up with "how to call the CallSAPAdapter in my module".

Regards,

Gowtham K

Former Member
0 Kudos

Hi,

1.what do you want if your condition is not to create the file. What do you want to do with the incoming message.

2. CallSAPAdapter should the last module after your customised modules in module tab.

3. Do your content based routing in Integration directory regarding file to be sent to which system.

Hope it helps,

Regards,

satish

Former Member
0 Kudos

Hi Satish,

If my condition hasn't satisfied i just want to discard the message.It should not create any file on receiver system.I haven't put CallSAPAdapter on receiver communication channel module tab.Because I want to call that module only if my condition satisfies , then only it can proceed further based on configuration data. Otherwise just discard the message.

Regards,

Gowtham K.

Former Member
0 Kudos

Gowtham

I think you intend to CONDITIONALIZE the call to Adapter module based on content..I am not sure if there is a way to do it..But ss offcourse you can choose whether to write the file/not inside the module by writing a exit based on the XMLPayload value inside the code..

Former Member
0 Kudos

Hi Sriram,

I tried like u said. But i thought it may not be the proper way to solve this.Because when ever u change Transport protocol , message protocol parameters u need to do a lot of changes in the module code. So i just want to handover the control to CallSAPAdapter when my condition satisfies.

Regards,

Gowtham K.

Former Member
0 Kudos

Hi Gowtham,

I feel you should allow the message to come to Integration engine and in content based routing discard the message.

If condition is not met , You will get reciever not found error. or configure a dummy reciever and throw that message there .

If you still want to call Call SAp adapter bean in ur module here is the code, i have not tested it but should be in this line...

1. Call the context node

2. get the local home node for bean

3. Get the local node of CallSapAdapter bean

4. Call the process method by passinf context amd module data.

try {

InitialContext ctx = new InitialContext(); // Get the root context

CallSAPAdapterLocalHome home =

(CallSAPAdapterHome) ctx.lookup("localejbs/sap.com/CallSAPAdapter"); // get the local home for CALLSAPADAPTER

CallSAPAdapter local = home.create(); // Get the local node of CallSapAdapter bean

local.process(ModuleContext mc, ModuleData md) // Call process method.

}

catch (Exception ex) {

throw new SAXException( "Error while calling CallSAPAdapter" + ex.getMessage());

}

Hope it works,

Regards,

Satish

Former Member
0 Kudos

Hi Satish,

Thanks for the reply,

Do i need to download any jar files. Because it is giving an Error "Class can't be resolved for CallSAPAdapterLocalHome class". Where can i get the Jar file tha contains CallSAPAdapter.I have searched on Noncentral Adapter Engine. but didn't get that.

Regards,

Gowtham K.

Former Member
0 Kudos

Hi ,

Little change:

try {

InitialContext ctx = new InitialContext(); // Get the root context

ModuleLocalHome home =

(ModuleHome) ctx.lookup("localejbs/sap.com/CallSAPAdapter"); // get the local home for CALLSAPADAPTER

ModuleLocal local = home.create(); // Get the local node of CallSapAdapter bean

local.process(ModuleContext mc, ModuleData md) // Call process method.

}

catch (Exception ex) {

throw new SAXException( "Error while calling CallSAPAdapter" + ex.getMessage());

}

it should be ModuleLocalHome for CallSAPAdapterLocalHome

and ModuleLocal for CallSAPAdapterLocal.

You dont need to download any jar.

Regards,

Satish

Former Member
0 Kudos

Satish,

But in that case we should not include CallSAPAdapter in our Configuration settings right because we are calling the same directly from our module bean.

Regards

Rajeev

Former Member
0 Kudos

No we dont need to keep CallSAPAdapter in Module Tab (adapter configuration) as we are calling it from our bean.

Regards,

satish

Former Member
0 Kudos

Hi Satish,

I have called the CallSAPAdapter from my module. In sxmb_moni also it is showing successful.But in RWB-> message monitoring for Adapter engine on XI it is giving my message is cancelled with Erros.The detailed Error :

"Putting message into send queue failed, due to: Message ID 9450ad40-4f89-11da-8cc7-000c76084e55(INBOUND) already exists in database: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPLXIDB.SYS_C00114752) violated."

"Delivery of the message to the application using connection AFW failed, due to: Message ID 9450ad40-4f89-11da-8cc7-000c76084e55(INBOUND) already exists in database: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPLXIDB.SYS_C00114752) violated.

2005-11-07 12:31:45 Error The message status set to FAIL."

"Asynchronous error detected: Message ID 9450ad40-4f89-11da-8cc7-000c76084e55(INBOUND) already exists in database: com.sap.sql.DuplicateKeyException: ORA-00001: unique constraint (SAPLXIDB.SYS_C00114752) violated. Trying to report it."

"Asynchronous error reported. "

I have put audit log entries in my module from that what i understood is CallSAPAdapter module is called andreturned without Errors, after that when my module returns from there it is giving error statements.

Is there any other way that i can proceed like "Place the CallSAPAdapter in module tab , but depending on condition in my module i want to specify whether it should be executed or not."

Regards,

Gowtham K.

moorthy
Active Contributor
0 Kudos

Why can't u check same in the Receiver/Interface Determination ? You can check the fields in the Interface Determination.

Why u want to use Module Processor here ?

Regards,

Moorthy

Former Member
0 Kudos

Gowtham

It makes sense to filter out your message in content routing instead of using a module..

put XPATH condition for the payload struct in the condition editor and route it to your system..