Metadata and Repository API
[Public API]


Detailed Description

Functions for creating and looking up metadata descriptions in the R/3 DDIC.

Functions for traversing through metadata descriptions.


Modules

 Metadata for structures/line-types
 Functions for creating, reading and traversing through structure descriptions.
 Metadata for function modules
 Functions for creating, reading and traversing through function module descriptions.
 Metadata for ABAP classes
 Functions for creating, reading and traversing through ABAP class descriptions.

Classes

struct  _RFC_TYPE_DESC_HANDLE
 Handle to a cached metadata description of a structure or table type. More...
struct  _RFC_FUNCTION_DESC_HANDLE
 Handle to a cached metadata description of a function module. More...
struct  _RFC_CLASS_DESC_HANDLE
 Handle to a cached metadata description of a class. More...
struct  _RFC_FIELD_DESC
 Structure for reading (RfcGetFieldDescByIndex() or RfcGetFieldDescByName()) or defining (RfcAddTypeField()) the properties of a field in a structure/table. More...
struct  _RFC_PARAMETER_DESC
 Structure for reading (RfcGetParameterDescByIndex() or RfcGetParameterDescByName()) or defining (RfcAddParameter()) the properties of a parameter in a function module. More...
struct  _RFC_EXCEPTION_DESC
 Structure for reading (RfcGetExceptionDescByIndex() or RfcGetExceptionDescByName()) or defining (RfcAddException()) the properties of an exception key in a function module. More...
struct  _RFC_CLASS_ATTRIBUTE_DESC
 Structure for reading (RfcGetParameterDescByIndex() or RfcGetParameterDescByName()) or defining (RfcAddParameter()) the properties of a parameter in a function module. More...
struct  _RFC_METADATA_QUERY_RESULT_ENTRY
 Structure containing the error occurred during metadata query. More...

Enumerations

enum  _RFC_DIRECTION { RFC_IMPORT = 0x01, RFC_EXPORT = 0x02, RFC_CHANGING = RFC_IMPORT | RFC_EXPORT, RFC_TABLES = 0x04 | RFC_CHANGING }
 Used in RFC_PARAMETER_DESC::direction for specifying the direction of a function module parameter. More...
enum  _RFC_CLASS_ATTRIBUTE_TYPE { RFC_CLASS_ATTRIBUTE_INSTANCE, RFC_CLASS_ATTRIBUTE_CLASS, RFC_CLASS_ATTRIBUTE_CONSTANT }
 Determines the type of an ABAP Object attribute. More...
enum  _RFC_METADATA_OBJ_TYPE { RFC_METADATA_FUNCTION, RFC_METADATA_TYPE, RFC_METADATA_CLASS }
 RFC_METADATA_OBJ_TYPE is either function or type or class and is used in RfcGetMetadataQueryFailedEntry() and RfcGetMetadataQuerySucceededEntry(). More...

Functions

DECL_EXP
RFC_FUNCTION_DESC_HANDLE
SAP_API 
RfcGetFunctionDesc (RFC_CONNECTION_HANDLE rfcHandle, SAP_UC const *funcName, RFC_ERROR_INFO *errorInfo)
 Returns the function description that is valid for the system to which rfcHandle points to.
DECL_EXP
RFC_FUNCTION_DESC_HANDLE
SAP_API 
RfcGetCachedFunctionDesc (SAP_UC const *repositoryID, SAP_UC const *funcName, RFC_ERROR_INFO *errorInfo)
 Looks for a cached function description.
DECL_EXP RFC_RC SAP_API RfcAddFunctionDesc (SAP_UC const *repositoryID, RFC_FUNCTION_DESC_HANDLE funcDesc, RFC_ERROR_INFO *errorInfo)
 Adds a function description to the cache for the specified R/3 System.
DECL_EXP RFC_RC SAP_API RfcRemoveFunctionDesc (SAP_UC const *repositoryID, SAP_UC const *functionName, RFC_ERROR_INFO *errorInfo)
 Removes a function description from the cache for the specified R/3 System.
DECL_EXP RFC_TYPE_DESC_HANDLE
SAP_API 
RfcGetTypeDesc (RFC_CONNECTION_HANDLE rfcHandle, SAP_UC const *typeName, RFC_ERROR_INFO *errorInfo)
 Returns the structure description that is valid for the system to which rfcHandle points to.
DECL_EXP RFC_TYPE_DESC_HANDLE
SAP_API 
RfcGetCachedTypeDesc (SAP_UC const *repositoryID, SAP_UC const *typeName, RFC_ERROR_INFO *errorInfo)
 Looks for a cached structure/table description.
DECL_EXP RFC_RC SAP_API RfcAddTypeDesc (SAP_UC const *repositoryID, RFC_TYPE_DESC_HANDLE typeHandle, RFC_ERROR_INFO *errorInfo)
 Adds a type description to the cache.
DECL_EXP RFC_RC SAP_API RfcRemoveTypeDesc (SAP_UC const *repositoryID, SAP_UC const *typeName, RFC_ERROR_INFO *errorInfo)
 Removes a type description from the cache.
DECL_EXP RFC_CLASS_DESC_HANDLE
SAP_API 
RfcGetClassDesc (RFC_CONNECTION_HANDLE rfcHandle, SAP_UC const *className, RFC_ERROR_INFO *errorInfo)
 Returns the class description that is valid for the system to which rfcHandle points to.
DECL_EXP RFC_CLASS_DESC_HANDLE
SAP_API 
RfcGetCachedClassDesc (SAP_UC const *repositoryID, SAP_UC const *className, RFC_ERROR_INFO *errorInfo)
 Looks for a cached class description.
DECL_EXP RFC_RC SAP_API RfcAddClassDesc (SAP_UC const *repositoryID, RFC_CLASS_DESC_HANDLE classDesc, RFC_ERROR_INFO *errorInfo)
 Adds a class description to the cache for the specified R/3 System.
DECL_EXP RFC_RC SAP_API RfcRemoveClassDesc (SAP_UC const *repositoryID, SAP_UC const *className, RFC_ERROR_INFO *errorInfo)
 Removes a class description from the cache for the specified R/3 System.
DECL_EXP
RFC_METADATA_QUERY_RESULT_HANDLE
SAP_API 
RfcCreateMetadataQueryResult (RFC_ERROR_INFO *errorInfo)
 Creates the metadata query result

Metadata query result contains the names of functions, types and classes queried successfully, or errors, if the query failed.

DECL_EXP RFC_RC SAP_API RfcDestroyMetadataQueryResult (RFC_METADATA_QUERY_RESULT_HANDLE handle, RFC_ERROR_INFO *errorInfo)
 Destroys the metadata query result

Releases all resources allocated by the metadata query result.

DECL_EXP RFC_RC SAP_API RfcDescribeMetadataQueryResult (RFC_METADATA_QUERY_RESULT_HANDLE handle, RFC_METADATA_OBJ_TYPE type, unsigned *successful, unsigned *failed, RFC_ERROR_INFO *errorInfo)
 Describes the metadata query result

Returns the number of succeeded and failed entries in the metadata query result.

DECL_EXP RFC_RC SAP_API RfcGetMetadataQueryFailedEntry (RFC_METADATA_QUERY_RESULT_HANDLE handle, RFC_METADATA_OBJ_TYPE type, unsigned index, RFC_METADATA_QUERY_RESULT_ENTRY *entry, RFC_ERROR_INFO *errorInfo)
 Returns the error entry from the metadata query result

Returns the object name and the error text, if an error occurred during the query.

DECL_EXP RFC_RC SAP_API RfcGetMetadataQuerySucceededEntry (RFC_METADATA_QUERY_RESULT_HANDLE handle, RFC_METADATA_OBJ_TYPE type, unsigned index, RFC_ABAP_NAME succeedObj, RFC_ERROR_INFO *errorInfo)
 Returns a succeeded entry from the metadata query result

Returns the object name queried successfully.

DECL_EXP RFC_RC SAP_API RfcMetadataBatchQuery (RFC_CONNECTION_HANDLE rfcHandle, const SAP_UC **functionNames, unsigned functionCount, const SAP_UC **typeNames, unsigned typeCount, const SAP_UC **classNames, unsigned classCount, RFC_METADATA_QUERY_RESULT_HANDLE handle, RFC_ERROR_INFO *errorInfo)
 Queries the meta data for function, type and class lists.


Enumeration Type Documentation

Determines the type of an ABAP Object attribute.

Enumerator:
RFC_CLASS_ATTRIBUTE_INSTANCE  Instance attribute (object member).
RFC_CLASS_ATTRIBUTE_CLASS  Class attribute (global).
RFC_CLASS_ATTRIBUTE_CONSTANT  A constant.

Definition at line 513 of file sapnwrfc.h.

Used in RFC_PARAMETER_DESC::direction for specifying the direction of a function module parameter.

Enumerator:
RFC_IMPORT  Import parameter. This corresponds to ABAP IMPORTING parameter.
RFC_EXPORT  Export parameter. This corresponds to ABAP EXPORTING parameter.
RFC_CHANGING  Import and export parameter. This corresponds to ABAP CHANGING parameter.
RFC_TABLES  Table parameter. This corresponds to ABAP TABLES parameter.

Definition at line 466 of file sapnwrfc.h.

RFC_METADATA_OBJ_TYPE is either function or type or class and is used in RfcGetMetadataQueryFailedEntry() and RfcGetMetadataQuerySucceededEntry().

Enumerator:
RFC_METADATA_FUNCTION 
RFC_METADATA_TYPE 
RFC_METADATA_CLASS 

Definition at line 4236 of file sapnwrfc.h.


Function Documentation

DECL_EXP RFC_RC SAP_API RfcAddClassDesc ( SAP_UC const *  repositoryID,
RFC_CLASS_DESC_HANDLE  classDesc,
RFC_ERROR_INFO errorInfo 
)

Adds a class description to the cache for the specified R/3 System.

This API should be used with care and is only for special scenarios, e.g. if you want to write an RFC server that offers/uses classes, which do not exist in the R/3 system's DDIC. If repositoryID is NULL, the description is added to the "default repository".

Parameters:
[in] *repositoryID System ID of R/3 System, to whose cache you want to add the class description, or NULL for the default repository.
[in] classDesc The class description.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcAddFunctionDesc ( SAP_UC const *  repositoryID,
RFC_FUNCTION_DESC_HANDLE  funcDesc,
RFC_ERROR_INFO errorInfo 
)

Adds a function description to the cache for the specified R/3 System.

This API should be used with care and is only for special scenarios, e.g. if you want to write an RFC server that offers function modules, which do not exist in the R/3 system's DDIC. If repositoryID is NULL, the description is added to the "default repository".

Parameters:
[in] *repositoryID System ID of R/3 System, to whose cache you want to add the function description, or NULL for the default repository.
[in] funcDesc The function description.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcAddTypeDesc ( SAP_UC const *  repositoryID,
RFC_TYPE_DESC_HANDLE  typeHandle,
RFC_ERROR_INFO errorInfo 
)

Adds a type description to the cache.

Parameters:
[in] *repositoryID System ID of R/3 System, to whose cache you want to add the type description, or NULL for the default repository.
[in] typeHandle The type description.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC

DECL_EXP RFC_METADATA_QUERY_RESULT_HANDLE SAP_API RfcCreateMetadataQueryResult ( RFC_ERROR_INFO errorInfo  ) 

Creates the metadata query result

Metadata query result contains the names of functions, types and classes queried successfully, or errors, if the query failed.

Parameters:
[out] *errorInfo More details in error case
Returns:
Handle to a metadata query result

DECL_EXP RFC_RC SAP_API RfcDescribeMetadataQueryResult ( RFC_METADATA_QUERY_RESULT_HANDLE  handle,
RFC_METADATA_OBJ_TYPE  type,
unsigned *  successful,
unsigned *  failed,
RFC_ERROR_INFO errorInfo 
)

Describes the metadata query result

Returns the number of succeeded and failed entries in the metadata query result.

The entries' content can be read with RfcGetMetadataQueryFailedEntry() and RfcGetMetadataQuerySucceededEntry().

Parameters:
[in] handle Handle to a metadata query result
[in] type Type of the requested object
[out] *successful Number of metadata objects queried successfully
[out] *failed Number of metadata objects that could not be queried
[out] *errorInfo More details in error case
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcDestroyMetadataQueryResult ( RFC_METADATA_QUERY_RESULT_HANDLE  handle,
RFC_ERROR_INFO errorInfo 
)

Destroys the metadata query result

Releases all resources allocated by the metadata query result.

Parameters:
[in] handle Handle to a metadata query result
[out] *errorInfo More details in error case
Returns:
RFC_RC

DECL_EXP RFC_CLASS_DESC_HANDLE SAP_API RfcGetCachedClassDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  className,
RFC_ERROR_INFO errorInfo 
)

Looks for a cached class description.

This API should be used with care and is only for special scenarios, for example: 1. You know for sure, that a class description has already been cached via RfcGetClassDesc(), and don't want to open an extra rfcHandle that will never be used. In this case simply use the SAP System ID as the repositoryID. 2. You have created a hard-coded repository via RfcAddClassDesc(), which contains classes that do not exist in the backend's DDIC.

If repositoryID is NULL, the "default repository" is used.

Parameters:
[in] *repositoryID System ID of R/3 System, for which this class description has been cached, or NULL in case you want to look for it in the default repository.
[in] *className Name of the class.
[out] *errorInfo Requested class name not in cache?
Returns:
The requested class description.

DECL_EXP RFC_FUNCTION_DESC_HANDLE SAP_API RfcGetCachedFunctionDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  funcName,
RFC_ERROR_INFO errorInfo 
)

Looks for a cached function description.

This API should be used with care and is only for special scenarios, for example: 1. You know for sure, that a function description has already been cached via RfcGetFunctionDesc(), and don't want to open an extra rfcHandle that will never be used. In this case simply use the SAP System ID as the repositoryID. 2. You have created a hard-coded repository via RfcAddFunctionDesc(), which contains function modules that do not exist in the backend's DDIC.

If repositoryID is NULL, the "default repository" is used.

Parameters:
[in] *repositoryID System ID of R/3 System, for which this function module description has been cached, or NULL in case you want to look for it in the default repository.
[in] *funcName Name of the function module.
[out] *errorInfo Requested function name not in cache?
Returns:
The requested function description.

DECL_EXP RFC_TYPE_DESC_HANDLE SAP_API RfcGetCachedTypeDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  typeName,
RFC_ERROR_INFO errorInfo 
)

Looks for a cached structure/table description.

Similar to RfcGetTypeDesc(), but it only looks into the cache. Again it should almost never be necessary to get a metadata description of a single structure.

Parameters:
[in] *repositoryID System ID of R/3 System, for which this type description has been cached, or NULL in case you want to look for it in the default repository.
[in] *typeName Name of the DDIC structure/table.
[out] *errorInfo Requested type name not in cache?
Returns:
The requested type description.

DECL_EXP RFC_CLASS_DESC_HANDLE SAP_API RfcGetClassDesc ( RFC_CONNECTION_HANDLE  rfcHandle,
SAP_UC const *  className,
RFC_ERROR_INFO errorInfo 
)

Returns the class description that is valid for the system to which rfcHandle points to.

If the class description is already in the repository cache for that system ID, it will be returned immediately (from the cache), otherwise it will be looked up in the system's DDIC using the rfcHandle. The result from the DDIC lookup will then be placed into the cache for later use.

The RFC Runtime maintains a cache for every R/3 System ID, as the meta data could be different from R/3 release to R/3 release. This is the main API that should be used.

Parameters:
[in] rfcHandle Open client connection to the R/3 System, for which you need the class description.
[in] *className Name of the class to look up.
[out] *errorInfo More error details in case something goes wrong.
Returns:
The metadata description of the given function module.

DECL_EXP RFC_FUNCTION_DESC_HANDLE SAP_API RfcGetFunctionDesc ( RFC_CONNECTION_HANDLE  rfcHandle,
SAP_UC const *  funcName,
RFC_ERROR_INFO errorInfo 
)

Returns the function description that is valid for the system to which rfcHandle points to.

If the function description is already in the repository cache for that system ID, it will be returned immediately (from the cache), otherwise it will be looked up in the system's DDIC using the rfcHandle. The result from the DDIC lookup will then be placed into the cache for later use.

The RFC Runtime maintains a cache for every R/3 System ID, as the meta data could be different from R/3 release to R/3 release. This is the main API that should be used.

Parameters:
[in] rfcHandle Open client connection to the R/3 System, for which you need the function module description.
[in] *funcName Name of the function module to look up.
[out] *errorInfo More error details in case something goes wrong.
Returns:
The metadata description of the given function module.

DECL_EXP RFC_RC SAP_API RfcGetMetadataQueryFailedEntry ( RFC_METADATA_QUERY_RESULT_HANDLE  handle,
RFC_METADATA_OBJ_TYPE  type,
unsigned  index,
RFC_METADATA_QUERY_RESULT_ENTRY entry,
RFC_ERROR_INFO errorInfo 
)

Returns the error entry from the metadata query result

Returns the object name and the error text, if an error occurred during the query.

Parameters:
[in] handle Handle to a metadata query result
[in] type Type of the requested object
[in] index Index of the requested object
[in,out] *entry Pointer to the allocated structure to store the name of the metadata object and the error text
[out] *errorInfo More details in error case
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcGetMetadataQuerySucceededEntry ( RFC_METADATA_QUERY_RESULT_HANDLE  handle,
RFC_METADATA_OBJ_TYPE  type,
unsigned  index,
RFC_ABAP_NAME  succeedObj,
RFC_ERROR_INFO errorInfo 
)

Returns a succeeded entry from the metadata query result

Returns the object name queried successfully.

Parameters:
[in] handle Handle to a metadata query result
[in] type Type of the requested object
[in] index Index of the requested object
[in,out] *succeedObj Pointer to the allocated buffer to store the name of the metadata object
[out] *errorInfo More details in error case
Returns:
RFC_RC

DECL_EXP RFC_TYPE_DESC_HANDLE SAP_API RfcGetTypeDesc ( RFC_CONNECTION_HANDLE  rfcHandle,
SAP_UC const *  typeName,
RFC_ERROR_INFO errorInfo 
)

Returns the structure description that is valid for the system to which rfcHandle points to.

If the structure description is already in the repository cache for that system ID, it will be returned immediately (from the cache), otherwise it will be looked up in the system's DDIC using the rfcHandle. The result from the DDIC lookup will then be placed into the cache for later use.

The RFC Runtime maintains a cache for every R/3 System ID, as the meta data could be different from R/3 release to R/3 release.

Note:
Normally it should not be necessary to lookup separate structure descriptions. They are already looked up as part of the function module, in which they are used.
Parameters:
[in] rfcHandle Open client connection to the R/3 System, for which you need the structure description.
[in] *typeName Name of a DDIC structure or table.
[out] *errorInfo More error details in case something goes wrong.
Returns:
The metadata description of the given structure/table.

DECL_EXP RFC_RC SAP_API RfcMetadataBatchQuery ( RFC_CONNECTION_HANDLE  rfcHandle,
const SAP_UC **  functionNames,
unsigned  functionCount,
const SAP_UC **  typeNames,
unsigned  typeCount,
const SAP_UC **  classNames,
unsigned  classCount,
RFC_METADATA_QUERY_RESULT_HANDLE  handle,
RFC_ERROR_INFO errorInfo 
)

Queries the meta data for function, type and class lists.

Queries the meta data for function, type and class lists. All meta data is fetched using one roundtrip, the result is cached in the repository cache.

Parameters:
[in] rfcHandle Open client connection to the R/3 System, for which you need the function module, type or class descriptions.
[in] *functionNames Names of the function modules to look up.
[in] functionCount Length of the function name list
[in] *typeNames Names of the types to look up.
[in] typeCount Length of the type name list
[in] *classNames Names of the classes to look up.
[in] classCount Length of the class name list
[in] handle Query result, may be null.
[out] *errorInfo More error details in case something goes wrong.
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcRemoveClassDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  className,
RFC_ERROR_INFO errorInfo 
)

Removes a class description from the cache for the specified R/3 System.

If repositoryID is NULL, the description is added to the "default repository".

Parameters:
[in] *repositoryID System ID of R/3 System, from whose cache you want to remove the class description, or NULL for the default repository.
[in] *className The name of the ABAP class, whose description you want to remove.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcRemoveFunctionDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  functionName,
RFC_ERROR_INFO errorInfo 
)

Removes a function description from the cache for the specified R/3 System.

This API can be used, e.g. if the signature (imports, exports, etc.) of a function module has been changed in the backend, while the external RFC program is still running. If the RFC library continues using the old cached metadata description, garbage values (if fields have been deleted from the function module) or missing values (if new fields have been added to the function module) will result. If repositoryID is NULL, the description is removed from the "default repository".

Parameters:
[in] *repositoryID System ID of R/3 System, to whose cache you want to add the function description, or NULL for the default repository.
[in] *functionName The name of the function module, whose description is to be removed from the cache.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC

DECL_EXP RFC_RC SAP_API RfcRemoveTypeDesc ( SAP_UC const *  repositoryID,
SAP_UC const *  typeName,
RFC_ERROR_INFO errorInfo 
)

Removes a type description from the cache.

Parameters:
[in] *repositoryID System ID of R/3 System, from whose cache you want to remove the type description, or NULL for the default repository.
[in] *typeName The name of the type, whose description is to be removed from the cache.
[out] *errorInfo Not much that can go wrong here.
Returns:
RFC_RC


Generated on Tue Feb 22 13:18:17 2011 for SAP by  doxygen 1.5.5