Create Part
The following API structure tables list all the APIs and the respective API fields that are required to create a material master record within the current version of SAP. These APIs are listed in the order in which they are invoked.
BAPI_MATERIAL_SAVEREPLICA
This API is used to create all material data in SAP and needs to be called for each material to be created in each plant. This API does not process multiple materials in multiple organizations with one API invocation. The following table provides details on this API.
* 
The BAPI_MATERIAL_SAVEREPLICA passes data in English. Additional characterization is required to render other supported languages.
Windchill Attribute Name
API Structure
API Field
API Field Description
Value (if Default used)
Source
Transform
number
HEAD
DATA
MATERIAL
Material
N/A
Windchill
N/A
partType
HEAD
DATA
MATL_
TYPE
Material type
N/A
Windchill
Cross Reference
N/A
HEAD
DATA
BASIC_
VIEW
Basic data view
X
Default
N/A
N/A
HEAD
DATA
IND-SECTOR
Industry sector
M
(Mechanical Engineering)
Default
N/A
N/A
HEAD
DATA
MRP_VIEW
MRP view
X
Default
N/A
defaultunit
CLIENT
DATA
BASE_
UOM
Basic unit of measure
N/A
Windchill
Cross Reference
defaultunit
CLIENT
DATAX
BASE_
UOM
Basic unit of measure
X
Default
N/A
N/A
MATERIAL DESCRIPTION
LANGU_
ISO
Language ISO
EN
Windchill
N/A
name
MATERIAL DESCRIPTION
MATL_
DESC
Material Description
N/A
Windchill
N/A
TargetID
PLANT
DATA
PLANT
Plant
N/A
Windchill
Sub-string
N/A
PLANT
DATA
MRP_TYPE
MRP Type
ND
Default
N/A
org
PLANT
DATAX
PLANT
Plant
N/A
Windchill
Sub-string
N/A
PLANT
DATAX
MRP_TYPE
MRP Type
X
Default
N/A
Source
PLANT
DATA
PROC_TYPE
Procurement Type
N/A
Windchill
Cross Reference
N/A
PLANT
DATAX
PROC_TYPE
Procurement Type
X
Default
N/A
* 
Note the following:
PlantData and PlantdataX should not contain duplicate values for that same part and plant combination. The same part and plant combination may exist in different views, such as design and manufacturing. For this reason you should only enter one entry for the same part and plant combination.
PRTDATA and PRTDATAX should only be populated for Process Material or Tooling of the category Tool, and not for Material.
The MRP view is only required when the Procurement Type (Source) is created or changed.
The procurement type in the PLANTDATA STRUCTURE is required if creating or changing the Procurement Type (Source).
The procurement type in the PLANTDATAX STRUCTURE is required if creating or changing the Procurement Type (Source).
CCAP_REV_LEVEL_MAINTAIN
This API creates a new revision level for the material created with BAPI_MATERIAL_SAVEREPLICA function. The revision level is created when a change number is defined and sent from Windchill PDMLink. The change master record for the change number must exist in SAP before running this API. The following table provides details on this API.
WC Attribute Name
API Structure
API Field
API Field Description
Value If Default
Source
Transform
Change number
HEADER
CHANGE _NO
Change Number
Windchill
N/A
N/A
HEADER
FL_ COMMIT_ AND_ WAIT
Flag for Commit and Wait
X
Default
N/A
Number
HEADER
MATERIAL
Material
Winchill
This should be the same value that was used for the BAPI_MATERIAL_SAVEREPLICA
N/A
Version
HEADER
REV_ LEVEL_ NEW
REV_ LEVEL_ NEW
Windchill
N/A
CALO_INIT_API
This API should be invoked before the CCAP_REV_LEVEL_MAINTAIN API is called to create a part revision level. It is not necessary to pass any data into this function module. The defaults written into the API when it is done executing meet theWindchill ESI requirements. The following table illustrates the defaults passed in automatically upon execution of this API and provides details on it.
Windchill Attribute Name
API Structure
API Field
API Field Description
Value If Default
Source
Transform
N/A
N/A
N/A
N/A
N/A
N/A
N/A
BAPI_TRANSACTION_COMMIT
This API is used to commit a transaction to the SAP system. If the return message generated from executing the BAPI_MATERIAL_SAVEREPLICA API is a success, then this API is executed. When this API is executed, all part data sent from Windchill PDMLink, if it includes plant data, it is committed to the MARA and MARC SAP database tables. Refer to the 《Windchill Enterprise Systems Integration Customizer's Guide - SAP R/3》 for an explanation of howWindchill ESI interprets the results of the SAP API calls. The following table provides details on this API.
* 
No data is passed through the BAPI_TRANSACTION_COMMIT function module but it is necessary to call the module to release the material in case invalid data is passed through. There are no variations of data inputs for this API for different data requirements. Refer to the《Windchill Enterprise Systems Integration Customizer's Guide - SAP R/3》 for an explanation of how SAP APIs are called in sequence to execute eachWindchill ESI business function.
Windchill Attribute Name
API Structure
API Field
API Field Description
Value If Default
Source
Transform
N/A
HEADER
Wait
Wait
X
Default
N/A
BAPI_TRANSACTION_ROLLBACK
This API is used to rollback a transaction to the SAP distribution target. If the return message generated from the BAPI_MATERIAL_SAVEREPLICA function is not a success then this API is executed. When this API is executed, all part data sent fromWindchill PDMLink is rolled back, and if plant data is sent, it is not committed to the MARA and MARC SAP database tables. Refer to the《Windchill Enterprise Systems Integration Customizer's Guide - SAP R/3》 for an explanation of howWindchill ESI interprets the results of the SAP API calls. The following table provides details on this API.
* 
No data is passed through the BAPI_TRANSACTION_ROLLBACK function module but it is necessary to call the module. Refer to the《Windchill Enterprise Systems Integration Customizer's Guide - SAP R/3》 for an explanation of how SAP APIs are called in sequence to execute eachWindchill ESI business function.
Windchill Attribute Name
API Structure
API Field
API Field Description
Value If Default
Source
Transform
N/A
N/A
N/A
N/A
N/A
N/A
N/A
這是否有幫助?