SAP API descriptions and characterization
The SAP APIs used by Windchill ESI were selected after an exhaustive analysis of business requirements and available SAP functionality (see list below). The use and characterization of these APIs are critical Windchill ESI implementation assumptions. Any updates to APIs require re-characterization , that is, re-testing to ensure that the appropriate values are entered for each field. Some examples of customizations to APIs include, but are not limited to:
a. Increase (or modify) data passed to the out-of-the-box APIs
b. Utilizing a different API than the out-of-the-box APIs
c. Modify API in ERP
d. Stringing APIs together to perform a particular function
Examples of increasing the amount of data passed to an out-of-the-box API can be seen in the Examples - Windchill to SAP section of this document.
Windchill ESI utilizes the following SAP APIs (grouped by Windchill ESI function): Create/Change Part
API
Description
BAPI_MATERIAL_SAVEREPLICA
This API is used to create/change all material data in SAP. The API needs to be called for each material to be created in each plant. The API allows creating or updating materials in a batch. The batch size is configurable.
CALO_INIT_API
This API initializes the API environment and is invoked before the CCAP_REV_LEVEL_MAINTAIN API is called to create/update a part revision level. It is not necessary to pass any data into this function module. The defaults used by the API for performing the initialization meet the Windchill ESI requirements.
* 
It is not necessary to pass data to this API from default tables.
CCAP_REV_LEVEL_MAINTAIN
This API creates a new revision level for the material created with BAPI_MATERIAL_SAVEREPLICA. The revision level creation is tracked with a change number defined from Windchill. The change master record for the change number must exist in SAP prior to running this API.
BAPI_TRANSACTION_COMMIT
This API is used to commit a transaction to the SAP system. If the return message generated from the BAPI_MATERIAL_SAVEREPLICA execution is a success then this API is executed. Upon execution of the commit API all part data sent from Windchill is committed to the MARA (and MARC if plant data was sent) SAP database tables.
BAPI_TRANSACTION_ROLLBACK
This API is used to rollback a transaction to the SAP system. If the return message generated from the BAPI_MATERIAL_SAVEREPLICA execution is not a success then this API is executed. Upon execution of the rollback API all part data sent from Windchill is rolled back and not committed to the MARA (and MARC if plant data was sent) SAP database tables.
Create Part API Flow
Create Part API Flow
Create BOM
API
Description
BAPI_MATERIAL_BOM_GROUP_CREATE
This API is invoked to create BOMs in SAP. This API can be called to create BOMs in multiple organizations and it can create Multiple alternates and usages of a BOM in one go. However with current configuration we invoke this API for each combination of plant, alternate and usage.
Create BOM API Flow
Change BOM
API
Description
CSAP_MAT_BOM_MAINTAIN
This API is invoked to change BOMs in SAP. This API cannot be called for multiple BOMs in multiple organizations.
CALO_INIT_API
It is necessary to call this API before CSAP_MAT_BOM_MAINTAIN is called to change a BOM component. It is not necessary to pass any data into this API. The defaults used by the API for performing the initialization meet the Windchill ESI requirements.
* 
It is NOT necessary to pass data to this API from default tables.
Change BOM API Flow
Create Document Info Record
API
Description
BAPI_DOCUMENT_CREATE2
This API is used to create all document data in SAP. The API needs to be called for each document to be created. The API does not require plant information.
BAPI_DOCUMENT_CHANGE2
This API is used to create and delete the links between documents and parts in SAP. This API does not require plant information.
BAPI_TRANSACTION_COMMIT
This API is used to commit a transaction to the SAP system. This API is called if the return message generated from the BAPI_DOCUMENT_CREATE2 execution is a success and also if the return message generated from the BAPI_DOCUMENT_CHANGE2 execution is a success. Upon execution of the commit API all document data sent from Windchill is committed to the DRAW, DRAK and DRAT SAP database tables.
BAPI_TRANSACTION_ROLLBACK
This API is used to rollback a transaction to the SAP system This API is called if the return message generated from the BAPI_DOCUMENT_CREATE2 execution is not a success or if the return message generated from the BAPI_DOCUMENT_CHANGE2 execution is not a success. Upon execution of the rollback API all document data sent from Windchill is rolled back and not committed to the DRAW, DRAK, and DRAT SAP database tables.
Create Document Info Record API Flow
Change Document Info Record
API
Description
BAPI_DOCUMENT_CHANGE2
This API is used to change all document data in SAP. The API needs to be called for each document to be changed. The API does not require plant information. The API also creates and deletes the links between documents and other objects in SAP.
BAPI_DOCUMENT_CREATENEWV RS2
This API is necessary to create a new document version.
BAPI_TRANSACTION_COMMIT
This API is used to commit a transaction to the SAP system. This API is called if the return message generated from the BAPI_DOCUMENT_CREATENEW VRS2 execution is a success and also if the return message generated from the BAPI_DOCUMENT_CHANGE2 execution is a success. Upon execution of the commit API all document data sent from Windchill is committed to the DRAW, DRAK and DRAT SAP database tables.
BAPI_TRANSACTION_ROLLBACK
This API is used to rollback a transaction to the SAP system This API is called if the return message generated from the BAPI_DOCUMENT_CREATENEW VRS2 execution is not a success or if the return message generated from the BAPI_DOCUMENT_CHANGE2 execution is not a success. Upon execution of the rollback API all document data sent from Windchill is rolled back and not committed to the DRAW, DRAK, and DRAT SAP database tables.
Change Document Info Record API Flow
Create CN
API
Description
CALO_INIT_API
This API is invoked before the CCAP_ECN_CREATE and CCAP_ECN_MAINTAIN APIs are called to create a CN or update its effectivity dates. It is not necessary to pass any data into this function module. The defaults used by the API for performing the initialization meet the Windchill ESI requirements.
* 
It is not necessary to pass data to this API from default tables.
CCAP_ECN_CREATE
This API is used to create a CN. The API is characterized to create a CN that is valid for the create or change functions of Documents, BOMs and Materials. It is also characterized to list Material Objects on the CN with Alternate Effective Dates set to the current date. The Header is initially set to a future Effective Date and the CN status is set to Active.
* 
BOMs and Documents are not listed on the CN as part of the CN create process. They are listed on the CN automatically when they are created or changed with the CN. The process then goes to update the CN (by calling CCAP_ECN_MAINTAIN) and assign the correct effectivity dates.
CCAP_ECN_MAINTAIN
This API is used to change a CN. This API is called after the CN is created and used for the creations or change functions of BOMs or Documents. The API is used to Create Alternate Dates and to assign those Alternate Dates to Document and BOMs objects that are listed on the CN. Additionally, this API is used to set the CN Header Effective Date to the Current Date and Set the CN Status to Inactive.
Create CN API Flow
這是否有幫助?