cancel
Showing results for 
Search instead for 
Did you mean: 

How to read Sender Interface name in adapter Module in PI 7.31

Former Member
0 Kudos

Hello All,

I am working on Adapter module .it accomplish to generate file with message id,message key ,sent time,received time,FromService(Business system names),toServiece(Business system name),sender interface name,receiver interface name .

i got all details in my file by calling module data by method get principal data,but i am fail to get sender interface in that file .

can you please guide me how to get sender interface name in adapter module.

I am getting some information from this following blogs

https://scn.sap.com/thread/1583665

but i am facing same error what they faced.

Please guide me to how to get sender interface name in adapter module.

Thanks

Ganesh

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Ganesh,

Please check the below thread

regards,

Harish

Former Member
0 Kudos

Hi Indrajit/Harish

Thanks for your sport.Now i am able to get sender interface name by calling adapter module .now .

here is the code.

File f = new File("/tmp/pitest/Audit/"+smid+"*.txt");

     if(!f.exists())

     {

      Action act = msg.getAction();

  String SndrinterfaceName = act.getName();

  FileWriter fw=new FileWriter("/tmp/pitest/Audit/"+smid+"*.txt,true);

  fw.write("Messageid-->"+smid+"\n"

  +"MessageKey-->"+smkey+"\n"

  +"Time Sent-->"+SentTime+"\n"

  +"Time Received-->"+ReceiveTime+"\n"

  +"Fromservice-->"+fromservice+"\n"

  +"SenderInterfaceName-->"+SndrinterfaceName);

   

  fw.close();

     }

     else

     {

      Action act = msg.getAction();

  String RcvinterfaceName = act.getName();

      //FileReader fw=new FileReader("/tmp/pitest/Audit/"+smid+"*.txt");

      FileWriter fw=new FileWriter("/tmp/pitest/Audit/"+smid+"*.txt",true);

    fw.write("\n"+"To Service-->"+toservice+"\n"+"RecInterfaceName-->"+RcvinterfaceName);

             fw.close();

     }

Thanks to All Team

Ganesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ganesh

Write a module in the sender adapter and use this piece of code

Message mes = null;

mes = (Message) inputModuleData.getPrincipalData();

String SI = mes.getAction().getName();

Also you can read the same by creating a UDF in message mapping

Following is the code

InputHeader inputHeader = container.getInputHeader();


String SI = inputHeader.getInterface() ;

javier_alcubilla
Contributor
0 Kudos

Hi Ganesh

Check this

Regards

Javi

Former Member
0 Kudos

Hi Javi

I have checked that link its having public void transform()method .

it returns null.i have already  posted this link in my original thread.

its having action class by using that we are getting only receiver interface name.

can you please provide any other solution.

Thanks for response.

Regards

Ganesh