Unternehmensverwaltung > Windchill ESI implementieren > Implementing Windchill ESI in an SAP Environment > Windchill ESI Assumptions > Creating and Changing Parts (Objects) > Creating or Changing Documents
  
Creating or Changing Documents
The following lists assumptions related to creating and changing documents:
The document is defined inWindchill PDMLink and is either standalone, or is related to aWindchill PDMLink part, the associated ERPMaterial object, a Windchill MPMLinkMPMLink operation or a resource.
A related or associated document must be published during the creation or change of a material master, BOM, Process Material, Tooling of type Tool, or a Routing Operation. This This however is done provided the relevant distribution target attribute is set in Windchill PDMLink.
No plant association is required for documents in the SAP distribution target.
If the global variable ESIFlags/EnableDocumentLinksToMARA is set to true, the document link is visible, through the GUI, in all the plants that the object exists in but is only used by the plant specified for certain business purposes. If the global variable ESIFlags/EnableDocumentLinksToMARA is set to false, the document links will not be visible through the material GUI. However, the document is used by the material in the plant specified for certain business purposes.
For related documents, only documents having the References and Described by relationships inWindchill PDMLink are created or changed in SAP.
All information required to create or change a document exists in the document in Windchill PDMLink.
All document information necessary to add or delete an object link in SAP is sent from Windchill PDMLink.
The API is characterized to handle originals that are URLs.
The URL for the Original does not exceed 255 characters. To be extended in SAP would require modifying the data element as well as making screen modifications in SAP.
Documents have one Original (URL) and multiple Object links (links to parts) associated to them.
WTDocuments are not linked to other documents.
Version information always accompanies every change.
New versions of documents fromWindchill PDMLink are always accompanied with changes to one or more attributes.
Documents in SAP do not support multiple object links (links to parts) to the same object.
Both the document and the part exist in the SAP when an object link between a document and part in the SAP is created.
BAPI_DOCUMENT_CHANGE2 API is used to change a document.
Object Links are added or deleted using BAPI_DOCUMENT_CHANGE2. Document originals are added using BAPI_DOCUMENT_CREATE2 or BAPI_DOCUMENT_CHANGE2 and are not deleted.
To change an object link, the existing object link is first deleted before the new object link is added.
Object links from both the References and Described-by relationships inWindchill PDMLink are created and deleted for documents that already exist.
One Original (URL that points to the Document Properties page in Windchill PDMLink) is sent with each Change Document release, whether that document was changed via the References or Described-By relationships in Windchill PDMLink. In SAP, the new URL is reflected in the new version. To create an object link between a document and part in SAP, both the document and the part must exist in SAP.
Windchill PDMLink always sends the previous version and new version upon change and documents always contain version information.
For related CAD documents in Windchill PDMLink (both described by and built by relationships) are supported. All attributes and class information from Windchill PDMLink for CAD documents are identical to those for WTDocuments and WTDocumentMasters. All APIs used to create and change documents in the SAP distribution target are sufficient to create and change CAD Documents. It is valid to have a WTDocument and an EPMDocument with the same name. SAP allows documents with different types to have the same name.
A CAD document may be linked to other CAD documents via a usage or a references association. A structure such as this is processed by ESI services provided it was released as a standalone object, or in association with a Change Notice or a promotion request. However, only the documents in the structure (but not their interrelationships) are published to SAP.
When publishing a part (or a manufacturing object) having a related CAD document structure, only the top-level document in the structure is processed by ESI services and published to SAP. In other words, documents that are linked to the top-level document (if any) are ignored.
If a part is associated with a document that has been previously published in CN-centric mode then the document must be revised before the part can be published.