cancel
Showing results for 
Search instead for 
Did you mean: 

Error receiving data from SAP trough RFC connection ( RFC_ERROR_PROTOCOL )

Former Member
0 Kudos

Hello,

I'm trying to receive idocs from SAP to i5/OS (V5R3) with a receiver program written in C using RFC/SDK (i don't know what version, probably 6.40).

In this program i'm using SAPRFC.H and SAPITAB.H distributed with this SDK but compiling with different LIBRFC library:

1° test: compiling with 1999 LIBRFC

2° test: compiling with 2001 LIBRFC

3° test: compiling with 2008 LIBRFC

In the first two test RFC receiver program connects to SAP, but after 2 minutes it log an error like:

20100407174045 RFCError:RTTRFCSM:RfcDispatch <> (RFC_OK, RFC_CLOSED)

20100407174045 ...group: '107' key: 'RFC_ERROR_PROTOCOL'

20100407174045 ...RFC_GET3, GET ID=5401 LINE=572

20100407174045 return code: 1

The third test fail trough a memory error

I want to know the meaning of the error "RFC_ERROR_PROTOCOL" contained in SAPRFC.H header.

Someone can help me?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello MAKKELE,

this is always an issue, when you try to use LIBRFC the first time ...

Here my first question:

On which platform are developing the C Program ?

If on AS/400, you need to keep in mind, that you need the EBCDIC LIBRFC ...

Regards

Volker Gueldenpfennig, consolut international ag

http://www.consolut.net - http://www.4soi.de - http://www.easymarketplace.de

Former Member
0 Kudos

Thanks for fast reply,

I'm working for the first time with this kind of program so i'm not an as/400 i5/OS expert.

I know that this C was developed in 1999 by a programmer who has written and tested the code in windows environment and after transported the code to as/400 system and recompiled in it (i don't know what version of compiler used) , including different libraries depending on the environment used.

In fact in the code below you can see the conditional include :

#ifdef _WIN32

  1. ifndef SAPonNT

  2. define SAPonNT

  3. endif

#else

  1. ifndef SAPonOS400

  2. define SAPonOS400

  3. endif

#endif

#ifdef SAPonNT

#include <windows.h>

#include <winsock.h>

#include <fcntl.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <io.h>

#elif defined(SAPonOS400)

#include <unistd.h>

#include <qcmdexc.h>

#include <fcntl.h>

#else

#error "Error Message > Please update the lock_TID function for on your OS"

#endif

I don't know what is EBCDIC LIBRFC and how is used so any help is appreciated!

Regards

Former Member
0 Kudos

Hello MAKKELE,

ok, then you are using the program on AS/400.

As the program is a "normal program", this uses EBCDIC as codepage. In order to connect to the LIBRFC, you need a LIBRFC for EBCDIC as well.

You should use DSPSRVPGM and have a look at the "compile lib" e.g. GEN700AOPT ...

You would need an "E" there ...

If you need more support, this would be consulting. We did this several times for other customers in the RFC area as well.

Regards

Volker Gueldenpfennig, consolut international ag

http://www.consolut.net - http://www.4soi.de - http://www.easymarketplace.de

Former Member
0 Kudos

Thanks for the suggestion but i never use any AS/400 or I5/OS compiler before.

Can you explain me how i should modify the Program compiler below to make it runs under i5/OS (V5R3) ? I want to know where i'm wrong.

thanks!

PGM PARM(&SOURCE &LIBPAR &LIBARR &NAMEPGM)

DCL VAR(&PRECOM) TYPE(*CHAR) LEN(1)

DCL VAR(&LIBPAR) TYPE(*CHAR) LEN(10)

DCL VAR(&FILE) TYPE(*CHAR) LEN(10)

DCL VAR(&SOURCE) TYPE(*CHAR) LEN(10)

DCL VAR(&LIBARR) TYPE(*CHAR) LEN(10)

DCL VAR(&NAMEPGM) TYPE(*CHAR) LEN(10)

DCL VAR(&JOB) TYPE(*CHAR) LEN(10)

DCL VAR(&USER) TYPE(*CHAR) LEN(10)

CHGVAR VAR(&PRECOM) VALUE('S')

CHGVAR VAR(&FILE) VALUE('C')

RTVJOBA JOB(&JOB) USER(&USER)

ADDLIBLE LIB(QSQL )

MONMSG MSGID(CPF2103)

ADDLIBLE LIB(TSTRFC )

MONMSG MSGID(CPF2103)

IF COND(&PRECOM = 'S') THEN(DO)

CRTSQLCI OBJ(QTEMP/&SOURCE) SRCFILE(&LIBPAR/&FILE) +

OUTPUT(*PRINT)

MONMSG MSGID(MCH3601)

MONMSG MSGID(CZM0613)

CHGVAR VAR(&LIBPAR) VALUE('QTEMP')

CHGVAR VAR(&FILE) VALUE('QSQLT00240')

ENDDO

CRTCMOD MODULE(&LIBPAR/&SOURCE) +

SRCFILE(&LIBPAR/&FILE) OUTPUT(*PRINT) +

OPTION(*SYSINCPATH *SHOWUSR *EXPMAC) +

DBGVIEW(*SOURCE) DEFINE('SAPonOS400') +

SYSIFCOPT(*IFSIO)

MONMSG MSGID(CZM0613) EXEC(GOTO CMDLBL(NOMOD))

CRTPGM PGM(&LIBARR/&NAMEPGM) +

MODULE(&LIBPAR/&SOURCE) +

BNDSRVPGM(TSTRFC/LIBRFCTS) DETAIL(*FULL)

MONMSG MSGID(CZM0613) EXEC(GOTO CMDLBL(NOPGM)) GOTO CMDLBL(FINE)

NOMOD: SNDBRKMSG MSG('Attenzione !!! Attenzione !!! Non sono +

riuscito a creare il modulo ... buona +

fortuna') TOMSGQ(&JOB) GOTO CMDLBL(FINE)

...

Former Member
0 Kudos

Hello MAKKELE,

as mentioned, first we would need information on:

DSPSRVPGM TSTRFC/LIBRFCTS

(that sounds like teraspace ...)

Regards

Volker Gueldenpfennig, consolut international ag

http://www.consolut.net - http://www.4soi.de - http://www.easymarketplace.de

Former Member
0 Kudos

Ok, i'll provide you this information as soon as possible.

Regards

Former Member
0 Kudos

Hello Volker,

Sorry for the late but the system we are analizyng is to easy to reach...

Here's the information you requested:

We are using 2 kind of LIBRFC :

LIBRFC, LIBRFCTS (it's only a rename of previously LIBRFC) of 1998

LIBRFC346D of 2008

So, executing DSPSRVPGM results:

Both LIBRFC and LIBRFCTS have compile lib GEN40AOPT

While LIBRFC346D have compile lib GEN46DEOPT

If you need other informations don't hesitate to ask me.

Regards

Former Member
0 Kudos

Hello MAKKELE,

the A versions are not of use for you ;-((

The E version would be ok, but is perhaps pretty old and there are some known bugs in ...

I think, you should use a NON-teraspace version ...

You now need a 46DE librfc with the latest patch - I think a 7.0 compile version ... then it would work.

If you need more support, we could help you with consulting a bit.

Regards

Volker Gueldenpfennig, consolut international ag

http://www.consolut.net - http://www.4soi.de - http://www.easymarketplace.de

Former Member
0 Kudos

Thank you for the reply, i hope this information will be useful!.

We have this SVF files:

7.11

RFC_8-20004603.SVF

RFC_A_8-20004603.SVF

7.10

RFC_21-20001787.SVF

RFC_A_21-20001787.SVF

7.00

RFC_25-20001747.SVF

RFC_A_25-20001747.SVF

which one of theese files would be the best for us?

Thanks!

Former Member
0 Kudos

Using

LIBRFC 7.10

RFC_21-20001787.SVF

solved the problem!

Thanks a lot!!

Former Member
0 Kudos

Hi,

I am working on the same kind of situation and need a recent LIBRFC.

Problem is that our remaining SAP systems are still running on V5R2 (not supported I know) and the recent LIBRFC's need a SAPCAR running on V5R4.

The V5R4 system i need the LIBRFC for has no SAP. So I wonder if it would be possible to send me the EBCDIC save file (not the SAR file)?

The only versions I see on SAPNET are either Ascii or Unicode, so I guess i need the unicode version.

Also it shouldn't be *TERASPACE

Thanks very much

Tom

Former Member
0 Kudos

I think you must have a sapnet account with privileges to download RFC_21-20001787.SVF

before continue, and after go in:

1.Go to http://service.sap.com/swdc. Note that you must have a valid account.

2.In the menu on the left hand side, choose below items step by step.

SAP Software Distribution Center

Download

Support Packages and Patches

Entry by Application Group

3.Follow below submenu and you will find SAP RFC SDK 7.10.

Additional Components

SAP RFC SDK

SAP RFC SDK 7.10

an here you can download the EBCDIC sdk.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks Makkele,

I have a recent LIBRFC now

Regards

Tom