本文共 222539 字,大约阅读时间需要 741 分钟。
/* @(#) $Id: //bas/720_REL/src/include/saprfc.h#1 $ SAP*//*--------------------------------------------------------------------------------- * R F C S D K * * * (c) Copyright SAP AG, Walldorf 1993 - 1999 * * Portion of this software is based on the work from * Visual Edge Software *--------------------------------------------------------------------------------- *//*--------------------------------------------------------------------------------- * internal hint: this file is shipped to customers and must not include or use * any SAP internal data types or include files. *--------------------------------------------------------------------------------- *//* * @doc * * @module Remote Function Call API | * * The Remote Function Call API (RFC API) allows - * remotely or locally - calling ABAP/4 function * modules from C programs as well as receiving call * request issued from an ABAP/4 program by the * CALL FUNCTION interface. * * In ABAP/4 function modules are special routines with * well defined and documented interfaces, which are * developed within a library development workbench. * * ABAP/4 function modules use named parameter passing. * The function module may raise exceptions to indicate * errors. These exceptions can be caught * by the caller of a function module. * * The following functions form the programming interface to * call ABAP/4 function modules from a C environment. * * @group Functions for a RFC client program * @flag| opens an RFC connection including SAP logon, * can also be used for * non C environments such as Visual Basic. * This call is recommended instead of RfcOpen, * RfcOpenExt, RfcOpenExtV3 and RfcConnect. * @flag | opens an RFC connection. * @flag | another way to open an RFC connection more * appropriate for non C environments such as Visual Basic. * @flag | another way to open an RFC connection more * appropriate for non C environments such as Visual Basic * (using RFC Version 3). * @flag | opens an RFC connection via LOAD BALANCING (R/3 only). * @flag | Calls an ABAP/4 function module. * @flag | Receives the return values from an * ABAP/4 function module. * @flag | Calling a function module and receiving the * return values in one step. * @flag | Gets a unique Transaction-ID for calling an ABAP/4 * function module using the transactional RFC Interface. * @flag | Calls an ABAP/4 function module using transactional RFC * Interface in R/3 (implicit confirmation). * @flag | Calls an ABAP/4 function module using transactional RFC * Interface in R/3 ( (explicit confirmation). * @flag | Confirms a transaction called by RfcIndirectCallEx. * @flag | Cleanup the attached R/3 context * @flag | Register a function to change expired passwords * * @flag | Cancel an rfc call. This function works only with * RfcCall, RfcListen, RfcReceive construct. * * @group Functions for a RFC server program * @flag | accepting a RFC request or registering at a * SAP gateway. * @flag | registering functions as callable * function modules. * @flag | waiting for the next function call. * @flag | receiving the parameters of a function. * @flag | receiving the parameters of a function one-by-one. * @flag | sending back the return values. * @flag | raising an exception. * @flag | reading the symbolic function name. * (Max. 30 B) * @flag | internal use only. Reading symbolic function name that * are longer than 30 characters. * @flag | internal use only. Reading the symbolic function name. * (Max. 30 B) and returning an according * return code to the RFC program after * a system call such as RFC_PING for * connection test is automatically executed * by the RFC library * @flag | reading the symbolic function name longer than 30 * and returning code to the RFC program after * a system call such as RFC_PING for * connection test is automatically executed * by the RFC library. * @flag | Calling a function module and receiving * the return values in one step. It can be * be used for calling back a function module * in R/3 using the same RFC connection while * executing a RFC function in this server * program. Using and * is also possible. * @flag | registering functions as callable * function modules for transactional RFC. * @flag | registering functions as callable * function modules for transactional RFC. * @flag | getting the (ON or OFF) * @flag | getting the SNC name of the RFC client * @flag | getting the SNC ACL key of the RFC client * * @group Special Functions * @flag | Retrieve precise version information from the build * @flag | Attach a context to a RFC handle * @flag | Retrieves a previously attached context * @flag | Dettach a context from a RFC handle * @flag | listen for incoming RFC events. * @flag | wait for incoming RFC requests. * Only available after in * register mode. * @flag | get some information about this RFC connection * @flag | get information on the code page used for the call * @flag | define a structure for working with inhomogeneous * structure or internal table in an RFC client or * server program (for use in NON-Unicode RFC-Library) * @flag | define a structure for working with inhomogeneous * structure or internal table in an RFC client or * server program (for use in NON-Unicode RFC-Library) * @flag | define a structure for working with inhomogeneous * structure or internal table in an RFC client or * server program (for use in Unicode and non Unicode RFC-Library) * @flag | Convert ABAP internal type into RFC_TYPES * @flag | Convert RFC_TYPES to strings for traces purpose * @flag | Wraper to get structure information at runtime * @flag | Wraper to get structure information at runtime * @flag | Relase memory containing structure information * @flag | check for registered RFC server at a SAP gateway * @flag | cancel all registered RFC servers at a SAP gateway * @flag | convert an SNC name in an SNC ACL key * @flag | convert an SNC ACL key in an SNC name * * @flag | Allows the RFC library for starting some programs * * @flag | Activate/Deactivate the RFC trace * * @flag | Set RFC-Parameter * * @flag | Insert the tRFC-call in the R/3 receive queue * instead of immediately executing as RfcIndirectCall * does. * * @flag | Converts 2-byte ISO-Language into 1-byte SAP-Language * @flag | Converts 1-byte SAP-Language into 2-byte ISO-Language * * @flag | Turn off/on the conversion of characters between * own codepage and partner's codepage * * @flag | convert ascii to ebcdic; only on OS400 * * @flag | convert ebcdic to ascii; only on OS400 * * @flag | Check handle * * @flag | Retrieve backend generated cookie version 2 after calling RfcOpenEx * with flag GETSSO2 * * @flag | Set codepage for a rfc connection * * @flag | Change default codepage for all further connections * * @flag | Set timeout for all blocking functions * * @flag | Retrieves enqueue key sended by R3 * * @flag | Sets enqueue key, which will be sent to R/3 asap * * @flag | Retrieves client id sent by R/3 * * @flag | Retrieves client id sent by R/3 in the new format * * @flag | Sets client id, which will be sent to R/3 asap * * @flag | Creates an unique identifier * * @flag | Retrieves RFC call information * * @flag | Retrieves LUW call information * * @flag | Gets available statistic * * @flag | Installs logon handler for an external rfc server * * @flag | Calls an ABAP/4 function module. * * @flag | Receives the return values from an * ABAP/4 function module. * * @flag | Calling a function module and receiving the * return values in one step. * * * @flag | Defines the maximal number of active cpic connections. * * @flag | CPIC-parameter. CPIC-layer is allowed to suing sideinfo file. */#ifndef RFC_H#define RFC_H#ifndef SAPRFC_H#define SAPRFC_H#ifdef __midl/* * this part is used when compiled via MIDL */#define SAPonNT#else /* C/C++ *//* wchar_t */#include /* integers */#ifndef INT_MAX#include #endif#define RFC_VERSION 3/* * For Windows 3.x _WINDOWS has to be defined, as it is done * by MS Visual C++ */#ifndef SAPTYPE_H#ifdef _WIN32# ifndef SAPonNT# define SAPonNT# endif#endif /* _WIN32 */#ifdef _WINDOWS# ifndef _WIN32# ifndef SAPonWINDOWS# define SAPonWINDOWS# endif# endif /* _WIN16 */#endif /* _WINDOWS */#ifdef __OS400__# ifndef SAPonOS400# define SAPonOS400# endif#endif /* __OS400__ */#ifdef __MVS__# if defined(__XPLINK__) && __CHARSET_LIB == 1# pragma runopts("FILETAG(AUTOCVT,AUTOTAG)")# endif # ifndef SAPonOS390# define SAPonOS390# endif#endif /* __MVS__ (z/OS) */#endif /* SAPTYPE_H */#endif /* MIDL <-> C/C++ */#if !defined(SAP_FAR)|| !defined(SAP_PASCAL)|| !defined(SAP_EXPORT)|| !defined(SAP_LOADDS) || !defined(SAP_STDCALL)# undef SAP_FAR# undef SAP_PASCAL# undef SAP_EXPORT# undef SAP_LOADDS# undef SAP_STDCALL# if defined(SAPonWINDOWS)# define SAP_FAR __far# define SAP_PASCAL __pascal# define SAP_EXPORT __export# define SAP_LOADDS __loadds# define SAP_STDCALL# elif defined(SAPonNT)# define SAP_FAR# define SAP_PASCAL# define SAP_EXPORT# define SAP_LOADDS# define SAP_STDCALL _stdcall# else# define SAP_FAR# define SAP_PASCAL# define SAP_EXPORT# define SAP_LOADDS# define SAP_STDCALL# endif#endif#ifndef DECL_EXP# if defined(SAPonLIN) && defined(__GNUC__) && defined(GCC_HIDDEN_VISIBILITY)# define DECL_EXP __attribute__((visibility("default")))# else# define DECL_EXP# endif#endif#if !defined(_SYSTEM)# if defined(OS2)# define _SYSTEM _System# else# define _SYSTEM# define SAP_API SAP_FAR SAP_LOADDS SAP_PASCAL SAP_STDCALL# endif#endif /* _SYSTEM */#if !defined(SAP_API)# if defined(OS2)# define SAP_API _SYSTEM# endif#endif#if !defined(WIN_DLL_EXPORT_FLAGS)# define WIN_DLL_EXPORT_FLAGS SAP_API#endif /* WIN_DLL_EXPORT_FLAGS */#if !defined(DLL_CALL_BACK_FUNCTION)# if defined(SAPonWINDOWS)# define DLL_CALL_BACK_FUNCTION SAP_FAR SAP_PASCAL# elif defined(SAPonNT)# define DLL_CALL_BACK_FUNCTION SAP_STDCALL# elif defined(OS2)# define DLL_CALL_BACK_FUNCTION _SYSTEM# else# define DLL_CALL_BACK_FUNCTION# endif# if defined(OS2)# define DLL_CALL_BACK_FUNCTION_PTR * _SYSTEM# else# define DLL_CALL_BACK_FUNCTION_PTR DLL_CALL_BACK_FUNCTION *# endif#endif /* DLL_CALL_BACK_FUNCTION */#if ! defined (RUNT) && ! defined (ABAP0LIB)/* ABAP/4 data types */#define TYPC 0#define TYPDATE 1#define TYPP 2#define TYPTIME 3#define TYPX 4#define TYPTABH 5#define TYPNUM 6#define TYPFLOAT 7#define TYPINT 8#define TYPINT2 9#define TYPINT1 10/* TYPW = 11 */#define TYP1 12#define TYP2 13#define TYPDECF16 23 /* IEEE 754r decimal floating point 8 bytes */#define TYPDECF34 24 /* IEEE 754r decimal floating point 16 bytes *//* internal hint : * ABAP/4 data types must also be defined in abtypes.h */#else#include "abtypes.h"#endif /* ! defined (RUNT) && ! defined (ABAP0LIB) *//* There are several RFC libraries: * - ASCII/MBCS libraries, * - UNICODE libraries, * - Libraries that use ASCII for C strings on EBCDC platforms * * in order to prevent usage of the wrong libraries, * the entry points are mangeled with U or A extension: */#ifndef RFC_API_ENTRY# if defined(SAPwithUNICODE) /* we have UNICODE */# define RFC_API_ENTRY(fn) fn##U/* Stephan Sell - 29.07.2008 *//* disabled due to change (CL 1000445) in sapgendef.pl *//* # elif defined(SAPonOS390) && defined(SAPwithCHAR_ASCII) *//* *//* OS/390 with ASCII char *//* # define RFC_API_ENTRY(fn) fn##A */# else /* default native char type */# define RFC_API_ENTRY(fn) fn# endif#endif#define RfcInit RFC_API_ENTRY(RfcInit)#define RfcEnvironment RFC_API_ENTRY(RfcEnvironment)#define RfcLastError RFC_API_ENTRY(RfcLastError)#define RfcOpenExt RFC_API_ENTRY(RfcOpenExt)#define RfcOpen RFC_API_ENTRY(RfcOpen)#define RfcAccept RFC_API_ENTRY(RfcAccept)#define RfcAcceptExt RFC_API_ENTRY(RfcAcceptExt)#define RfcClose RFC_API_ENTRY(RfcClose)#define RfcAbort RFC_API_ENTRY(RfcAbort)#define RfcCall RFC_API_ENTRY(RfcCall)/*#define RfcCallVMC RFC_API_ENTRY(RfcCallVMC)*/#define RfcReceive RFC_API_ENTRY(RfcReceive)/*#define RfcReceiveVMC RFC_API_ENTRY(RfcReceiveVMC)*/#define RfcCallReceive RFC_API_ENTRY(RfcCallReceive)/*#define RfcCallReceiveVMC RFC_API_ENTRY(RfcCallReceiveVMC)*/#define RfcIndirectCall RFC_API_ENTRY(RfcIndirectCall)#define RfcGetName RFC_API_ENTRY(RfcGetName)#define RfcGetData RFC_API_ENTRY(RfcGetData)#define RfcSendData RFC_API_ENTRY(RfcSendData)#define RfcRaise RFC_API_ENTRY(RfcRaise)#define RfcListen RFC_API_ENTRY(RfcListen)#define RfcFileArgv RFC_API_ENTRY(RfcFileArgv)#define RfcConnArgv RFC_API_ENTRY(RfcConnArgv)#define RfcSendSystemInfo RFC_API_ENTRY(RfcSendSystemInfo)#define RfcInstallFunction RFC_API_ENTRY(RfcInstallFunction)#define RfcInstallFunctionExt RFC_API_ENTRY(RfcInstallFunctionExt)#define RfcDispatch RFC_API_ENTRY(RfcDispatch)#define RfcGetTransID RFC_API_ENTRY(RfcGetTransID)#define RfcCreateTransID RFC_API_ENTRY(RfcCreateTransID)#define RfcCreateLocalTransID RFC_API_ENTRY(RfcCreateLocalTransID)#define RfcGuidToTid RFC_API_ENTRY(RfcGuidToTid)#define RfcTidToGuid RFC_API_ENTRY(RfcTidToGuid)#define RfcCheckTransID RFC_API_ENTRY(RfcCheckTransID)#define RfcConfirmTransID RFC_API_ENTRY(RfcConfirmTransID)#define RfcAllocParamSpace RFC_API_ENTRY(RfcAllocParamSpace)#define RfcFreeParamSpace RFC_API_ENTRY(RfcFreeParamSpace)#define RfcAddExportParam RFC_API_ENTRY(RfcAddExportParam)#define RfcAddImportParam RFC_API_ENTRY(RfcAddImportParam)#define RfcAddTable RFC_API_ENTRY(RfcAddTable)#define RfcGetTableHandle RFC_API_ENTRY(RfcGetTableHandle)#define RfcCallExt RFC_API_ENTRY(RfcCallExt)#define RfcReceiveExt RFC_API_ENTRY(RfcReceiveExt)#define RfcCallReceiveExt RFC_API_ENTRY(RfcCallReceiveExt)#define RfcIndirectCallExt RFC_API_ENTRY(RfcIndirectCallExt)#define RfcGetDataExt RFC_API_ENTRY(RfcGetDataExt)#define RfcSendDataExt RFC_API_ENTRY(RfcSendDataExt)#define RfcExecProgram RFC_API_ENTRY(RfcExecProgram)#define RfcGetVersion RFC_API_ENTRY(RfcGetVersion)#define RfcGetPatchLevel RFC_API_ENTRY(RfcGetPatchLevel)#define RfcCheckVersionsOfUsedLibs RFC_API_ENTRY(RfcCheckVersionsOfUsedLibs)#define RfcGetAllLibVersions RFC_API_ENTRY(RfcGetAllLibVersions)#define RfcGetDomainFingerprintHex RFC_API_ENTRY(RfcGetDomainFingerprintHex)#define RfcGetUserSidHex RFC_API_ENTRY(RfcGetUserSidHex)#define RfcConnect RFC_API_ENTRY(RfcConnect)#define RfcInstallTransactionControl RFC_API_ENTRY(RfcInstallTransactionControl)#define RfcInstallTransactionControl2 RFC_API_ENTRY(RfcInstallTransactionControl2)#define RfcRaiseTables RFC_API_ENTRY(RfcRaiseTables)#define RfcRaiseErrorMessage RFC_API_ENTRY(RfcRaiseErrorMessage)#define RfcConnArgv3 RFC_API_ENTRY(RfcConnArgv3)#define RfcOpenExtV3 RFC_API_ENTRY(RfcOpenExtV3)#define RfcGetAttributes RFC_API_ENTRY(RfcGetAttributes)#define RfcGetCodePagesInfo RFC_API_ENTRY(RfcGetCodePagesInfo)#define RfcWaitForRequest RFC_API_ENTRY(RfcWaitForRequest)#define RfcInstallStructure RFC_API_ENTRY(RfcInstallStructure)#define RfcInstallStructure2 RFC_API_ENTRY(RfcInstallStructure2)#define RfcStructureToFile RFC_API_ENTRY(RfcStructureToFile)#define RfcStructureToFileByName RFC_API_ENTRY(RfcStructureToFileByName)#define RfcDefineImportParam RFC_API_ENTRY(RfcDefineImportParam)#define RfcGetImportParam RFC_API_ENTRY(RfcGetImportParam)#define RfcSncMode RFC_API_ENTRY(RfcSncMode)#define RfcSncPartnerName RFC_API_ENTRY(RfcSncPartnerName)#define RfcSncPartnerAclKey RFC_API_ENTRY(RfcSncPartnerAclKey)#define RfcSncNameToAclKey RFC_API_ENTRY(RfcSncNameToAclKey)#define RfcSncAclKeyToName RFC_API_ENTRY(RfcSncAclKeyToName)#define RfcIoCtl RFC_API_ENTRY(RfcIoCtl)#define RfcSetCodePage RFC_API_ENTRY(RfcSetCodePage)#define RfcSetSystemCodePage RFC_API_ENTRY(RfcSetSystemCodePage)#define RfcGetDriverCallBack RFC_API_ENTRY(RfcGetDriverCallBack)#define RemObjInstallDriver RFC_API_ENTRY(RemObjInstallDriver)#define RemObjRegisterObject RFC_API_ENTRY(RemObjRegisterObject)#define RemObjGetObject RFC_API_ENTRY(RemObjGetObject)#define RemObjReleaseObject RFC_API_ENTRY(RemObjReleaseObject)#define RfcCheckRegisterServer RFC_API_ENTRY(RfcCheckRegisterServer)#define RfcCancelRegisterServer RFC_API_ENTRY(RfcCancelRegisterServer)#define RfcOpenEx RFC_API_ENTRY(RfcOpenEx)#define RfcLastErrorEx RFC_API_ENTRY(RfcLastErrorEx)#define RfcConvertBcdToChar RFC_API_ENTRY(RfcConvertBcdToChar)#define RfcConvertCharToBcd RFC_API_ENTRY(RfcConvertCharToBcd)#define RfcTxStart RFC_API_ENTRY(RfcTxStart)#define RfcTxPrepareToCommit RFC_API_ENTRY(RfcTxPrepareToCommit)#define RfcTxCommit RFC_API_ENTRY(RfcTxCommit)#define RfcTxAbort RFC_API_ENTRY(RfcTxAbort)#define RfcIndirectCallEx RFC_API_ENTRY(RfcIndirectCallEx)#define RfcIndirectCallExExt RFC_API_ENTRY(RfcIndirectCallExExt)#define RfcUninstallFunction RFC_API_ENTRY(RfcUninstallFunction)#define RfcGuiCheck RFC_API_ENTRY(RfcGuiCheck)#define RfcGuiPrepare RFC_API_ENTRY(RfcGuiPrepare)#define RfcGuiStart RFC_API_ENTRY(RfcGuiStart)#define RfcGuiReturn RFC_API_ENTRY(RfcGuiReturn)#define RfcGetNameEx RFC_API_ENTRY(RfcGetNameEx)#define RfcResizeBlob RFC_API_ENTRY(RfcResizeBlob)#define RfcAllowStartProgram RFC_API_ENTRY(RfcAllowStartProgram)#define RfcSetTrace RFC_API_ENTRY(RfcSetTrace)#define RfcSetParameter RFC_API_ENTRY(RfcSetParameter)#define RfcNormalizeTabOrFldName RFC_API_ENTRY(RfcNormalizeTabOrFldName)#define RfcQueueInsert RFC_API_ENTRY(RfcQueueInsert)#define RfcIsValidHandle RFC_API_ENTRY(RfcIsValidHandle)#define RfcHealthCheck RFC_API_ENTRY(RfcHealthCheck)#define RfcPlayback RFC_API_ENTRY(RfcPlayback)#define RfcOpenAdodb RFC_API_ENTRY(RfcOpenAdodb)#define RfcAcceptAdodb RFC_API_ENTRY(RfcAcceptAdodb)#define RfcCleanupContext RFC_API_ENTRY(RfcCleanupContext)#define RfcDynamicGetData RFC_API_ENTRY(RfcDynamicGetData)#define RfcGetLongName RFC_API_ENTRY(RfcGetLongName)#define RfcGetLongNameEx RFC_API_ENTRY(RfcGetLongNameEx)#define RfcAllocString RFC_API_ENTRY(RfcAllocString)#define RfcFreeString RFC_API_ENTRY(RfcFreeString)#define RfcIsoLangToSap RFC_API_ENTRY(RfcIsoLangToSap)#define RfcSapLangToIso RFC_API_ENTRY(RfcSapLangToIso)#define RfcCancel RFC_API_ENTRY(RfcCancel)#define RfcCharConversion RFC_API_ENTRY(RfcCharConversion)#define RfcRegisterPasswordChanger RFC_API_ENTRY(RfcRegisterPasswordChanger)#define RfcResizeXString RFC_API_ENTRY(RfcResizeXString)#define RfcGetTicket RFC_API_ENTRY(RfcGetTicket)#define RfcInstallUnicodeStructure RFC_API_ENTRY(RfcInstallUnicodeStructure)#define RfcSetSystemTimeout RFC_API_ENTRY(RfcSetSystemTimeout)#define RfcSetBasisTraceFile RFC_API_ENTRY(RfcSetBasisTraceFile)#define RfcSetBasisTraceLevel RFC_API_ENTRY(RfcSetBasisTraceLevel)#define RfcGetEnqueueKey RFC_API_ENTRY(RfcGetEnqueueKey)#define RfcSetEnqueueKey RFC_API_ENTRY(RfcSetEnqueueKey)#define RfcGetClientId RFC_API_ENTRY(RfcGetClientId)#define RfcGetClientIdEx RFC_API_ENTRY(RfcGetClientIdEx)#define RfcSetClientIdEx RFC_API_ENTRY(RfcSetClientIdEx)#define RfcCreateUuid RFC_API_ENTRY(RfcCreateUuid)#define RfcGetCallInfo RFC_API_ENTRY(RfcGetCallInfo)#define RfcStatistic RFC_API_ENTRY(RfcStatistic)#define RfcGetLuwInfo RFC_API_ENTRY(RfcGetLuwInfo)#define RfcExidToRfcType RFC_API_ENTRY(RfcExidToRfcType)#define RfcTypeToString RFC_API_ENTRY(RfcTypeToString)#define RfcGetStructureInfoAsTable RFC_API_ENTRY(RfcGetStructureInfoAsTable)#define RfcGetStructureInfoFlat RFC_API_ENTRY(RfcGetStructureInfoFlat)#define RfcReleaseStructInfo RFC_API_ENTRY(RfcReleaseStructInfo)#define RfcGetFunctionInfoAsTable RFC_API_ENTRY(RfcGetFunctionInfoAsTable)#define RfcAlignFunctionInterface RFC_API_ENTRY(RfcAlignFunctionInterface)#define RfcInstallExternalLogonHandler RFC_API_ENTRY(RfcInstallExternalLogonHandler)#define RfcCallEx RFC_API_ENTRY(RfcCallEx)#define RfcReceiveEx RFC_API_ENTRY(RfcReceiveEx)#define RfcCallReceiveEx RFC_API_ENTRY(RfcCallReceiveEx)#define RfcAttachContext RFC_API_ENTRY(RfcAttachContext)#define RfcGetAttachedContext RFC_API_ENTRY(RfcGetAttachedContext)#define RfcDetachContext RFC_API_ENTRY(RfcDetachContext)#define RfcDsrInit RFC_API_ENTRY(RfcDsrInit)#define RfcGetMetaDaten4GUI RFC_API_ENTRY(RfcGetMetaDaten4GUI)#define RfcSetLeakTrace RFC_API_ENTRY(RfcSetLeakTrace)#define RfcCallReceiveTimed RFC_API_ENTRY(RfcCallReceiveTimed)#define RfcConvertA2E RFC_API_ENTRY(RfcConvertA2E)#define RfcConvertE2A RFC_API_ENTRY(RfcConvertE2A)#define RfcSetMaxCpicConn RFC_API_ENTRY(RfcSetMaxCpicConn)#define RfcUseSideInfo RFC_API_ENTRY(RfcUseSideInfo)#define RfcResetTraceDir RFC_API_ENTRY(RfcResetTraceDir)#define RfcExceptionInfo RFC_API_ENTRY(RfcExceptionInfo)#define RfcAcceptWithChannel RFC_API_ENTRY(RfcAcceptWithChannel)#define RfcCreateItabObj RFC_API_ENTRY(RfcCreateItabObj) #if !defined(SAPTYPE_H)/* * Non-SAP RFC Compile: include the SAP U Interface */#include "sapucx.h"#ifndef __midl /* MIDL doesnt need to see the U interface */ #include "sapuc.h"#endif#endif/* SAPUNICODEOK *//* @type rfc_char_t | data type used for API parameters * * characters encoded with UTF16 in unicode builds * * characters encoded with the default codepage in multibyte builds */typedef SAP_UC rfc_char_t;/* Used for constcorrectness on some compilers *//* setting SAP_RFC_WITH_CONST = 1 inserts an additional *//* const to the RFC_TYPE_ELEMENT structures */#ifdef SAP_RFC_WITH_CONST #define CONST_RFC const#else #define CONST_RFC#endif#ifndef sizeofR#define sizeofR sizeof#endif/* SAPUNICODEOK *//* @type rfc_byte_t | * data type used for binary fields. */typedef unsigned char rfc_byte_t;/* * @enum RFCTYPE | * * RFC data types. */typedef enum{ RFCTYPE_CHAR = TYPC, /* @emem 1-byte or multibyte character. * fixed sized, blank padded * ( ). */ RFCTYPE_DATE = TYPDATE, /* @emem date ( YYYYYMMDD ) * ( ). */ RFCTYPE_BCD = TYPP, /* @emem packed number. * bcd number, any length between * 1 and 16 bytes * ( ). */ RFCTYPE_TIME = TYPTIME, /* @emem time (HHMMSS) * ( ). */ RFCTYPE_BYTE = TYPX , /* @emem raw data, binary, * fixed length, zero padded. * ( ). */ RFCTYPE_ITAB = TYPTABH, /* @emem internal table * ( ). */ RFCTYPE_NUM = TYPNUM, /* @emem digits, fixed size, * '0' padded. * ( ). */ RFCTYPE_FLOAT = TYPFLOAT, /* @emem floating point, * double precission * ( ). */ RFCTYPE_INT = TYPINT, /* @emem 4-byte integer * ( ). */ RFCTYPE_INT2 = TYPINT2, /* @emem 2-byte integer * obsolete, * not directly supported * by ABAP/4. */ RFCTYPE_INT1 = TYPINT1, /* @emem 1-byte integer * obsolete, * not directly supported * by ABAP/4. */ RFCTYPE_DATE_1 = TYP1, /* @emem old fashioned date, * obsolete, * not directly supported * by ABAP/4. */ RFCTYPE_DATE_2 = TYP2, /* @emem old fashioned date, * obsolete, * not directly supported * by ABAP/4. */ /* starting from here ABAP types and RFC types differ */ _RFCTYPE_differ_from_abap, RFCTYPE_NULL /* @emem not supported data type. */ = _RFCTYPE_differ_from_abap, RFCTYPE_WIDE_2, /* wide character 2 byte (internal use)*/ RFCTYPE_WIDE_4, /* wide character 4 byte (internal use)*/ RFCTYPE_STRUCTURE, /* a structure (internal use) */ RFCTYPE_ABAP4OBJECT, /* abap/4 object (internal use) */ RFCTYPE_IUNKNOWN, /* @emem an IUnknown object * can only be used in a COM/OLE * environment. * ( ). */ RFCTYPE_WSTRING, /* @emem a wide character string * zero terminated, if given size * is big enough. * ( ). */ RFCTYPE_SAPAUTOMATION, /* sap automation object * sapgui only, internal use. */ RFCTYPE_STUB, /* remote object's stub * (internal use) */ RFCTYPE_WIRE_OBJECT, /* Object on the wire * (internal use) */ RFCTYPE_BLOB, /* @emem binary large object, * address must point to a * structure. */ RFCTYPE_CORBA_OBJECT, /* a Corba object * (internal use only). */ RFCTYPE_PADDING, /* @emem use in dummy fields to ensure proper * alignment of structure with sub structures */ RFCTYPE_UNICODE, /* @emem Never used, always use RFCTYPE_CHAR. */ RFCTYPE_XMLDATA, /* @emem zero terminated string describing ABAP data * types/structure as XML */ RFCTYPE_STRING, /* @emem zero terminated string */ RFCTYPE_XSTRING, /* @emem raw string with length field in bytes */ RFCTYPE_DECF16, /* IEEE 754r decimal floating point 8 bytes */ RFCTYPE_DECF34, /* IEEE 754r decimal floating point 16 bytes */ _RFCTYPE_max_value, /* the max. value of RFCTYPEs */ /* some special values */#if defined(SAPonRM600) || defined (SAPonPTX) /* cast required incl. CDS++ 1.0B C1016615 */ RFCTYPE_WCHAR /* @emem wide character string, * blank padded * ( ). */ = ( sizeofR( wchar_t ) == 2 ) ? (int)RFCTYPE_WIDE_2 : (int)RFCTYPE_WIDE_4, _RFCTYPE_illegal_wchar /* not allowed wide character type */ = ( sizeofR( wchar_t ) == 2 ) ? (int)RFCTYPE_WIDE_4 : (int)RFCTYPE_WIDE_2,#else RFCTYPE_WCHAR /* @emem wide character string, * blank padded * ( ). */ = (( sizeofR( wchar_t ) == 2u ) ? RFCTYPE_WIDE_2 : RFCTYPE_WIDE_4), _RFCTYPE_illegal_wchar /* not allowed wide character type */ = ( sizeofR( wchar_t ) == 2u ) ? RFCTYPE_WIDE_4 : RFCTYPE_WIDE_2,#endif _RFCTYPE_the_last_line_without_colon}RFCTYPE;/* * @enum RFC_BLOB_CLASS | * * Memory class of a BLOB. */typedef enum{ RFC_BLOB_CLASS_ANY = 0, /* @emem any memory class (send only) */ RFC_BLOB_CLASS_MALLOC = 9 /* @emem object is allocated in memory * using 'malloc' or 'realloc'. Memory has * to be released by 'free'. */}RFC_BLOB_CLASS;/* @type RFC_BLOB | * a structure describing a BLOB (binary large object) */typedef struct{ RFC_BLOB_CLASS blobClass; /* @field type of blob (must be * ) */ RFCTYPE blobType; /* @field RFC type of blob object, * must be either * or * . */ unsigned long blobSize; /* @field size in bytes */ void * blobAddress; /* @field address of buffer */}RFC_BLOB;/* @type RFC_TYPEHANDLE | * a value describing an ABAP/4 field. It may describe * a scalar field like (s. enum ) * or a structure. A * structure description must be installed by the * function . * * @comm * In former versions corresponding fields where simply * defined as 'unsigned'. Use instead. */typedef unsigned RFC_TYPEHANDLE;/* @type RFC_TYPE_ELEMENT | * an element of a structure used in an RFC interface. * This type is used to describe a structure, which is * to be installed by the * function . */typedef struct{ CONST_RFC rfc_char_t * name; /* @field name of the field * (only used for trace). */ RFC_TYPEHANDLE type; /* @field (scalar) data type of the element. */ unsigned length; /* @field length of the field in bytes. */ unsigned decimals; /* @field decimals * (only bcd fields, TYPP ). */ unsigned _not_used;}RFC_TYPE_ELEMENT;/* @type RFC_TYPE_ELEMENT2 | * an element of a structure used in an RFC interface. * This type is used to describe a structure, which is * to be installed by the * function . */typedef struct{ CONST_RFC rfc_char_t * name; /* @field name of the field * (only used for trace). */ RFC_TYPEHANDLE type; /* @field (scalar) data type of the element. */ unsigned length; /* @field length of the field in bytes. */ unsigned decimals; /* @field decimals * (only bcd fields, TYPP ). */ unsigned offset; /* @field byte offset of the field from */ /* the beginning of the structure */ }RFC_TYPE_ELEMENT2;/* @type RFC_UNICODE_TYPE_ELEMENT | * an element of a structure used in an RFC interface. * This type is used to describe a structure, which is * to be installed by the * functions and . * * Only types installed by RfcInstallUnicodeStructure can be used * in a UNICODE programm that communicates with a non-Unicode system. */typedef struct{ CONST_RFC rfc_char_t * name; /* @field name of the field * (only used for trace). */ RFC_TYPEHANDLE type; /* @field (scalar) data type of the element. */ unsigned decimals; /* @field decimals * (only bcd fields, TYPP ). */ unsigned c1_length;/* @field length of the field in bytes * in a 1 byte per SAP_CHAR system. */ unsigned c1_offset;/* @field byte offset of the field from * the beginning of the structure * in a 1 byte per SAP_CHAR system */ unsigned c2_length;/* @field length of the field in bytes * in a 2 bytes per SAP_CHAR system. */ unsigned c2_offset;/* @field byte offset of the field from * the beginning of the structure * in a 2 bytes per SAP_CHAR system */ unsigned c4_length;/* @field length of the field in bytes * in a 4 bytes per SAP_CHAR system. */ unsigned c4_offset;/* @field byte offset of the field from * the beginning of the structure * in a 4 bytes per SAP_CHAR system */ }RFC_UNICODE_TYPE_ELEMENT;typedef void *RFC_TYPE_HEAD ;/* @type RFC_U_FIELDS| * type from the lines of the table returned by * . */typedef struct{ SAP_CHAR Tabname[30]; /* @field name of the structure * for comptibilty with DDIC's RFC_FIELDS */ SAP_CHAR Fieldname[30]; /* @field name of the field */ SAP_INT Position; /* @field field position * for comptibilty with DDIC's RFC_FIELDS */ SAP_CHAR Exid [1]; /* @field ABAP internal type representation * .*/ SAP_INT Decimals; /* @field decimals *(only bcd fields, RFCTYPE_BCD ).*/ SAP_INT Offset_b1; /* @field field offset in systems with 1 byte per SAP_CHAR */ SAP_INT Length_b1; /* @field field length in systems with 1 byte per SAP_CHAR. * For all sytems, this is the number of SAP_CHAR from the * field when the fields is of type "Character", "Numeric", * "Date" or "Time". */ SAP_INT Offset_b2; /* @field field offset in systems with 2 bytes per SAP_CHAR */ SAP_INT Length_b2; /* @field field length in systems with 2 bytes per SAP_CHAR */ SAP_INT Offset_b4; /* @field field offset in systems with 4 bytes per SAP_CHAR */ SAP_INT Length_b4; /* @field field length in systems with 4 bytes per SAP_CHAR */}RFC_U_FIELDS, *PRFC_U_FIELDS;typedef const RFC_U_FIELDS *PCRFC_U_FIELDS;/* @type RFC_U_FUNINT| * type from the lines of the table returned by * . */typedef struct RFC_U_FUNINT{ SAP_CHAR Paramclass [1]; /* @field parameter type : * I - Importing parameter * E - Exporting parameter * C - Chaning parameter * T - Table parameter * X - eXception */ SAP_CHAR Parameter [30]; /* @field Parameter name, exception value*/ SAP_CHAR Tabname [30]; /* @field Base structure defining the parameter type*/ SAP_CHAR Fieldname [30]; /* @field Field defining the parameter type*/ SAP_CHAR Exid [1]; /* @field Parameter type*/ SAP_INT Position; /* @field Position*/ SAP_INT Offset_b1; /* @field field offset in systems with 1 byte per SAP_CHAR */ SAP_INT Length_b1; /* @field field length in systems with 1 byte per SAP_CHAR. * For all sytems, this is the number of SAP_CHAR from the * field when the fields is of type "Character", "Numeric", * "Date" or "Time". */ SAP_INT Offset_b2; /* @field field offset in systems with 2 bytes per SAP_CHAR */ SAP_INT Length_b2; /* @field field length in systems with 2 bytes per SAP_CHAR */ SAP_INT Offset_b4; /* @field field offset in systems with 4 bytes per SAP_CHAR */ SAP_INT Length_b4; /* @field field length in systems with 4 bytes per SAP_CHAR */ SAP_INT Decimals; /* @field Number of decimals *(only bcd fields, RFCTYPE_BCD ).*/ SAP_CHAR Default [21]; /* @field Default value from optional parameter * In some cases this is an ABAP variable such as SY-LANGU */ SAP_CHAR Paramtext [79]; /* @field Short description from parameter*/ SAP_CHAR Optional [1]; /* @field Indicate optional parameters*/}RFC_U_FUNINT, *PRFC_U_FUNINT;typedef const RFC_U_FUNINT *PCRFC_U_FUNINT;/* RFC scalar data types *//* @type RFC_CHAR | * ABAP/4 data type C, * blank padded character string of fixed length. * Used for data transported by RFC * * characters are encoded in UTF16 in unicode builds * * characters are encoded in the system default code page * or in the code page selected by , , * or defined by environment variable SAP_CODEPAGE * in multibyte builds. The default codepage is 1100. *//* @type RFC_UNICODE | * ABAP/4 data type C, * blank padded character string of fixed length in unicode environment. *//* @type RFC_NUM | * ABAP/4 data type N, * character string of fixed length containing only digits. *//* @type RFC_BYTE | * ABAP/4 data type X, * raw data. *//* @type RFC_BCD | * ABAP/4 data type P, * packed number in BCD format (binary coded decimal). *//* @type RFC_INT1 | * Data dictionary data type INT1, * 1-byte unsigned integer. *//* @type RFC_INT2 | * Data dictionary data type INT2, * 2-byte signed integer. *//* @type RFC_INT | * ABAP/4 data type I, * 4-byte signed integer. *//* @type RFC_FLOAT | * ABAP/4 data type F, * 8-byte IEEE floating point number. *//* @type RFC_DATE | * ABAP/4 data type D, * 8-byte date (YYYYMMDD). *//* @type RFC_TIME | * ABAP/4 data type T, * 6-byte time (HHMMSS). *//* @type RFC_WCHAR | * ABAP/4 data type W, * double-byte, unicode string, * blank padded. *//* @type RFC_WSTRING | * similiar than ABAP/4 data type W. * * Double-byte, unicode string, * zero terminated * (if the given length * in . * is big enough ) * * Can be used instead of , if more appropriate. *//* @type RFC_STRING | * similar than ABAP/4 data type string with variable length. * The difference is RFC_STRING is a zero terminated string and ABAP/4 string * is a blank padded string. For better understanding you can consider RFC_STRING * like typedef unsigned char* RFC_STRING. * The conversion between zero terminated * (extern RFC program) and blank padded (ABAP) is done automatically. * All strings are to be handled by sending and receiving in external programs * as UTF8 zero terminated strings. * *//* @type RFC_XSTRING | * raw string with length field in bytes. *//* @type RFC_IUNKNOWN | * COM object. * Can be mapped to ABAP/4 objects and vice versa. * (Available, only if COM adapter is installed) */#ifdef RFC_CHAR_UNSIGNED/* use RFC_CHAR_UNSIGNED if you have legacy code */typedef unsigned char RFC_CHAR; /* characters, TYPC */#elsetypedef SAP_UC RFC_CHAR; /* characters, TYPC */#endiftypedef RFC_CHAR RFC_NUM; /* digits, TYPNUM */typedef rfc_byte_t RFC_BYTE; /* raw data, TYPX */typedef rfc_byte_t RFC_BCD; /* packed numbers, TYPP */typedef rfc_byte_t RFC_INT1; /* 1 byte integer, TYPINT1 */typedef short RFC_INT2; /* 2 byte integer, TYPINT2 */typedef double RFC_FLOAT; /* floating point, TYPFLOAT*/typedef RFC_CHAR RFC_DATE[8]; /* date, TYPDATE (YYYYMMDD)*/typedef RFC_CHAR RFC_TIME[6]; /* time, TYPTIME (HHMMSS) */typedef wchar_t RFC_WCHAR; /* wchar_t */typedef wchar_t * RFC_WSTRING; /* wchar_t, zero term. */typedef SAP_UTF8 * RFC_XMLDATA; /* ABAP structs encoded as XML Document */typedef SAP_UTF8 * RFC_STRING; /* zero terminated string in UTF8-Format */typedef DecFloat16 RFC_DECF16; /* IEEE 754r decimal floating point 8 bytes */typedef DecFloat34 RFC_DECF34; /* IEEE 754r decimal floating point 16 bytes */#ifdef _OBJBASE_H_/* only if com header is included */typedef IUnknown * RFC_IUNKNOWN; /* IUnknown, COM object */#endif#ifdef __midl typedef long int RFC_INT;#else#define RFC_INT_MAX 0x7fffffff#if INT_MAX == RFC_INT_MAX typedef int RFC_INT; /* 4 byte integers, TYPINT */#elif LONG_MAX == RFC_INT_MAX typedef long int RFC_INT; /* 4 byte integers, TYPINT */#else#error local integer representation is not supported by RFC API#endif#endif /* __midl or C */typedef struct{ RFC_INT length; RFC_BYTE *content;} RFC_XSTRING; /* binary string */#ifdef __cplusplusextern "C"{#endif/* Initialization *//*------------------------------------------------------- * @func * * RfcInit initializes the RFC library with a process and should be the * first RFC API function called by an application. For applications that use * the RFC shared library (or DLL ), this function is called implicitly when * the library is loaded. However, for applications that use the static * RFC library, this function must be called explicitly. * *------------------------------------------------------*/DECL_EXP void SAP_API RfcInit (void);/* Environment : memory allocation and error handling */typedef void* (DLL_CALL_BACK_FUNCTION_PTR RFC_ALLOCATE) ( void * old_ptr, unsigned long size );typedef void (DLL_CALL_BACK_FUNCTION_PTR RFC_ERROR_HANDLER) ( CONST_RFC rfc_char_t * error_id );typedef struct{ RFC_ERROR_HANDLER errorhandler; RFC_ALLOCATE allocate;}RFC_ENV;DECL_EXP void SAP_API RfcEnvironment( RFC_ENV * new_env ); /* @struct RFC_ERROR_INFO | * * * !!! Please use and * instead of this structure. * * * structure returned by describing * the last RFC error that occurred. */typedef struct#ifdef SAPonOS400/* to get proj/crfc to compile (they use this struct as a parent class) */RFC_ERROR_INFO#endif{ RFC_CHAR key[33]; /* @field error code to identify * the error */ RFC_CHAR status[128]; /* @field state of the RFC * connection */ RFC_CHAR message[256]; /* @field text describing the error */ RFC_CHAR intstat[128]; /* @field internal description of the * RFC connection */}RFC_ERROR_INFO;/*------------------------------------------------------ * @func * * * !!! Please use instead of this function. * * * RfcLastError describes the last error reported by * some function of the RFC API. * * Multiple calls of RfcLastError are possible and yield the same error until a new error occurs. * * @rdesc * returns 1 if no error occurred and 0 elsewhere. * * @xref * *------------------------------------------------------*/DECL_EXP int SAP_API RfcLastError( RFC_ERROR_INFO * error_info /* @parm structure * describing the * error. */ );/* @enum RFC_ERROR_GROUP | RFC error group */typedef enum{ RFC_ERROR_PROGRAM = 101, /* @emem Error in RFC program */ RFC_ERROR_COMMUNICATION = 102, /* @emem Error in Network & Communications */ RFC_ERROR_LOGON_FAILURE = 103, /* @emem SAP logon error */ RFC_ERROR_SYSTEM_FAILURE = 104, /* @emem e.g. SAP system exception raised */ RFC_ERROR_APPLICATION_EXCEPTION = 105, /* @emem The called function module raised * an exception */ RFC_ERROR_RESOURCE = 106, /* @emem Resource not available * (e.g. memory insufficient,...) */ RFC_ERROR_PROTOCOL = 107, /* @emem RFC Protocol error */ RFC_ERROR_INTERNAL = 108, /* @emem RFC Internal error */ RFC_ERROR_CANCELLED = 109, /* @emem RFC Registered Server was * cancelled */ RFC_ERROR_BUSY = 110 /* @emem System is busy, try later */}RFC_ERROR_GROUP;typedef struct{ RFC_CHAR msgid[21]; RFC_CHAR msgty; RFC_CHAR msgno[4]; RFC_CHAR msgv1[51]; RFC_CHAR msgv2[51]; RFC_CHAR msgv3[51]; RFC_CHAR msgv4[51];} RFC_EXCEPTION_INFO;int SAP_API RfcExceptionInfo( RFC_EXCEPTION_INFO *info); /* @struct RFC_ERROR_INFO_EX | * * structure returned by describing * the last RFC error. */typedef struct#ifdef SAPonOS400/* to get proj/crfc to compile (they use this struct as a parent class) */RFC_ERROR_INFO_EX#endif{ RFC_ERROR_GROUP group; /* @field error group */ RFC_CHAR key[33]; /* @field error code to identify the error. * The error group (type integer) and error key * (type string) have the same meaning. * RFC program can better analyze the error * with the error group instead of error key. */ RFC_CHAR message[513]; /* @field error text to describe the error */}RFC_ERROR_INFO_EX;/*------------------------------------------------------ * @func * * RfcLastErrorEx describes the last error reported by * some function of the RFC API. * * Multiple calls of RfcLastErrorEx are possible and yield the same error until a new error occurs. * * @rdesc Returns one of the following values: * * returns 1 if no error occurred and 0 elsewhere. * * @comm * Do not call this API after call contains * structure in the parameter list. * * In this case * * - RfcLastErrorEx returns 1 although previous call failed. * * - please retrieve the error information from the parameter. * * An example for API contains in the * parameter list is . *------------------------------------------------------ */DECL_EXP int SAP_API RfcLastErrorEx ( RFC_ERROR_INFO_EX * error_info /* @parm structure * describing the * error. */);/* @type RFC_HANDLE | handle for RFC connection * @flag RFC_HANDLE_NULL | the RFC handle is not set */typedef unsigned RFC_HANDLE;/* Null-Value : handle not set */#define RFC_HANDLE_NULL 0 /* @struct RFC_ATTRIBUTES | * structure returned by describing * some information about this RFC connection. */typedef struct{ rfc_char_t dest[64+1]; /* @field RFC destination */ rfc_char_t own_host[100+1]; /* @field Own host name */ rfc_char_t partner_host[100+1]; /* @field Partner host name */ rfc_char_t systnr[2+1]; /* @field R/3 system number */ rfc_char_t sysid[8+1]; /* @field R/3 system name */ rfc_char_t client[3+1]; /* @field Client */ rfc_char_t user[12+1]; /* @field User */ rfc_char_t language[1+1]; /* @field Language */ rfc_char_t trace; /* @field ON/OFF: 'X'/' ' */ rfc_char_t ISO_language[2+1]; /* @field 2-byte ISO-Language */ rfc_char_t own_codepage[4+1]; /* @field Own code page */ rfc_char_t partner_codepage[4+1]; /* @field Partner code page */ rfc_char_t rfc_role; /* @field C/S: RFC Client / RFC Server */ rfc_char_t own_type; /* @field 2/3/E/R: R/2,R/3,Ext,Reg.Ext */ rfc_char_t own_rel[4+1]; /* @field My system release */ rfc_char_t partner_type; /* @field 2/3/E/R: R/2,R/3,Ext,Reg.Ext */ rfc_char_t partner_rel[4+1]; /* @field Partner system release */ rfc_char_t kernel_rel[4+1]; /* @field Partner kernel release */ rfc_char_t CPIC_convid[9]; /* @field CPI-C Conversation ID */ rfc_char_t password_sate; /* @field state from the password */ /* see RFC_PASS_* */ rfc_char_t own_codepage_pcs[4+1]; /* @field Own codepage in partners * point of view. * Differs from own_codepage * field only if UNICODE and * pcs flag are used * (see ). * Elsewhere this field is * identically with * own_codepage field. */ rfc_char_t pcs[1+1]; /* @field Partners Char Size (valid only in Unicode systems) * 1/2: Non Unicode/Unicode * This information is only valid after succesfull call to the target system. */ rfc_char_t real_partner_codepage[4+1]; /* @field Partner real code page. * This information is valid only after succesfulll call */ rfc_char_t progname[40+1]; /* @field Name of the calling program */ rfc_char_t reserved[161]; /* @field reserve */}RFC_ATTRIBUTES;/* @type RFC_CODE_PAGE | RFC code page number * * SAP name of a code page. Use the transaction spad or scp * for a complete list: * * 1100 SAP internal, like ISO 8859-1 * 1103 IBM PC Multilingual 850 (00697/00850) * 1127 APPLE 8 Bit ASCII * 1160 Microsoft 1252, Superset of ISO 8859-1 * 1401 SAP internal, like ISO 8859-2 * 1404 Microsoft Windows 1250 * 1500 SAP-internal, like ISO 8859-5 * 1504 Microsoft Windows 1251 * 1610 SAP-internal, like ISO 8859-9 (Latin-5) * 1614 MS Windows 1254 * 1700 SAP-internal, like ISO 8859-7 (Greek) * 1703 IBM PC Code Page 869 Greece * 1704 MS-Windows 1253 * 1800 SAP-internal, like ISO 8859-8 (Hebrew) * 8000 Shift JIS * 8300 Traditional Chinese * 8400 Simplified Chinese * 8500 Korean * * 0100 IBM EBCDIC Codepage 00697/00273 * 0120 EBCDIC 0697/0500 Latin-1, Multilangual * 0410 EBCDIC 0959/0870 Latin-2, Multilingual * 0500 EBCDIC 1150/1025 Cyrillic, Multilingual * 0610 EBCDIC 1152/1026 Latin-5, Turkey * 0700 EBCDIC 0925/0875 Greece * 0800 EBCDIC 0941/0424 Hebrew * * 4100 ISO/IEC DIS 10646-1.2 Unicode UCS-2 big-endian * 4101 ISO/IEC DIS 10646-1.2 Unicode UCS-2 little-endian * 4102 ISO/IEC DIS 10646-1.2 Unicode UTF-16BE * 4103 ISO/IEC DIS 10646-1.2 Unicode UTF-16LE * 4110 Unicode UTF-8 * */typedef rfc_char_t RFC_CODE_PAGE[4+1] ;/* * @enum RFC_MODE | * * Type of connection to be opened by . */typedef enum{ RFC_MODE_R3ONLY = 0, /* @emem Use R/3 protocol and addressing scheme. * Only for R/3 systems. Any kind * of user id (dialog user id, CPI-C user id) * is possible. * * must point to a structure * of type . * */ RFC_MODE_CPIC = 1, /* @emem Use R/2 protocol and addressing scheme. * Must be used for R/2, * cpic user id are only allowed. * (Since an R/3 system is also capable of * understanding the R/2 RFC protocol, you can * reach also an R/3 system with that mode, * you must use a 'sideinfo' file for addressing, * however. * * must point to a structure * of type . */ RFC_MODE_VERSION_3 = 3, /* @emem Use R/3 protocol Version 3. * The receiving SAP system must have at least * Rel. 3.0C to be able to serve every kind * of options. * * must point to a structure * of type . */ RFC_MODE_PARAMETER = 4, /* @emem Use R/3 protocol Version 3 or R/2 protocol and * addressing scheme. * This mode includes all other modes above and all necessary * parameters will be read from a INI-file (saprfc.ini). * See saprfc.ini for more details * * In some cases the receiving SAP system must have at least * Rel. 3.0C to be able to serve every kind of options. * * must point to a valid entry * in the saprfc.ini. This file can be in the current directory * where RFC programs are running or defined by the Environment * Variable RFC_INI (e.g. /usr/rfctest/saprfc.ini). * * must be set to NULL. */ RFC_MODE_CPIC_EXT = 5 /* @emem Use R/2 protocol and addressing scheme * for communication between two external programs * without using the 'sideinfo' or the 'saprfc.ini' file. * * must point to a structure * of type . */}RFC_MODE;/* internal use */#define RFC_OPEN_USE_RFC 'R'#define RFC_OPEN_USE_CPIC ' '/* * @enum RFC_SNC_MODE | * * SNC mode of an RFC connection: ON or OFF * * The default value is RFC_SNC_MODE_OFF. * */typedef enum{ RFC_SNC_MODE_OFF = 0, /* @emem Working without SNC. */ RFC_SNC_MODE_ON = 1 /* @emem Working with SNC. */}RFC_SNC_MODE;/* * @enum RFC_SNC_QOP | * * SNC Quality of service (s. SNC document for more details) * * The default value is RFC_SNC_QOP_DEFAULT. * */typedef enum{ RFC_SNC_QOP_INVALID = 0, /* @emem plain text, but with authorization */ RFC_SNC_QOP_OPEN = 1, /* @emem plain text, but with authorization */ RFC_SNC_QOP_INTEGRITY = 2, /* @emem each packet is integrity protected */ RFC_SNC_QOP_PRIVACY = 3, /* @emem each packet is privacy protected */ RFC_SNC_QOP_DEFAULT = 8, /* @emem use global configuration defaults */ RFC_SNC_QOP_MAX = 9 /* @emem use maximum available security */}RFC_SNC_QOP;/* @struct RFC_EXT_DATA | * includes extended parameters for opening an RFC connection * such as SNC parameters (SNC: Secure Network Communications) * * If working with SNC and not using the 'saprfc.ini' file, * all SNC parameters must be set in this structure. */typedef struct{ RFC_SNC_MODE snc_mode; /* @field SNC mode for working * with or without SNC. */ RFC_SNC_QOP snc_qop; /* @field SNC Quality of service */ rfc_char_t * snc_myname; /* @field Own SNC name if you don't want * to use the default SNC name */ rfc_char_t * snc_partnername; /* @field SNC name of partner system * */ rfc_char_t * snc_lib; /* @field name of the SNC library * on the local system */ rfc_char_t xmlflag[2]; rfc_char_t reserve[254]; /* @field reserve, must be set to 0 * */}RFC_EXT_DATA;/* @struct RFC_CONNOPT_CPIC | * Options for an R/2 connection (via SAP gateway). * connection data must be specified at the SAP gateway, * 'destination' is used as key into the 'sideinfo' file there. */typedef struct{ rfc_char_t * gateway_host; /* @field gateway hostname */ rfc_char_t * gateway_service; /* @field gateway service * (in general sapgw00). */}RFC_CONNOPT_CPIC;/* @struct RFC_CONNOPT_CPIC_EXT | * Options for an RFC connection (via SAP gateway) * between two external programs without using the 'sideinfo' * or the 'saprfc.ini' file. */typedef struct{ int register_mode; /* @field register mode: * 0: Server program is to be started by SAP gateway. * 1: Server program is running in register mode. */ rfc_char_t * gateway_host; /* @field gateway hostname */ rfc_char_t * gateway_service; /* @field gateway service */ rfc_char_t * tp_host; /* @field host name of the partner program * not needed if register_mode is 1. */ rfc_char_t * tp_name; /* @field name or program ID of the partner program * if the parameter 'register_mode' is set to 1. */ void * ext_data; /* @field data for working with extended features * such as SNC (Secure Network Communications). * 'ext_data' must be set to NULL or point to a * structure of type . */}RFC_CONNOPT_CPIC_EXT;/* @struct RFC_CONNOPT_R3ONLY | * Options for a connection to an R/3 system. */typedef struct{ rfc_char_t * hostname; /* @field Host name of target system. * Host names can be regular host * names * defined in a 'hosts' file, * an IP address like * 123.123.123.123 or a saprouter * address as * /H/hostname/S/port/H/host/S/port/... */ int sysnr; /* @field system number (0-99). * This is the number by which * the target system * is identified. In general this is 0. */ rfc_char_t * gateway_host; /* @field gateway hostname. * If the pointer is NULL, the gateway is * assumed to run at 'hostname'. */ rfc_char_t * gateway_service; /* @field gateway service. * If the pointer is NULL, * the service "sapgw##" with * ## = 'sysnr' is assumed. */}RFC_CONNOPT_R3ONLY;/*-------------------------------------------- * @struct RFC_CONNOPT_VERSION_3 | * Options for a connection to a R/3 system. * The target system must be of release 3.0C or later. * * Since a R/3 system of version 3.0 always has it's * own 'gateway' process, no gateway options are necessary * any more. *-----------------------------------------------------------*/typedef struct{ rfc_char_t * hostname; /* @field Host name of target system. * Host names can be regular host * names * defined in a 'hosts' file, * an IP address like * 123.123.123.123 or a saprouter * address as * /H/hostname/S/port/H/host/S/port/... * * If 'use_load_balancing' is set to a non-zero * value, this field can be NULL. * */ RFC_INT sysnr; /* @field system number (0-99). * This is the number by which * the target system * is identified. In general this is 0. * * If 'use_load_balancing' is set to a non-zero * value, this field is ignored. * */ RFC_INT use_load_balancing; /* @field Use the load balancing features * of a SAP system. * * If you set this to a non-zero value, * 'hostname' and 'sysnr' are ignored. * * You must set the fields 'lb_host' * and 'lb_system_name' instead. * * The target system is determined dynamically * then. * */ rfc_char_t * lb_host; /* @field Host name where the 'message server' * of the target system is running. * * This field must only be filled, if * 'use_load_balancing' is set to a non-zero * value. */ rfc_char_t * lb_system_name; /* @field Name of the target system (C11 i.e.) * * This field must only be filled, if * 'use_load_balancing' is set to a non-zero * value. */ rfc_char_t * lb_group; /* @field application server group. * * The group of application servers to be used. * * This field must only be filled, if * 'use_load_balancing' is set to a non-zero * value. */ RFC_INT use_sapgui; /* @field use 'sapgui' process to * display SAP dynpros and graphics. * * Set this to 1 to activate * this functionality. * * Set this to 2 if you want to let SAPGUI * automatically invisible after each RFC function. * This functionality requires R/3, Rel. >= 3.0F * and only available with SAPGUI, Rel. >= 3.0E * on Windows NT or 95. * * Starting sapgui takes some time, so * you should not set that value, if you do not * need it. * * This field is set implicitly as soon as * you activate the ABAP/4 debugger by * entering 'D' in the field or * by setting RFC_DEBUG in the system environment. * */ void * ext_data; /* @field data for working with extended features * such as SNC (Secure Network Communications). * 'ext_data' must be set to NULL or point to a * structure of type . */}RFC_CONNOPT_VERSION_3;/*---------------------------------------------------------------------------- * @struct RFC_OPTIONS | * parameters for . * * Depending on the type of connection various data have to be supplied * to open a RFC connection. * * There are 3 ways to supply this information: * * 1. You can enter a destination name pointed to an entry in a 'saprfc.ini' * file which contains the necessary network parameters and RFC specific * parameters for opening the connection at . * * 2. You can enter a destination name pointed to an entry in a 'sideinfo' * file which only contains the necessary network parameters for opening * the connection at . * * 3. You supply in your program all the data needed for opening the * connection at . * * * * We recommend the first one (working with saprfc.ini) because you can use some * RFC features today and in the future without changes in your RFC programs. * * See saprfc.ini for more details. * * * Fields that are not supplied must be set to NULL. * * The structure consists of 3 groups. * * The data needed to establish the physical connection depend on * the type of connection (R/2 or R/3 connection, version , ... ). * Depending on the contents of the field 'mode', the field 'connopt' * must point to different structures. * * The sign on data ( client, user, password, language ) are needed * for authentication. Since only opens the physical connection * directly. these data are only checked if the first RFC call is * send. * * The third field contains a trace flag. If not zero, a trace file * is written for all the operations corresponding to this connection * to ease error analysis. * * Please make sure, that this structure is completely initialized * with 0 to allow adding more connection parameters in the future * by SAP. * * Please make sure you are using language field in SAP format (like E, F, S) * If you are using language in ISO-Format (like EN, DE, FR, ES) only first char * will be interpreted. The rest will be truncated without any error or warning. * * @ex Options for a R/3 connection. | * * // static = initialized structures * static RFC_OPTIONS options; * static RFC_CONNOPT_R3ONLY rfc_connopt_r3only; * RFC_HANDLE handle; * * options.destination = "TEST"; * options.mode = RFC_MODE_R3ONLY; * options.client = "000"; * options.user = "SAP*"; * options.language = "E"; * options.password = "PASS"; * options.trace = 0; // turn trace off * * options.connopt = &rfc_connopt_r3only; * * rfc_connopt_r3only.hostname = "some_host"; // some host name * rfc_connopt_r3only.sysnr = 0; // system 00 * * handle = RfcOpen( &options ); * if ( handle == RFC_HANDLE_NULL ) * { * ..... * *--------------------------------------------------------------------------------*/typedef struct{ rfc_char_t * destination; /* @field name of destination. * If the connection is not described * completely, this name is used as a * key for a 'sideinfo', where the * connection should be described then. * You always have to fill this field. */ /* connection data */ RFC_MODE mode; /* @field connection mode. * There are two different protocol * types for RFC, depending on whether * your target system is a R/2 or a R/3 * or an external system. * * If your target system is a SAP system * of Release 3.0C or later you can use * various special options, if you enter * the value * here. * * Depending on the content of * this field, connopt must point to * different structures. * (s. ). */ void * connopt; /* @field If connopt is NULL, the 'sideinfo' * or the 'saprfc.ini' file is used to determine the * the connection parameters. * * Without 'sideinfo' file * 'connopt' must point to a structure * of type , * or * or * depending * on the value of 'mode'. * */ /* sign on data */ rfc_char_t * client; /* @field signon data: client */ rfc_char_t * user; /* @field signon data: user id */ rfc_char_t * password; /* @field signon data: password */ rfc_char_t * language; /* @field signon data: language in SAP format */ /* options */ int trace; /* @field trace. * If 0, no trace is written, * if not 0, the RFC library traces * all activities into a file 'dev_rfc' * in the actual working directory. * * If your target system is of release 3.0C * or later, you can enter the value 'D' here * to start the ABAP/4 debugger on the target * system. * * The ABAP/4 debugger can also be activated * by setting the environment variable * RFC_DEBUG before the call to * is done. */}RFC_OPTIONS;#define RFC_HOSTNAME_LN 100typedef rfc_char_t RFC_HOSTNAME[RFC_HOSTNAME_LN+1];/*------------------------------------------------------------------ * @func * * * ===================================================== * * Please use instead of this function * * ===================================================== * * * opens a RFC connection via LOAD BALANCING * * (only available for R/3 Release 3.0 onwards). * * With this function the RFC library will try to connect to an * application server with the least load (LOAD BALANCING principle) * within a group of predefined application servers. * * This function has following advantages: * * 1. The load in R/3 system is distributed to different application server * * 2. RFC connections are thus independent of a specific application server. * (With or a RFC connection could only be established * to a predefined application server). * * 3. Only the host name of the message server and its port number of the * according R/3 are required in the host file and the services file. * * Information about SAP gateway, application server, system number,... as * parameter for , or as parameter in sideinfo are no longer * necessary. Even the sideinfo is no longer required. * * * @rdesc * returns a handle to the RFC connection ( ) or * RFC_HANDLE_NULL, if the connection cannot be opened. * * @xref *---------------------------------------------------------------------------------*/RFC_HANDLE SAP_API RfcConnect( rfc_char_t * system_name, /* @parm name of the R/3 system */ rfc_char_t * ms_hostname, /* @parm hostname of the message server */ rfc_char_t * group_name, /* @parm name of a specific group of application servers */ rfc_char_t * client, /* @parm signon data: client */ rfc_char_t * user, /* @parm signon data: user id */ rfc_char_t * password, /* @parm signon data: password */ rfc_char_t * language, /* @parm signon data: language */ int trace, /* @parm trace ( 0 / 1 ). */ RFC_HOSTNAME as_hostname, /* @parm name of the connected App. Server (Output parm.) */ int * sysnr /* @parm system number of the connected R/3 system (Output parm.) */);/*--------------------------------------------------------------------------------------- * * @func * * * ===================================================== * * Please use instead of this function * * ===================================================== * * * opens a RFC connection. * all parameters are passed as single fields. * * * @rdesc * returns a handle to the RFC connection ( ) or * RFC_HANDLE_NULL. * * @xref *--------------------------------------------------------------------*/RFC_HANDLE SAP_API RfcOpenExt( rfc_char_t* destination, /* @parm name of destination. */ RFC_MODE mode, /* @parm connection mode ( ). */ rfc_char_t* hostname, /* @parm hostname of target system. */ int sysnr, /* @parm system number ( 0 - 99 ). */ rfc_char_t* gateway_host, /* @parm gateway hostname or NULL */ rfc_char_t* gateway_service, /* @parm gateway service or NULL */ rfc_char_t* client, /* @parm signon data: client */ rfc_char_t* user, /* @parm signon data: user id */ rfc_char_t* password, /* @parm signon data: password */ rfc_char_t* language, /* @parm signon data: language */ int trace /* @parm trace ( 0 / 1 ). */);/*------------------------------------------------------------------------ * @func * * * ===================================================== * * Please use instead of this function * * ===================================================== * * * opens a RFC connection. * * all parameters are passed as single fields. * (using the all possible ) * * Following parameters in this call are always needed: * mode, * SAP-logon-Info: client, user, password, language * trace * use_sapgui * * Depending of mode following parameters are necessary: * * * RFC_MODE_PARAMETER: * * - destination must be defined. * * - the 'saprfc.ini' file is needed. * * - the 'sideinfo' file is NOT necessary. * * RFC_MODE_CPIC_EXT: * * - destination is not necessary. * * - gateway_host, gateway_service, tp_host and tp_name must be defined. * * - the 'saprfc.ini' and the 'sideinfo' file are NOT necessary. * * RFC_MODE_CPIC: * * - destination must be defined. * * - gateway_host and gateway_service can be defined. * * - sideinfo is necessary. * * RFC_MODE_R3ONLY/RFC_MODE_VERSION_3: * * - use_load_balancing is 0 (OFF) * * destination is not NULL: * * gateway_host, gateway_service, hostname and sysnr * can be defined. sideinfo is necessary. * * destination is NULL: * * gateway_host and gateway_service can be defined. * hostname, sysnr must be defined. * * - use_load_balancing is 1 (ON): * * destination, gateway_host, gateway_service, * hostname and sysnr will not be evaluated. * * lb_host and lb_system_name must be defined. * if lb_group is NULL the group 'PUBLIC' will be used. * * * ATTENTION: * * - use_sapgui and ABAP-Debug are only available with R/3 3.0C or later * and not on Windows with 16-bit-RFC-library. * Moreover, the functionality "INVISIBLE SAPGUI" after each RFC-function * requires R/3, Rel. >= 3.0F and only available with SAPGUI, * Rel. >= 3.0E on Windows NT or 95. * * - use_sapgui and ABAP-Debug are not available with R/2. * * * @rdesc * returns a handle to the RFC connection ( ) or * RFC_HANDLE_NULL. * * @xref *------------------------------------------------------------------*/RFC_HANDLE SAP_API RfcOpenExtV3( rfc_char_t* destination, /* @parm name of destination or NULL */ RFC_MODE mode, /* @parm connection mode ( ) */ rfc_char_t* hostname, /* @parm hostname of target system or NULL */ int sysnr, /* @parm system number ( 0 - 99 ) */ rfc_char_t* gateway_host, /* @parm gateway hostname or NULL */ rfc_char_t* gateway_service, /* @parm gateway service or NULL */ rfc_char_t* client, /* @parm signon data: client */ rfc_char_t* user, /* @parm signon data: user id */ rfc_char_t* password, /* @parm signon data: password */ rfc_char_t* language, /* @parm signon data: language */ int trace, /* @parm trace (OFF/ON/ABAP-DEBUG: 0/1/2) */ RFC_INT use_load_balancing, /* @parm using load balancing feature (OFF/ON: 0/1)*/ rfc_char_t* lb_host, /* @parm Host name of the 'message server' */ rfc_char_t* lb_system_name, /* @parm Name of the target system (C11 i.e.) */ rfc_char_t* lb_group, /* @parm application server group or NULL for PUBLIC */ RFC_INT use_sapgui /* @parm using sapgui to display SAP dynpros and graphics * (OFF/ON/INVISIBLE_SAPGUI after each RFC-function: 0/1/2) */);#ifdef SAPwithUNICODE#define RFC_ROLE_CLIENT cU('C')#define RFC_ROLE_SERVER cU('S')#define RFC_SERVER_R2 cU('2')#define RFC_SERVER_R3 cU('3')#define RFC_SERVER_EXT cU('E')#define RFC_SERVER_EXT_REG cU('R')#define RFC_SERVER_SHM cU('F')#define RFC_PASS_UNKN cU(' ')#define RFC_PASS_OK cU('O')#define RFC_PASS_MUST_CHNG cU('M')#define RFC_PASS_NO_CHNG cU('N')#else#define RFC_ROLE_CLIENT 'C'#define RFC_ROLE_SERVER 'S'#define RFC_SERVER_R2 '2'#define RFC_SERVER_R3 '3'#define RFC_SERVER_EXT 'E'#define RFC_SERVER_EXT_REG 'R'#define RFC_SERVER_SHM 'F'#define RFC_PASS_UNKN ' ' /* unknown (RFC server, * or SAPsystem older than 46C * or no roundtrip yet) */#define RFC_PASS_OK 'O' /* OK */#define RFC_PASS_MUST_CHNG 'M' /* expired must be changed */#define RFC_PASS_NO_CHNG 'N' /* cannot be changed: on this SAP system, * password can only be changed once a day */#endif/*--------------------------------------------------------------------------------- * @func * * With this function, an RFC connection will be opened and if the RFC server * is an R/2 or R/3 system, it will try to login onto the according * SAP system. There are some advantages with this feature: * * 1. The structure of parameters in this call need not be changed for * new functionalities in future. * * 2. SAP logon check at OPEN-time and not at the first call of a * function module as usual. * * 3. Better performance if the RFC server is an R/3 from 3.0 onwards, * because data will be compressed before transfer and not after the * first call as usual. * * * This call should be used instead of RfcOpen, RfcOpenExt, RfcOpenExtV3 * and RfcConnect. * * * @head2 Structure and contents of the 'Connect_param' | * This parameter is a zero terminated string and must have the following * structure: * * @head3 ID=value ID=value ... ID=value | * * Pay attention that the ID's are not case-sensitive but the values are * case-sensitive and must be set in "..." if blanks are included. * * Depend on the RFC server (R/2, R/3 or External system), some of * these ID's are fix and some of them are optional. * * Following ID's are available: * * * TYPE RFC server type, 2/3/E: R/2 or R/3 or External System * (Default: 3) * * CLIENT SAP logon client * * USER SAP logon user * * PASSWD SAP logon password * * * LANG SAP logon language (1-byte SAP language or 2-byte ISO language) * * CODEPAGE The given codepage is to be used for this connection (Default is * either 1100 or set by or is set by SAP_CODEPAGE * environment variable). Could be rather useful if the sapgui should be started * with codepage differs from 1100. * * LCHECK Logon check at OPEN time (0/1: without/with check, Def. 1) * * NEWPASS Changes the password during the logon * !!!On SAP system kernel older than 46C the password is sent * in clear text on the network!!!! * * TRACE RFC trace (0/1: without/with trace, Def. 0) * * DEST Destination in saprfc.ini if working with saprfc.ini. * If the RFC server is an R/2 system this destination must * also be defined in the 'sideinfo' for the SAP gateway. * * GWHOST Host name of the SAP gateway (if server is R/2 or External) * * GWSERV Service of the SAP gateway (if server is R/2 or External) * * MSHOST Host name of the Message Server (if using Load Balancing) * * MSSERV Service of the Message Server (if using Load Balancing) * * R3NAME Name of the R/3 system (if using Load Balancing) * * GROUP Name of the group of application servers (if using Load Balancing) * * ASHOST Host name of a specific application server (R/3, No Load Balancing) * * SYSNR R/3 system number (R/3, No Load Balancing) * * TPHOST Host name of the external RFC server program * * TPNAME Path and name of the external RFC server program * or Program ID of an registered RFC server program. * * USE_SAPGUI RFC with SAPGUI, 0/1/2: without/with/invisible SAPGUI * between two RFC functions (Default: 0). If the sapgui * is to be started with codepage differs from 1100, please * use option CODEPAGE to define the codepage you need. * * ABAP_DEBUG RFC with ABAP debugger, 0/1: without/with ABAP debugger * (Default: 0) * * SNC_MODE Working with SNC, 0/1: without/with SNC * (Default: 0, s. ) * * SNC_QOP SNC Quality of service * (Default: 8 (RFC_SNC_QOP_DEFAULT), s. ) * * SNC_MYNAME Own SNC name if you don't want to use the default SNC name * * SNC_PARTNERNAME SNC name of the SNC partner (RFC server) * or SNC name of the message server (Load Balancing) * * SNC_LIB Path and name of the SNC-library * * SAPLOGON_ID String defined for SAPLOGON on 32-bit Windows * * GRT_DATA SAProuter connect data for SAPGUI when using RFC with SAPGUI. * /H/...... : the whole router string for SAPGUI. * /P/password: If the password for the SAPGUI connection is not * the same as the one for the RFC connection. * * PCS Partner's Char Size. The RFC-library determines automatically the partner's char size * at open time (using logon check) or at first call time (without logon check). * This flag tells directly the unicode RFC library to open a connection to a system with * size of char given by this value. Currently are two values valid 1/2 : Non Unicode/Unicode * (Default: 1). * If the partner is not an unicode system but the value of the PCS flag is 2 an error will occur * (Runtime exception in the remote system). If the partner is an unicode system but the value * of the PCS flag is 1 the connection kind will be switched automatically. * This field works only with unicode library. * * COMM_CP When communication has to be established between an Unicode Library and a Non Unicode system, * all char like data will be converted into codepage which matched to logon language before send them. * This codepage is called communication codepage. The effect of this method is that the Non Unicode * System is sure to talk an system with communication codepage and not with an unicode system. * Usualy the RFC Library determines automatically the communication codepage. Using this option * it is possible for the programer to set the communication codepage directly. * This option is only active in the unicode version of the RFC library. * * ICCE Ignore Character Conversion Errors, 0/1: Do not ignore/Ignore (Default 1 if not redefined by environment * variable RFC_IGNORE_CONV_ERROR). The value set by environment variable can be overloaded by connect string. * This flag determines the runtime behaviour of the RFC library concerning character conversion. * If this flag is 1, the concerned API will not exit with error, but replace the character * which could not be converted with CFIT defined token. * * CFIT Conversion Fault Indicator Token. * This flag determines substitute symbol for received unicode characters, which could not * be converted by the RFC library (Default: non unicode systems 0x23, unicode systems 0xfffd, * or defined by environment variable RFC_REPL_CHAR). The code point has to be set using * hex format (0x23, 0x30 etc). The value set by environment variable * can be overloaded using connect string. * * WAN_CONN RFC via Wide Area Network, 0 = LAN, 1 = WAN (Default: 0). * If LAN is used, all tables bigger than 8000 Bytes will be compressed before sent. * If WAN is used, all tables bigger than 250 Bytes (or value defined by * environment variable RFC_WAN_THRESHOLD) will be compressed before sent. * The table size will be calculated as follows: table_length * number_of_rows. * * IDLE_TIMEOUT Inform the Web Application Server to close the connection after idle time in seconds. * * TOUPPER Do not convert user and password to upper case for sending to Web Application Server: 0/1 (Default 1, i.e. convert to upper case). * * Alternative logon possibilities: * * ALIAS_USER An alias user name, could used instead of user or even together with USER. * If both USER and ALIAS_USER are used, than theay have to be match. * * MYSAPSSO SAP Cookie Version 1. Will be used instead of user and password for logon to backend * * MYSAPSSO2 SAP Cookie Version 2. Will be used instead of password for logon to backend. * In this case, user name is optional. * * X509CERT An X.509 certificate will be used instead of password to logon to R/3 System. * In this case, user name is optional. * * EXTIDDATA Contains valid external user's ID of an external authentification system. * User name is optional. * External ID is to be defined in the backend (SAP-System). * * EXTIDTYPE Defines the kind of external identity. Valid only with EXTIDDATA. * Follow values are not allowed: ID, NT; DN, CA, X, HX. * * Additionally, RFC Library provides the feature to retrieve MYSAPSSO2 certificate from the backend * after successful logon: * * GETSSO2 Request to create a cookie version 2 using given password and user name. * If the value is 1, the cookie will be generated from user and password values * given by USER=user and PASSWORD=password in the same connect_param string. * Instead, user and password X.509 certificate could be used. * If the RfcOpenEx call ended successfully, the generated SAP cookie version 2 * can be retrieved via API. * * * @head2 EXAMPLES | * * Some examples for working with these ID's. * * @head3 1. RFC server is an R/2 system | * * Following data are fix: TYPE=2 DEST=... CLIENT=... USER=... PASSWD=... LANG=D * * no additional info necessary if using saprfc.ini * * additional info if not using saprfc.ini: GWHOST=ihsap4 GWSERV=sapgw00 * * additional info if using SAPLOGON on 32-bit Windows: SAPLOGON_ID=... * * In all cases, the sideinfo for the according SAP gateway must * have an entry with the destination above. * * * @head3 2. RFC server is an R/3 system | * * Following data are fix: CLIENT=... USER=... PASSWD=... LANG=D * * additional info if using saprfc.ini : DEST=BIN * * additional info if not using saprfc.ini * * + Connect to a specific application server: ASHOST=hs0311 SYSNR=53 * * + Connect using Load Balancing: MSHOST=hs0311 R3NAME=BIN GROUP=PUBLIC * * If no info about MSHOST, the RFC library will try to get this * host name in the 'sapmsg.ini' customized for SAPLOGON on Windows * (in Windows-directory). This file can also be copied and used on * a Non-Windows-Host. It must be in the working directory of the RFC * client or its path name must be defined via the environment * 'RFC_LOGON_INI_PATH' (e.g. /usr/rfctest). * The SAProuter string, if exists, must be defined in the R/3 name. * * e.g. R3NAME=/H/sapgate1/S/3297/LOI where LOI is the R/3 system name. * * or R3NAME=/SAP_test/LOI or R3NAME='/SAP America/LOI' * where 'SAP_test' and 'SAP America' is the router name defined * in the 'saproute.ini' for SAPLOGON on Windows. * * additional info if using SAPLOGON on 32-bit Windows: SAPLOGON_ID=... * * * @head3 3. RFC server is an external program | * * Following data are fix: TYPE=E * * additional info if using saprfc.ini : DEST=RFCEXT * * additional info if not using saprfc.ini * * In this case, the info about TPHOST determines whether your RFC * client will connect to an RFC server started by the SAP gateway * or it will connect to an already registered RFC server. * * + RFC server will be started by the SAP gateway * * GWHOST=hs0311 GWSERV=sapgw53 TPHOST=hs0311 TPNAME=/sap/srfcserv * * If GWHOST and TPHOST are different, make sure that the SAP gateway * has the access to start the server program via remote shell. * * * + RFC server is already registered at the SAP gateway * * GWHOST=hs0311 GWSERV=sapgw53 TPNAME=hw1145.srfcserv * * * See the delivered program srfctest.c for more details. * * * * @head2 ATTENTION | * * - USE_SAPGUI and ABAP_DEBUG are only available with R/3 3.0C or later * and not on Windows with 16-bit-RFC-library. * Moreover, the functionality "INVISIBLE SAPGUI" after each RFC-function * requires R/3 from 3.0F onwards and only available with SAPGUI from 3.0E * onwards on Windows NT/95 or with SAPGUI from 3.0F onwards on UNIX. * * - USE_SAPGUI and ABAP_DEBUG are not available with R/2. * * - SAPLOGON_ID is only available on 32-bit Windows where SAPLOGON is also installed. * Using this feature, all parameters needed for open a connection to an SAP system * such as DEST, GWHOST, GWSERV, ASHOST, SYSNR, MSHOST, R3NAME, GROUP and SNC-parameters * are not necessary because the RFC library will get this information from the * SAPLOGON data files. * * * @rdesc * returns a valid handle to the RFC connection ( ) or * RFC_HANDLE_NULL if connection could not be established. In the * case of failure please interprete the structure for more * information. * * * @comm * 1. Every connection will be established either * with default code page 1100 or * according environment variable SAP_CODEPAGE or * according id CODEPAGE in
string of this function. * * 2. Do not call
if RFC_HANDLE_NULL was returned but * extract the error information from . * * 3. The UNICODE RFC Library determines automatically, which kind connection * is to be established: unicode or non unicode. This will be done at open time * if RfcOpenEx was called with logon check or at the first rfc call time without * logon check (s. LCHECK filed for more information). * *---------------------------------------------------------------------------*/DECL_EXP RFC_HANDLE SAP_API RfcOpenEx ( rfc_char_t * connect_param, /* @parm connection parameters.*/ RFC_ERROR_INFO_EX * error_info /* @parm
describing the error.*/);/*---------------------------------------------------------------------------------------- * @func * * * ===================================================== * * Please use instead of this function * * ===================================================== * * * opens a connection according to the given options. * * The structure * contains the necessary data for opening the connection * * * @rdesc * returns a handle to the RFC connection ( ) or * RFC_HANDLE_NULL, if the connection cannot be opened. * * @xref *---------------------------------------------------------------*/RFC_HANDLE SAP_API RfcOpen( RFC_OPTIONS * options /* @parm connection parameters as described * at structure . */);/*-------------------------------------------------------------- * @func * accepts an incoming connection and has to be used, if the program * was started by a RFC call issued by a SAP system or an other * program using this API. The command line (argv) has to be passed * to this function. * * With Release 3.0C onwards this function can be used to register at * a SAP gateway and the server program can wait for next RFC request * by issueing or or * or . * * Using this functionality a RFC server program can now already run * and work as a RFC daemon. A start of any server program by a R/3 * application server, by SAPGUI or via remote shell by a SAP gateway * is no longer necessary. * * There are 2 ways to define the input parameter 'argv': * * 1. Working with 'saprfc.ini'-file: * * -D destination pointed to an entry in 'saprfc.ini' * * -t Set RFC-Trace on * * * 2. Working without 'saprfc.ini'-file: * * -a program ID e.g. own_host_name.program_name * * -g host name of the SAP gateway * * -x service of the SAP gateway , e.g. sapgw00 * * -t Set RFC-Trace on * * * * We recommend the first one because you can use some RFC features today * and in the future without changes in your RFC programs. * * See saprfc.ini for more details. * * * * The 3 parameters above must fit with the configuration in R/3. * (via SM59, Connection type T and Register Mode) * * For working with register mode there are no other changes in RFC * server programs necessary. * * Be careful by using only the program name as program ID because * there might be more programs (e.g. rfcexec) registered at the * same SAP gateway. Please use at least the host name of the computer where * your RFC server program is running as a part of the program ID. * * Example: The well-known rfcexec program can be started from the * command line with RFC-trace as follows: * * rfcexec -ap10234.rfcexec -ghs0311 -xsapgw53 -t * * or * * rfcexec -Drfctest * * and an entry in saprfc.ini can be defined as follows: * * DEST=rfctest * * TYPE=R * * PROGID=p10234.rfcexec * * GWHOST=hs0311 * * GWSERV=sapgw53 * * RFC_TRACE = 1 * * * * RFC server programs working with this functionality will be called * RFC server programs running in register mode. * * * If an RFC server program is working with SNC (Secure Network * Communications) it can be started with the following SNC parameters: * * -L SNC library name on the local system e.g. /krb5/hpux/lib/libkrb5.sl * * -S SNC name of this local instance * * * ATTENTION: * * RFC program can use to test whether * and how many server programs are registered at a SAP gateway with a * defined program ID. Moreover, it can use * to cancel all RFC servers which are registered at a SAP gateway with a * defined program ID. * * * @rdesc * returns a valid or RFC_HANDLE_NULL * * @comm * An unicode rfc server switchs automatically to unicode/non-unicode mode * depends from a client (unicode/non unicode). *--------------------------------------------------------------*/DECL_EXP RFC_HANDLE SAP_API RfcAccept( rfc_char_t ** argv /* @parm command line (argv), the program is started with.*/);RFC_HANDLE SAP_API RfcAcceptExt( rfc_char_t* CommandLine );/*---------------------------------------------------------------------------- * @func * * closes a RFC connection or all RFC connections. * * @comm * Be carefully. If parameter is RFC_HANDLE_NULL, all existing and in the same thread last active connections * will be closed. This could leads to an unexpected behaviour of your application. * It could be usefull to test whether the connection have been already closed, * before call this API * * ... * if (handle != RFC_HANDLE_NULL) * RfcClose (handle); * ... * * A connection could already be closed after an unsuccessful * RfcCall for example. *----------------------------------------------------------------------------*/DECL_EXP void SAP_API RfcClose ( RFC_HANDLE handle /* @parm handle to RFC connection. * * If handle is RFC_HANDLE_NULL, all opened and in the same thread last active connections * will be closed. */);/*---------------------------------------------------------------------------- * @func * * sends a error message, if possible, and closes the connection. * * A given error message cannot be send, if the receiver is not in state, * where it expects some RFC data to receive. * *----------------------------------------------------------------------------*/DECL_EXP void SAP_API RfcAbort ( RFC_HANDLE handle, /* @parm handle to RFC connection */ rfc_char_t * text /* @parm error message. * * If this field is NULL, the connection is * only closed. */);/*--------------------------------------------------------------- * @enum RFC_RC | RFC return codes *---------------------------------------------------------------*/typedef enum{ RFC_OK, /* @emem O.K. */ RFC_FAILURE, /* @emem Error occurred */ RFC_EXCEPTION, /* @emem Exception raised */ RFC_SYS_EXCEPTION, /* @emem System exception raised, connection closed */ RFC_CALL, /* @emem Call received */ RFC_INTERNAL_COM, /* @emem Internal communication, repeat (internal use only */ RFC_CLOSED, /* @emem Connection closed by the other side */ RFC_RETRY, /* @emem No data yet (RfcListen or RfcWaitForRequest only) */ RFC_NO_TID, /* @emem No Transaction ID available */ RFC_EXECUTED, /* @emem Function already executed */ RFC_SYNCHRONIZE, /* @emem Synchronous Call in Progress (only for Windows) */ RFC_MEMORY_INSUFFICIENT, /* @emem Memory insufficient */ RFC_VERSION_MISMATCH, /* @emem Version mismatch */ RFC_NOT_FOUND, /* @emem Function not found (internal use only) */ RFC_CALL_NOT_SUPPORTED, /* @emem This call is not supported */ RFC_NOT_OWNER, /* @emem Caller does not own the specified handle */ RFC_NOT_INITIALIZED, /* @emem RFC not yet initialized */ RFC_SYSTEM_CALLED, /* @emem A system call such as RFC_PING for connection * test is executed */ RFC_INVALID_HANDLE, /* @emem An invalid handle was passed to an API call */ RFC_INVALID_PARAMETER, /* @emem An invalid parameter was passed to an API call or * parameter length mismatch (expected and received) has * been detected. */ RFC_CANCELED, /* @emem An rfc call has been canceled by user */ RFC_CONVERSION, /* @emem An error during conversion has been detected */ RFC_INVALID_PROTOCOL, /* @emem The received data has an unsupported format. * e.g.: non unicode application receives data sended * in unicode format */ RFC_TIMEOUT}RFC_RC;/*------------------------------------------------------------------ * @struct RFC_PARAMETER | * RFC parameters. * * Describes 'Exporting', 'Importing', 'Changing' parameters of the * interface of a function module. * * @xref , , , , * , , , , * ,