進階自訂 > Windchill ESI Customization > Windchill ESI Customization—SAP > Overview > The Six Steps > Step 4: Validate API Atomic Functionality Inside SAP
Step 4: Validate API Atomic Functionality Inside SAP
The purpose of Step 4 is to isolate any SAP-based issues with individual, or "atomic," APIs used by Windchill Enterprise Systems Integration. Step 4 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 4, 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 SAP API:
a. Enter the name of the API function module in the Function module field, as illustrated below for BAPI_MATERIAL_SAVEREPLICA.
SAP Function Builder Initial Screen (Transaction SE37)
b. In the SAP menu bar, navigate to Function module > Test > Single test (F8), or click the Single Test icon. A screen like the one below appears.
SAP Function Module Tester Initial Screen: Single Test
c. 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, as illustrated.
Your test data conditions 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 Windchill Enterprise Systems Integration business logic. For guidance, refer to the following documentation:
Because you are only testing individual, or "atomic," APIs, your test conditions will not cover complete Windchill Enterprise Integration business scenarios, in which different APIs are invoked sequentially to complete a business function. This is "molecular" testing, which you will complete in Step 5 of the SAP Readiness Validation Process. The purpose of Step 4 is to ensure that each atomic API is behaving as expected prior to combining APIs for molecular functionality.
d. In the SAP menu bar, navigate to Function modules > Execute (F8), or click the Execute icon to run the test.
e. 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.
An example of a successful test of BAPI_MATERIAL_SAVEREPLICA is shown below (notice that the RETURN structure indicates a message TYPE of ‘S’).
Successful Atomic Test of BAPI_MATERIAL_SAVEREPLICA
f. If applicable, verify that the business object corresponding to the data you specified exists in the SAP system with the correct attributes, using the transactions indicated below.
Transaction Code
Description
MM03
View Material
CS03
View Material BOM
CV03N
View Document
CC03
View Change Master
CA03
View Routing
IE03
View Equipment
CA01
View Reference Operation Set
SAP Transaction Codes to Verify Business Object Creation
Several API function modules, especially those originally developed after SAP Release 3.1, do not contain a built-in ABAP command to commit the results to the SAP database. Hence, you are not be able to view the associated business object until you complete the next logical unit of work or exit from transaction SE37. Other APIs, including CALO_INIT_API, BAPI_TRANSACTION_COMMIT, and BAPI_TRANSACTION_ROLLBACK, do not produce observable business objects by design.
g. Repeat this procedure for each Windchill Enterprise Systems Integration SAP API.
這是否有幫助?