cancel
Showing results for 
Search instead for 
Did you mean: 

registering RFC functions to a SAP RFC Gateway

Former Member
0 Kudos

Hi,

We're having a problem with registering RFC functions to a SAP RFC Gateway.

When using a given program, roughly based on the "rfcthsrv.c" example, in

which we install a given function towards the SAP RFC Gateway,

then call RfcAccept and finally, after a short time, check if the function

was installed correctly.

This train of events works fine when used on one system (hostname: PC_JALA),

but it does not work correctly when used on another system

(hostname: PC_SIS_SAP).

The call to RfcInstallFunction returns RFC_OK, but checking with

RfcCheckRegisterServer later on results in a total of 0 installed functions.

This seems to be an inconsistency in the SAP RFC interface.

We're using "SAP Frontend Package 6.20 Final Compilation 3".

Content of our saprfc.ini file

/===================================================================/

/* Type R: Register a RFC server program at a SAP gateway */

/* or connect to an already registered RFC server program */

/===================================================================/

DEST=saprfcserver

TYPE=R

PROGID=PC_SIS_SAP.SapRfcServer

GWHOST=Ishr3dvp

GWSERV=sapgw00

RFC_TRACE=1

Relevant code snippets:

/----


/

/* Install Full Library interface function */

/----


/

rfc_rc = RfcInstallFunction( name_asis_flib,

(RFC_ONCALL) asis_flib_call,

asis_flib_docu() );

...

/----


/

/* Accept RFC-Connection */

/----


/

rfc_char_t* new_argv[ 3 ] = { "-Dsaprfcserver", "-v", "" };

rfc_handle = RfcAccept (new_argv);

...

/----


/

/* Check if the function was correctly registered */

/----


/

rfc_char_t szHostname[ BUFFER_SIZE ]; // = "PC_SIS_SAP";

rfc_char_t szServiceName[ BUFFER_SIZE ]; // = "SapRfcServer";

rfc_char_t szTpid[ BUFFER_SIZE ]; // = "PC_SIS_SAP.SapRfcServer";

rfc_char_t szSapHost[ BUFFER_SIZE ]; // = "Ishr3dvp";

rfc_char_t szSapService[ BUFFER_SIZE ]; // = "sapgw00";

...

strcpy( szTpid, szHostname );

strcat( szTpid, "." );

strncat( szTpid, szServiceName, BUFFER_SIZE - strlen( szTpid ) );

rfc_rc = RfcCheckRegisterServer( szTpid, szSapHost, szSapService,

&ntotal, &ninit, &nready, &nbusy,

&error_info );

SAP RFC Gateway trace of the function registration and checking process:

(for the invocation, see about 450 lines down for another trace ...)

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

*

  • LOCATION SAP-Gateway on host ISHR3DVP / sapgw00

  • ERROR program PC_SIS_SAP.SapRfcServer not registered

*

  • TIME Mon Aug 23 11:18:36 2004

  • RELEASE 46D

  • COMPONENT SAP-Gateway

  • VERSION 2

  • RC 679

  • MODULE gwr3cpic.c

  • LINE 1598

  • DETAIL TP PC_SIS_SAP.SapRfcServer not registered

  • COUNTER 1277

*

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

GwSaveErrInfo: save err info (217)

GwISendRc: send appc_rc/sap_rc/status 2/679/0 to conn/target/client 1/0/0

GwGetMemory: allocated 00FA5020 (len=192)

GwGetMemory: act_overflow_size = 728 (+ 192)

GwSetCPICState: state of conn/index 1/0: RESET

GwSendToClient: send data to conn/target/client 1/0/0

GwSendToClient: set saved err info

GwSendToClient: send local err info

GwSendToClient: resize 192 -> 626

OUT:

-


ReqType : CPIC SysIdx : 0 ReqLen : 297 ReqId : 0

CommIdx : 1 ConnIdx : 1 ReqVer : 6 Trace : 0

conn : 1 wp_no : -1 ReqBlk : -1

RqType : SAP_INIT Prot : REG UID : 207 Mode : 5

User : SapRc : 679 AppcRc : 2 ConvId : 52716953

Vector :

Info : SYNC_CPIC_FUNCTION WITH_ERR_INFO

-


Address

Offset

CPIC-Data

-


x0204ca50

000000

2a455252 2a003100 70726f67 72616d20

ERR.1.program

x0204ca60

000016

50435f53 49535f53 41502e53 61705266

PC_SIS_SAP.SapRf

x0204ca70

000032

63536572 76657220 6e6f7420 72656769

cServer not regi

x0204ca80

000048

73746572 65640036 37390053 41502d47

stered.679.SAP-G

-


GwRqDpSendTo (gw_id=0, appc_ca_blk=-1, len=297, comm_index=-1)

LOCK APPC ca_blk 5

ThGetCommIdx: found index 1 via appc_hdr

found entry 1 (tid/uid/mode/conv_id/a_r: 18/207/5/ /0)

GwIsAWaitingSWP: wp 1 waiting

GwSapWpWakeUp: send answer to sap wp 1

GwSapWpWakeUp: make wp 1 owner of appc_ca_blk 5

-OUT- tid -1 uid -1 mode 255

-OUT- appc_ca_blk 5 len 297 rq_id 4731

-OUT- wait_f_answ 0 cmd 0

NiIWrite: write 28, 1 packs, MESG_IO, handle 7, data complete

GwFreeMemory: free 0204C990 (len=626)

GwFreeMemory: act_overflow_size = 536 (- 626)

GwFreeMemory: free 00FAD860 (len=536)

GwFreeMemory: act_overflow_size = 0 (- 536)

GwIDelR3Conn: idx/conv = ((0/0) | (-1/0)), delete conv 1 from conv-table

GwClearConn: conv_no/tcp_conv_no/sna_conv_no: 0/0/0

GwClearConn: free err info

GwClearConn: free r3 conv info

GwClearConn: free buffer info

GwFiSearchConvId: deleted 52716953 local, conn=1

GwListInsert: insert elem 1 into conn_free_list (at begin)

GwListInsert: 500 elems in conn_free_list

GwListRemove: elem 1 not in conn_search_list

GwListRemove: elem 1 not in conn_write_list

GwListRemove: remove elem 1 from conn_inuse_list

GwListRemove: 0 elems in conn_inuse_list

      • found trace flag (2) in appc header ***

GwReadSapWpRq: request: request from sap wp 1

-IN- tid 18 uid 207 mode 5

-IN- appc_ca_blk 5 len 348 rq_id 1

-IN- wait_f_answ 1 cmd 0

GwReadSapWpRq2: wp 1 waits for data

Adresse Offset Appc-Data to Gateway

-


04BD5550 000000 06ca0705 00cfffff 00000102 00000000 |................|

04BD5560 000016 00ffffff ff000000 00000000 00008500 |................|

04BD5570 000032 00000000 00000000 00000000 00000000 |................|

04BD5580 000048 5246435f 5349535f 25255246 43534552 |RFC_SIS_%%%%RFCSER|

04BD5590 000064 50435f53 49535f53 52020000 0001ffff |PC_SIS_SR.......|

04BD55A0 000080 25255246 43534552 56455225 25000000 |%%%%RFCSERVER%%%%...|

04BD55B0 000096 00000000 00000000 00000000 00000000 |................|

04BD55C0 000112 00000000 00000000 00000000 00000000 |................|

-


My question is how to solve this problem

Regards, Rita

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Hello Rita,

are the settings in the C:WINDOWSsystem32driversetcservices file the same one both systems? Additionally you can do a test with the SAP Java Connector as I described in this Weblog: https://weblogs.sdn.sap.com/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

Regards

Gregor