cancel
Showing results for 
Search instead for 
Did you mean: 

How to check whether RFC port is opened or Not

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Check this FM /BDL/_GET_RFC_DESTINATIONS

* write target destinations into internal table
select * from /bdl/sesdest
          into corresponding fields of table rfcdest
          where sessno = session_number
            and client = session_client.

if sy-subrc <> 0.
   init_msglog_sessmand session_number session_client.
   msg_log_line =
   'No RFC destination found: transfer not possible'."#EC NOTEXT
   warning msg_log_line.
   raise dest_not_found.
endif.

Former Member
0 Kudos

We had a problem with an RFC destination that periodically was unavailable. I wrote the following  program (in the attached file) to check if the destination was available, and create a background event if it was unavailable. Hopefully the program is self-explanatory.

Bruce

Answers (3)

Answers (3)

former_member192295
Active Contributor
0 Kudos

Hi Andy,

Port open is one time activity and it will open if we placed request to basis.  I think no need to check each time whether port is open or not.  Any specific reason are you cehck in program whether open port or not before call function.

As suggested in earlier blog check SM59 window and check wther able to connect target sytem or not.

Hope this will help you.

Former Member
0 Kudos

Hi,

Please check in SM59.

Regards,

Charan M.

0 Kudos

i want to write alogic for that. I want tocheck it in a report whether port is opened succesfuly or not ?

Himayatullah
Active Participant
0 Kudos

Hi Andy,

You can use RFC_PING_AND_WAIT FM to make sure connection is available or not before calling your custom built RFC FM.

Thanks & Regards

Himayat

Former Member
0 Kudos

Hi,

You can use telnet <IP ADD> <PORT> and check if you are able to connect to it.

Regards,

Sohrab Kapoor

0 Kudos

hey I do not want to connect. i want to check whether POrt connection is opened or not ?

former_member193518
Active Participant
0 Kudos

RFC usually goes over the SAP Gateway, so you can check in transaction SMGW on the destination system to see the gateway log, this will tell you which port it is listening on and whether it is working.

0 Kudos

Hi Darryl, i want to use a flag in Program which will gives me next path. like which port is opned and according to that i want to use the if...endif cases.

former_member193518
Active Participant
0 Kudos

Aha, I understand.

This is an RFC enabled program that you are writing.

You need to ask an ABAP developer about that.  I'm not an ABAP person.