SAP Function SDOK_RELA_CREATE - Create relationship

Parameter Reference Type Length Default Optional Text
CLIENT SYST-MANDT C 3 SY-MANDT X Client
FROM_OBJECT SDOKOBJECT u 42 BOR Key of Initial Object
RELATION_CLASS SDOKRECL-RE_CLASS C 10 Object Class
RELATION_UNIQUE_ID SDOKRE-REIO_ID C 32 X Unique Object Identification
TO_OBJECT SDOKOBJECT u 42 BOR Key of Target Object
X_SUPPRESS_PARTNER_CHECK SYST-DATAR C 1 X (Only for Internal Use)

Parameter Reference Type Length Text
OBJECT_ID SDOKOBJECT u 42 BOR Key for the Object

Parameter Reference Length Optional Text
PROPERTIES SDOKPROPTY 89 X Name and Value of Attributes

Exception Text
BAD_CLASS Relationship Class Not Recognized
BAD_PROPERTIES Attributes Not Specified Correctly
DUPLICATE_RELATION_ID Relationship Already Exists
EXCEPTION_IN_EXIT Exception in Application Exit
FROM_OBJECT_NOT_EXISTING Initial Object Does Not Exist
MISSING_CLASS Relationship Class Not Specified
MISSING_PROPERTIES Required Attributes Not Specified
NOT_AUTHORIZED No Authorization
TO_OBJECT_NOT_EXISTING Target Object Exists
UNIQUE_AND_EXISTING Object is Unique and Already Exists

Functionality
This function module creates a relationship based on a specificrelationship class.
Specify the relationship class of the new relationship when calling thefunction module. You have the option to manually specify therelationship ID as a DCE-compatible GUID. Otherwise, KPro sets therelationship ID automatically.
You can specify attributes for the new relationship. If therelationship class contains mandatory attributes, the relationship canonly be created once all mandatory attributes have been specified onthe interface, or have been inherited from attributes of therelationship class. Another prerequisite for creating the relationshipis that you have to specify the current combination of relationshipclass, source document, and target document as a possible combination.Use the class maintenance function to do this.

  • The specification of a relationship class is optional because it is not
  • possible to set a meaningful default class. However, if you call thefunction without having specified any relationship class, an exceptionoccurs.
    • The ID of a document or a relationship has no semantic content, and is
    • usually specified by KPro. It only makes sense for the application tospecify the ID if the ID in question is already in use by theapplication. In this case, the ID must be DCE-compatible, and it mustbe transferred as a 32-character hex character string. This isnecessary in order to avoid the possibility of duplicating an IDalready in use.
      • Attributes generated by KPro are not available as export parameters in
      • the table PROPERTIES. If you want to view these attributes, you have touse SDOK_RELA_PROPERTIES_GET.