SAP Function SDOK_PHIO_CREATE_WITH_MODEL - Create a Physical Document with Reference to a Template

Parameter Reference Type Length Default Optional Text
CLIENT SYST-MANDT C 3 SY-MANDT X Client
MODEL_OBJECT_ID SDOKOBJECT u 42 BOR Key of Template Object
OBJECT_CLASS SDOKPHCL-PH_CLASS C 10 X Class of New Object
OBJECT_UNIQUE_ID SDOKPHIO-PHIO_ID C 32 X Unique Identifier of New Object
X_ENQUEUE SYST-DATAR C 1 X Flag for Locking New Document
X_IGNORE_MODEL_PROPERTIES SYST-DATAR C 1 X X-Flag: Template Attributes Not Copied
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 of New Object

Parameter Reference Length Optional Text
FROM_RELATIONS SDOKRELIST 84 X Incoming Relationships with Partner Object
PROPERTIES_TO_CHANGE SDOKPROPTY 89 X Attributes To Be Changed
PROPERTIES_TO_DELETE SDOKPROPTD 90 X Attributes To Be Deleted
TO_RELATIONS SDOKRELIST 84 X Outgoing Relationships with Partner Object

Exception Text
BAD_CLASS Object Class Unknown
BAD_PROPERTIES Attributes Not Specified Correctly
BAD_RELATIONS Relationships Not Specified Correctly
DUPLICATE_OBJECT_ID Object already exists
ENQUEUE_FAILURE Locking Error
EXCEPTION_IN_EXIT Exception in Application Exit
MISSING_PROPERTIES Required Attributes Not Specified
MODEL_NOT_EXISTING Template Object Does Not Exist
NOT_AUTHORIZED No Authorization

Functionality
This function module creates a new physical document using an existingdocument as a template. This has the effect that when the document ischecked out or when a copy of the document is copied to the front-endcomputer, the content of the document used as a template is copied tothe front-end computer.
The document class can be different from the document class of thetemplate document. If no other document class is specified, thedocument class of the template document is used. You have the option tospecify a DCE-compatible GUID. Otherwise, KPro automatically assignsthe document ID.
By default, the new document takes on the attributes of the templatedocument. However, you can use the optional flagX_IGNORE_MODEL_PROPERTIES to reject all the template documentattributes. You can also use the optional table PROPERTIES_TO_DELETE toreject individual attributes of the template document. The optionaltable PROPERTIES_TO_CHANGE is used to modify or create single-valueattributes and to create multiple-value attributes. If the documentclass contains mandatory attributes, the document can be created onlywhen all mandatory attributes are specified, or have been inheritedfrom the document class attributes.
It is also possible to create relationships from and to otherdocuments. In particular, the relationship with the associated logicaldocument should be set at this point. The GUID of a relationship canalso be pre-set to be DCE-compatible. If the relevant structure fieldis not filled when the function module is created, KPro assigns theGUID. The GUID is then returned. If a relationship cannot be createdfor some reason (see SDOK_RELA_CREATE), the exception BAD_RELATIONoccurs.
After SDOK_PHIO_CREATE_WITH_MODEL has executed successfully, the newdocument version has the status "initial". As long as the document hasthis status, the content of the original is copied to the front-endcomputer when the new version is checked out or downloaded to the filesystem of the front-end computer.