Enterprise Administration > Implementing Windchill ESI > Implementing Windchill ESI in an SAP Environment > SAP API Structures > Create Document > BAPI_DOCUMENT_CHANGE2
  
BAPI_DOCUMENT_CHANGE2
This API is used to create and delete the links between documents and parts in SAP. The API needs to be called for each document to be changed.
Windchill Attribute Name
API Structure
API Field
API Field Description
Value If Default
Source
Transform
Number
HEADER
DOCUMENTNUMBER
Document number
N/A
Windchill
N/A
N/A
HEADER
DOCUMENTPART
Document part
“000”
Default
N/A
Type
HEADER
DOCUMENTTYPE
Document type
N/A
Windchill
N/A
Version
DOCUMENTHEADER
VERSION
Document version
N/A
Windchill
N/A
N/A
DOCUMENTDATAX
ECNUMBER
Change Number
X
Default
N/A
Number
DOCUMENTDATA
DOCUMENTNUMBER
Document number
N/A
N/A
N/A
N/A
DOCUMENTDATA
DOCUMENTPART
Document part
N/A
Default
N/A
Version
DOCUMENTDATA
DOCUMENVERSION
Document version
N/A
Windchill
N/A
Type
DOCUMENTDATA
DOCUMENTTYPE
Document type
N/A
Windchill
Cross Reference
Change Number
DOCUMENTDATA
ECNUMBER1
Change number
N/A
Windchill
N/A
N/A
OBJECTLINKS
OBJECTTYPE #1
Object Type
MARC
default
N/A
N/A
OBJECTLINKS
OBJECTTYPE #2
Object Type2
MARA
default
N/A
N/A
OBJECTLINKS
DOCUMENT DIRECTION
Document Direction
X
Default
N/A
N/A
OBJECTLINKS
DELETEVALUE
Delete Value
X
Default
N/A
Number (Material) and Plant
OBJECTLINKS
OBJECTKEY#1
Object Key #1
Material + Plant
N/A
Concatenate
Number (Material)
OBJECTLINKS
OBJECTKEY#2
Object Key #2
Material
N/A
N/A
1. This API field is only sent into the API if the global variable ESIFlags/EnableDocumentECNLockis set to true. See Process Engine Global Variables Groups in the Other PTC Manual referenced by my book for details.
2. Two line items are required in this structure to create a reference to a plant and to link the document to the material. One line should have object type = MARC and the Object Key = Material + Plant. Then second line should have Object Type = MARA and the Object Key = Material The API Field Object Type #1 corresponds to the API Field Object Key 1. The structure is repeated for relating The API Field Object Type #2 corresponds to the API Field Object Key #1.