|
SAP NetWeaver RFC SDK 7.50
|
Some utility functions for initializing, tracing, version info, etc. More...
Functions | |
| DECL_EXP RFC_RC SAP_API | RfcInit (void) |
| Initialization of internal variablesSets up the internal state of the sapnwrfc library and initially reads and evaluates the sapnwrfc.ini file. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetVersion (unsigned *majorVersion, unsigned *minorVersion, unsigned *patchLevel) |
| Get information about currently loaded sapnwrfc library. More... | |
| DECL_EXP RFC_RC SAP_API | RfcGetVersionInternal (void) |
| This function is intended to be used by SAP Make-factory only. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetIniPath (const SAP_UC *pathName, RFC_ERROR_INFO *errorInfo) |
| Sets the directory in which to search for the sapnwrfc.ini file. More... | |
| DECL_EXP RFC_RC SAP_API | RfcReloadIniFile (RFC_ERROR_INFO *errorInfo) |
| Loads the contents of the sapnwrfc.ini file into memory. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceLevel (RFC_CONNECTION_HANDLE connection, SAP_UC *destination, unsigned traceLevel, RFC_ERROR_INFO *errorInfo) |
| Sets the current trace level of the specified RFC connection or destination to the new value. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceEncoding (SAP_UC *traceEncoding, RFC_ERROR_INFO *errorInfo) |
| Changes the character encoding to be used in trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceDir (SAP_UC *traceDir, RFC_ERROR_INFO *errorInfo) |
| Changes the directory where the NW RFC lib should write trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetTraceType (SAP_UC *traceType, RFC_ERROR_INFO *errorInfo) |
| Changes the way the NW RFC lib writes trace files. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSetCpicTraceLevel (unsigned traceLevel, RFC_ERROR_INFO *errorInfo) |
| Sets the global CPIC trace level used by the underlying CPIC libabry to write CPIC tracing information to the CPIC trace file cpic_<pid>.trc, where pid is the process ID of the current process. More... | |
| DECL_EXP RFC_RC SAP_API | RfcUTF8ToSAPUC (const RFC_BYTE *utf8, unsigned utf8Length, SAP_UC *sapuc, unsigned *sapucSize, unsigned *resultLength, RFC_ERROR_INFO *errorInfo) |
| Converts data in UTF-8 format to SAP_UC strings. More... | |
| DECL_EXP RFC_RC SAP_API | RfcSAPUCToUTF8 (const SAP_UC *sapuc, unsigned sapucLength, RFC_BYTE *utf8, unsigned *utf8Size, unsigned *resultLength, RFC_ERROR_INFO *errorInfo) |
| Converts data in SAP_UC format to UTF-8 format. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetRcAsString (RFC_RC rc) |
| Converts an RFC_RC return code to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetTypeAsString (RFCTYPE type) |
| Converts an RFCTYPE data type indicator to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetDirectionAsString (RFC_DIRECTION direction) |
| Converts an RFC_DIRECTION direction indicator to a human readable string for logging purposes. More... | |
| DECL_EXP const SAP_UC *SAP_API | RfcGetServerStateAsString (RFC_SERVER_STATE serverState) |
| Converts an RFC_SERVER_STATE state indicator to a human readable string for logging purposes. More... | |
| DECL_EXP RFC_RC SAP_API | RfcLanguageIsoToSap (const SAP_UC *laiso, SAP_UC *lang, RFC_ERROR_INFO *errorInfo) |
| Converts a 2-char SAP language code to the 1-char SAP language code. More... | |
| DECL_EXP RFC_RC SAP_API | RfcLanguageSapToIso (const SAP_UC *lang, SAP_UC *laiso, RFC_ERROR_INFO *errorInfo) |
| Converts a 1-char SAP language key to the 2-char SAP language code. More... | |
Some utility functions for initializing, tracing, version info, etc.
| DECL_EXP const SAP_UC* SAP_API RfcGetDirectionAsString | ( | RFC_DIRECTION | direction | ) |
Converts an RFC_DIRECTION direction indicator to a human readable string for logging purposes.
| [in] | direction | Direction indicator to convert |
Converts an RFC_RC return code to a human readable string for logging purposes.
| [in] | rc | Return code to covert to string |
| DECL_EXP const SAP_UC* SAP_API RfcGetServerStateAsString | ( | RFC_SERVER_STATE | serverState | ) |
Converts an RFC_SERVER_STATE state indicator to a human readable string for logging purposes.
| [in] | serverState | State indicator to convert |
Converts an RFCTYPE data type indicator to a human readable string for logging purposes.
| [in] | type | Data type indicator to convert |
| DECL_EXP const SAP_UC* SAP_API RfcGetVersion | ( | unsigned * | majorVersion, |
| unsigned * | minorVersion, | ||
| unsigned * | patchLevel | ||
| ) |
Get information about currently loaded sapnwrfc library.
Fills the provided unsigneds with the SAP release values, e.g. *majorVersion = 7, *minorVersion = 10, *patchLevel = 42.
| [out] | *majorVersion | |
| [out] | *minorVersion | |
| [out] | *patchLevel |
This function is intended to be used by SAP Make-factory only.
Please DO NOT use it!
Initialization of internal variablesSets up the internal state of the sapnwrfc library and initially reads and evaluates the sapnwrfc.ini file.
In case the content or location of the sapnwrfc.ini file changes later on, reload it via RfcReloadIniFile(). RfcInit() no longer needs to be called explicitly. The RFC library does this automatically on DLL load.
| DECL_EXP RFC_RC SAP_API RfcLanguageIsoToSap | ( | const SAP_UC * | laiso, |
| SAP_UC * | lang, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts a 2-char SAP language code to the 1-char SAP language code.
| [in] | *laiso | Pointer to the 2-char array with SAP LAISO code to convert |
| [out] | *lang | Pointer to the 1 char for SAP SPRAS key |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcLanguageSapToIso | ( | const SAP_UC * | lang, |
| SAP_UC * | laiso, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts a 1-char SAP language key to the 2-char SAP language code.
| [in] | *lang | Pointer to the 1 char with SAP SPRAS key to convert |
| [out] | *laiso | Pointer to the 2-char array for SAP LAISO code |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcReloadIniFile | ( | RFC_ERROR_INFO * | errorInfo | ) |
Loads the contents of the sapnwrfc.ini file into memory.
Searches the directory given by RfcSetIniPath() (or the current working directory) for the file sapnwrfc.ini and loads its contents into memory.
| [out] | *errorInfo | Detail information in case anything goes wrong. Note: if a file with the name sapnwrfc.ini does not exist in the given directory, this is not considered an error! Default settings are used in this case. |
| DECL_EXP RFC_RC SAP_API RfcSAPUCToUTF8 | ( | const SAP_UC * | sapuc, |
| unsigned | sapucLength, | ||
| RFC_BYTE * | utf8, | ||
| unsigned * | utf8Size, | ||
| unsigned * | resultLength, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts data in SAP_UC format to UTF-8 format.
| [in] | *sapuc | Pointer to SAP_UC data to be converted |
| [in] | sapucLength | Number of characters to convert |
| [out] | *utf8 | Pre-allocated output buffer, which will receive the result. Output will be null-terminated. |
| [in,out] | *utf8Size | Needs to be filled with the size of the given output buffer in bytes. If the given buffer turns out to be too small (return code RFC_BUFFER_TOO_SMALL), it will be filled with the required buffer size that would be necessary to convert the given input data. |
| [out] | *resultLength | If the output buffer was large enough, resultLength will be filled with the length of the output string in bytes. |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetCpicTraceLevel | ( | unsigned | traceLevel, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the global CPIC trace level used by the underlying CPIC libabry to write CPIC tracing information to the CPIC trace file cpic_<pid>.trc, where pid is the process ID of the current process.
The CPIC trace file is located in the same directory where the RFC trace files are located.
This function has the same effect as the sapnwrfc.ini parameter CPIC_TRACE_LEVEL. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | traceLevel | Must be a value between 0 to 3, where 0 turns tracing off. |
| [out] | *errorInfo | Detail information in case of an error. |
| DECL_EXP RFC_RC SAP_API RfcSetIniPath | ( | const SAP_UC * | pathName, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the directory in which to search for the sapnwrfc.ini file.
By default the sapnwrfc library searches for the sapnwrfc.ini in the current working directory of the process. If you want to keep it in a different directory, use this function to tell the sapnwrfc library about the new path.
| [in] | *pathName | The full (absolute) path of the directory, in which the sapnwrfc library should look for the sapnwrfc.ini file. A path relative to the current working directory of the process also works. |
| [out] | *errorInfo | Detail information in case anything goes wrong. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceDir | ( | SAP_UC * | traceDir, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the directory where the NW RFC lib should write trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_DIR. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceDir | The new directory. Can be an absolute or relative path name. The directory needs to exist prior to calling this API. The NW RFC lib will not attempt to create non-existing directories. |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceEncoding | ( | SAP_UC * | traceEncoding, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the character encoding to be used in trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_ENCODING. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceEncoding | The new encoding. Possible values are "UTF-16", "UTF-8" and "DEFAULT". On Windows UTF-16 is recommended for faster performance. "DEFAULT" corresponds to the operating system's default character encoding, which is CP1252 or ISO-8859-1 on most Windows systems and UTF-8 on most Linux systems. |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceLevel | ( | RFC_CONNECTION_HANDLE | connection, |
| SAP_UC * | destination, | ||
| unsigned | traceLevel, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Sets the current trace level of the specified RFC connection or destination to the new value.
| [in] | connection | A handle to a currently open RFC connection (client or server connection). The new trace level will be effective immediately. |
| [in] | *destination | Null-terminated string specifying a client or server destination as defined via a DEST=... entry in sapnwrfc.ini. The new trace level will be used for new connections to that destination opened after the RfcSetTraceLevel() call. Already existing connections to that destination will not be effected. |
| [in] | traceLevel | The new trace level. Must be between 0 and 3. The meaning of those four values is as follows:
|
| [out] | *errorInfo | Detail information in case the specified connection or destination does not exist. |
| DECL_EXP RFC_RC SAP_API RfcSetTraceType | ( | SAP_UC * | traceType, |
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Changes the way the NW RFC lib writes trace files.
This function has the same effect as the sapnwrfc.ini parameter RFC_TRACE_TYPE. See the documentation of that parameter in the sample ini file contained in the /demo directory of the NW RFC SDK.
| [in] | *traceType | Must be either "PROCESS" or "THREAD". |
| [out] | *errorInfo | Detail information in case of an invalid traceEncoding input. |
| DECL_EXP RFC_RC SAP_API RfcUTF8ToSAPUC | ( | const RFC_BYTE * | utf8, |
| unsigned | utf8Length, | ||
| SAP_UC * | sapuc, | ||
| unsigned * | sapucSize, | ||
| unsigned * | resultLength, | ||
| RFC_ERROR_INFO * | errorInfo | ||
| ) |
Converts data in UTF-8 format to SAP_UC strings.
| [in] | *utf8 | Pointer to UTF-8 data to be converted |
| [in] | utf8Length | Number of bytes to convert |
| [out] | *sapuc | Pre-allocated output buffer, which will receive the result. Output will be null-terminated. |
| [in,out] | *sapucSize | Needs to be filled with the size of the given output buffer in SAP_UC characters. If the given buffer turns out to be too small (return code RFC_BUFFER_TOO_SMALL), it will be filled with the required buffer size that would be necessary to convert the given input data. |
| [out] | *resultLength | If the output buffer was large enough, resultLength will be filled with the length of the output string in SAP_UC characters. |
| [out] | *errorInfo | Will be filled with additional error information in case of an error. |