進階自訂 > Windchill ESI Customization > Windchill ESI Customization—SAP > Overview > The Six Steps > Step 5: Validate API Molecular Functionality Inside SAP
Step 5: Validate API Molecular Functionality Inside SAP
The purpose of Step 5 is to isolate any SAP-based issues with "molecular" sequences of APIs, exactly as they are invoked by Windchill Enterprise Systems Integration to complete business functions. Step 5 is completed entirely within the SAP distribution target system. Finding problems at this step can streamline troubleshooting by ruling out the EAI software components as root causes.
This step of the SAP Readiness Validation Process will create actual business objects in your SAP distribution target system based on the data you specify.
* 
Do not perform these steps with production or business-critical systems. Instead, use development or sandbox systems that replicate the production environment as closely as possible.
Steps 4 and 5 leverage a standard SAP transaction, SE37, used for developing, testing, and analyzing ABAP function modules. This transaction has several testing features you may wish to take advantage of that are not discussed in this document; for example, saving test data for future use and regression testing. Refer to SAP online application help for further details on using the advanced features of this transaction.
To complete Step 5, use the following procedure.
1. Log on to the SAP distribution target system.
2. Go to the Function Builder Initial Screen (transaction SE37).
3. For each Windchill Enterprise Systems Integration Business Function Test Scenario:
Business Function Test Scenario
SAP APIs Used
Create Part/Material
BAPI_MATERIAL_SAVEREPLICA
BAPI_TRANSACTION_COMMIT
Create Part/MaterialRevision (for EHP)
CALO_INIT_API
CCAP_REV_LEVEL_MAINTAIN
BAPI_TRANSACTION_COMMIT
Create CN (For S4HANA)
CALO_INIT_API
BAPI_REV_LEVEL_MAINTAIN
BAPI_TRANSACTION_COMMIT
Change Part
BAPI_MATERIAL_SAVEREPLICA
BAPI_TRANSACTION_COMMIT
Create BOM
CALO_INIT_API
BAPI_MATERIAL_BOM_GROUP_CREATE
Change BOM
CALO_INIT_API
CSAP_MAT_BOM_MAINTAIN
Create Document
BAPI_DOCUMENT_CREATE2
BAPI_TRANSACTION_COMMIT
Create Document Revision plus Change Document plus, optionally, Add or Delete Document Links
BAPI_DOCUMENT_CREATENEWVRS2
BAPI_TRANSACTION_COMMIT
BAPI_DOCUMENT_CHANGE2
Create CN (for EHP)
CALO_INIT_API
CCAP_ECN_CREATE
Create Part/MaterialRevision (For S4HANA)
CALO_INIT_API
BAPI_ECN_CREATE
BAPI_TRANSACTION_COMMIT
Change CN (for EHP)
CALO_INIT_API
CCAP_ECN_MAINTAIN
Change CN (for S4HANA)
CALO_INIT_API
BAPI_ECN_MAINTAIN
BAPI_TRANSACTION_COMMIT
SAP APIs for each Business Function Test Scenario
1. Enter the name of any valid API function module in the Function module field. For example, you may enter "BAPI_MATERIAL_SAVEREPLICA" in this field, as shown in the figure below. The API function module you choose is unimportant, as long as it is valid.
2. In the SAP menu bar, navigate to Function module > Test > Test Sequences (Shift + F8).
3. In the dialog window that appears, enter the sequence of APIs required to execute the business function test scenario, according to the table SAP APIs for each Business Function Test Scenario. The order of the APIs is very important. For example, for the "Create Part" scenario, you should enter "BAPI_MATERIAL_SAVEREPLICA," followed by "BAPI_TRANSACTION_COMMIT," as illustrated.
Entering API Test Sequence for "Create Part" Scenario
4. Click the Execute (Enter) icon.
5. Provide suitable test data in the API fields by clicking on the icon next to each API structure, entering the data, and using the SAP "Back (F3)" icon to return to the Function Module Tester initial screen, just as you did in Step 4 of the SAP Readiness Validation Process.
Your test data conditions will depend on your particular Windchill Enterprise Systems Integration deployment. You must hard-code field values that are normally defaulted or cross-referenced by the actual Enterprise Systems Integration business logic.
For guidance, refer to the following topics::
6. In the SAP menu bar, navigate to Function modules > Execute (F8), or click the Execute icon to run the test.
7. Confirm the successful execution of the API function module according to the SAP API Response Characterization section of this document. Any errors are likely due to invalid test data or your SAP distribution target system configuration. These issues must be resolved prior to implementing Windchill Enterprise Systems Integration.
8. Use the SAP Back (F3) icon to proceed to the next API in the test sequence, and repeat steps e through g, above, for each API in the test sequence. Remember that you are testing a "molecular" sequence of APIs to emulate complete Windchill Enterprise Integration business functions.
9. Verify that the business object corresponding to the data you specified exists in the SAP system with the correct attributes, using SAP transactions indicated in SAP Transaction Codes to Verify BusinessObject Creation.
For API test sequences that include CALO_INIT_API, you may obtain additional logging information in the SAP application log (transaction SLG1). Refer to SAP online application help for further details on using this transaction.
10. Repeat this procedure for each Windchill Enterprise Systems Integration Business Function Test Scenario.
這是否有幫助?