cancel
Showing results for 
Search instead for 
Did you mean: 

How to test Particulare Communication Channel is active or not in UDF?

former_member189354
Contributor
0 Kudos

Hi,

Can any body suggest me how to code in UDF particulare Communication Channel is active or not. If it is inactive then I have to thow exception else ok.

Appreciate for your response.

Regards,

Daniel.LA

Accepted Solutions (1)

Accepted Solutions (1)

ravi_raman2
Active Contributor
0 Kudos

Daniel,

Check this..

String BSys = "BS_FSCM_AR_CLNT100";

/1. Determine a channel (Business system, Communication channel).

Channel channel = LookupService.getChannel (BSys,"CC_RFC_TEST");

Then you do a

//2. Get a RFC accessor for a channel.

accessor = LookupService.getRfcAccessor(channel);

add this code

try{

if(accessor == null;

}catch(Exception e){

throw new Exception("Communication channel for System " + BSys + "Inactive ");

}

That should fix it....:-)

Hope that helps

Regards

Ravi Raman

Channel.

Answers (2)

Answers (2)

bhavesh_kantilal
Active Contributor
0 Kudos

Above logic would work for adapter supporting Lookup's ( JDBC , SOAP and RFC ) . You will not be able to grab the status of the XI adapter inside a UDF.

Regards

Bhavesh

former_member189354
Contributor
0 Kudos

Hi,

Is there any way can I catch the status. I am planning to write abap mapping in that check the rfc destination will do. Can you suggest on this.

Regards,

Daniel.LA

Former Member
0 Kudos

Hi,

If I have understood your ques properly, then I think it is not possible. Since your UDF starts working when processing reaches to message mapping after Receiver Determination, Interface Determination, Interface mapping, and then message mapping. So if the CC will be inactive then your UDF will not work.

Please correct me if i have not understood the requirement properly.

Regards,

Sarvesh

former_member189354
Contributor
0 Kudos

Hi Sarvesh,

Thanks for your reply. In Configuration I am created receiver communication channel this of XI Adpater receiver (Inbond Proxy). In message mapping itself I need to test whether the particular system which is pointed by Communication change is Up or down. If it is down then I need to throw exception in message mapping itself instead of message hitting the target system. Suggest me on this.

Regards,

Daniel.LA

Former Member
0 Kudos

Hi,

If your target communication channel is inactive then your message will not reach to the target system.

Regards,

Kumar

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>>whether the particular system which is pointed by Communication change is Up or down.

You can use Alert to find out .

Regards

Agasthuri Doss