Creating an Instance with the Current Object Key

The standard creation methods are used to create object instances with a key that has the current version.

Context

You want to instantiate an object using a key that adheres to the key version.

Procedure

Use one of the following macros in your application code:
  • You can include either <CNTN01> or <CNTN02> and <CNTN03> or <CNTN01_SWC>

  • Or simply use the SWC0 macros from the SWC0 type group.

<CNTN01>, <CNTN02> + <CNTN03>

<CNTN01_SWC>

swc_create_object

swc0_create_object

swc_create_object_from_key

swc0_create_object_from_key

swc_create_remote_object

swc0_create_remote_object

swc_create_remote_dialg_object

swc0_create_remote_dialg_obj

swc_create_remote_obj_from_key

swc0_create_rem_obj_from_key

Results

The Business Object Repository (BOR) will replace the last 4 digits with the current version number in the calling system unless it is initial. The last four positions are not changed if no versioning is defined for the object type. The resulting key is used to instantiate the object. If the creation process fails, SY-SUBRC is set to 1. Otherwise the value is 0.