on 04-21-2014 3:20 PM
Hello SAP Guru's,
I want to know is it possible to retrieve the sender side interface name using the custom adapter module if it is possible please tell me how and through which api.
Any help is very much appreciable thank you very much.
Regards,
Avinash
Hi Team,
Thanks for your support i have solved the problem by using the module context as the condition i have used the custom module on both the communication channels and appended the generated file using a condition.
String Sender = (String) moduleContext.getContextData("sender");
if(Sender!=null)
{
Action act = msg.getAction();
String interface_Name = act.getName();
FileWriter fw = new FileWriter("/tmp/pitest/AuditFiles/AuditFile"+MSGID+".txt");
fw.write("outbound_interface_name:-->"+interface_Name+"\n");
fw.close();
}
else{
Action act = msg.getAction();
String interface_Name = act.getName();
FileWriter fw = new FileWriter("/tmp/pitest/AuditFiles/AuditFile"+MSGID+".txt",true);
fw.write("inbound_Interface Name:-->"+interface_Name+"\n"+"Message ID:-->"+MSGID+"\n"+"Message Direction:-->"+MSGDIR+"\n"+"Message Key:-->"+MSG_KEY+"\n"+"Business system sender:-->"+BS_sender+"\n"+"Business system receiver:-->"+BS_Receiver+"\n"+"SendTime:-->"+SendtTime+"\n"+"Receive time:-->"+RecivedTime);
fw.close();
}
Regards,
Avinash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Write a module in the sender adapter and use this piece of code
Message mes = null;
mes = (Message) inputModuleData.getPrincipalData();
String iname = mes.getAction().getName();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avinash,
Depending of the adapter, you can access to PI variables, like sender interface, with ASMA and variable substitution
For example, for file adapter Defining Variable Substitution for Target Directory/File Name - SAP Library
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Inaki,
Thank's for you suggestion but i want the both the interface names to be accessed from receiver side and store it in an output file of custom module is it possible to do it please give me a solution.
Is there any possibility of accessing the interface name using dynamic configuration bean on sender side channel and access that in receiver side channel please give me some solution.
Regards,
Avinash
Hi Avinash
You can write an UDF in message mapping to read the both sender and receiver interface.
Following is the code
InputHeader inputHeader = container.getInputHeader();
String SI = inputHeader.getInterface()
;
String RI = inputHeader.getReceiverInterface()
;
Hi,
check this: http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/engine/interfaces/messaging/api/Message.html
method: getFromService()
You can also get this info during mapping using standard function
Regards,
Praveen Gujjeti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avinash
Are you using the adapter module on the receiver channel side? If yes, then at this stage of the pipeline, the interface name has been transformed by the Operation Mapping, therefore using getAction().getName(), you will only get the receiver interface.
If you need to access the sender interface, you can try out Inaki's suggestion to store the sender interface name into Dynamic Configuration first (either at sender comm channel or message mapping). Then you can access Dynamic Configuration to retrieve it at the receiver side module.
Rgds
Eng Swee
Hai Eng Swee,
I am trying to get the sender and receiver interface names on single output file and your suggestion is really great but i have no clue how to access the dynamic configuration values of sender side channel on receiver side custom module can you please suggest me some solution.
Regards,
Avinash.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.