Skip to Content
author's profile photo Former Member
Former Member

Creating a dynamic RFC destination in a BSP?

Hello,

I've been playing around with the webmonitor BSP that comes with the 620 system and I would like to expand it to look at all application instances as well on the system.

I do this now by

CALL FUNCTION 'TH_WPINFO' DESTINATION rfcdest

TABLES

wplist = r3_list.

Given the rfcdest of the server I want to look at. In theory I should be able to give the rfc destination of an application server as well. The question is how can I dynamically create the rfc destination? Not manually create them first.

I do this now to get the list of the servers

CALL FUNCTION 'TH_SERVER_LIST' DESTINATION RFCDEST

TABLES

LIST = tablelist

exceptions

NO_SERVER_LIST = 1.

where tablelist-name is the server names.

Is it possible in a BSP to then take that server name and dynamically create the RFC connection? I do something similiar with JCo and I make my connection to each server dynamically.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Mar 10, 2004 at 04:22 PM

    Hi Craig,

    It is my understanding that you cannot generate RFC destinations in R3 on the fly.

    However, there is a standard RFC entry for each application server, of type Internal.

    For example, if your hostname is "host01", your sid is "B01" and your instance is "00", there is an internal RFC by name host01_B01_00 that you can use.

    The trick is to find out all internal RFC destinations.

    One way could be to read table RFCDES for all entries of type "I" (field RFCTYPE)

    hope this helps.

    cheers,

    Thorsten.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Actual this seems to be working for me...

      Tables: rfcdes.

      DATA: rfcdest LIKE RFCDES-RFCDEST,

      RFC_OPTIONS LIKE RFCDES-RFCOPTIONS,

      RFC_CLIENT LIKE RFCDES-RFCDEST,

      begin of instances occurs 5,

      host(10) type c,

      sysnr(3) type c,

      end of instances.

      instances-host = [HOST NAME].

      instances-sysnr = [SYS NUM].

      append instances.

      loop at instances.

      RFC_OPTIONS = 'H=%HOST,S=%SID,M=%MANDT,U=%USER,L=%LANGU,Z=%PWD,'.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%HOST' instances-host.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%SID' instances-sysnr.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%MANDT' '000'.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%USER' '[USER]'.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%LANGU' 'E'.

      PERFORM REPLACE_STRING

      USING RFC_OPTIONS '%PWD' '[PASS]'.

      RFC_CLIENT = 'IM-CSB_%HOST_%SID_%SYSNR'.

      PERFORM REPLACE_STRING

      USING RFC_CLIENT '%HOST' instances-host.

      PERFORM REPLACE_STRING

      USING RFC_CLIENT '%SID' '[SID]'.

      PERFORM REPLACE_STRING

      USING RFC_CLIENT '%SYSNR' instances-sysnr.

      RFCDES-RFCOPTIONS = RFC_OPTIONS.

      RFCDES-RFCTYPE = '3'.

      RFCDES-RFCDEST = RFC_CLIENT.

      INSERT RFCDES.

      IF SY-SUBRC >< 0.

      write: / 'RFC_ENTRY_EXISTS'.

      exit.

      ENDIF.

      ************************************************************************

      • Verify new desitnation is active

      ************************************************************************

      call function 'RFC_PING' destination rfc_client

      EXCEPTIONS

      communication_failure = 1 message msg_text

      system_failure = 2 message msg_text.

      write: / 'Result: '.

      write: SY-SUBRC.

      delete from rfcdes where rfcdest = RFC_CLIENT.

      ENDLOOP.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.