FAQ: BAPI in Sales - General Questions
1. Question: What can I use the BAPIs in module SD-SLS for?
Answer: BAPIs are RFC-enabled function modules that form a programming interface to R/3 functions, you can use them to carry out the following sales activities without dialogs:
- Create and partially change customer inquiries, customer quotations and sales orders
- Simulate sales orders
- Determine the sales order statuses
- Create a list of orders for the customer
2. Question: How do I find general information on the use of the BAPIs?
Answer: Use the BAPI user guide of the SAP online help to find general information on the use. To find special information on individual BAPIs and their parameters, you can use Transaction BAPI or the function module documentation.
3. Question: How can I test a BAPI?
Answer: Goto Transaction SE37 ->Use the Function Builder. Carry out a 'Single test' (F8) for the corresponding function module. Fill the BAPI parameters in the test program and execute (F8). Before you do this, you can save the test data so that you can call them up again using the 'Test data directory' pushbutton. To fix the data on the database, also link the TRANSACTION_COMMIT BAPI in a test sequence.
4. Question: Which fields are mandatory during the creation of an order and how do I use the structure (checkbox structure)?
Answer: During the creation, the fields for order type, sales area and sold-to party are mandatory. The use of the checkbox structure is not mandatory. You can use it to make sure that only the selected fields are processed. Exception: The checkbox structure for schedule lines should always be used.
5. Question: Which fields are mandatory during the change of an order and how do I use the structure (checkbox structure)?
Answer: To change a document, it is absolutely necessary that you enter the document number and set the update flag of the structure on header level ('U'). In addition, (only) the fields to be changed have to be specified.
6. Question: The BAPI was processed successfully. Why does the document still not exist or why was it not changed?
Answer: BAPIs do not execute a COMMIT WORK command that triggers the update. This is done by the calling program. For this purpose, use the BAPI_TRANSACTION_COMMIT BAPI.
7. Question: Why do the items in the generated order not have quantities?
Answer: Quantities and dates must be maintained for BAPIs using the schedule line data. There you must use the item number to specify the reference to the item.
8. Question: How do I find the corresponding field of the BAPI structures for a given field name of the database or online transaction or vice versa?
Answer: Start Transaction BAPI or SE37 to go from the detail view of a BAPI parameter to the ABAP Dictionary by means of a double-click. The component type (the data element) of the component indicates the corresponding DB field. BAPIs use Include LVBAKF0C to execute the mapping from the external BAPI format into internal communication structures. Here, you can find the corresponding field names using a text search and derive the corresponding database tables (VBAKKOM -> DB table VBAK and so on).
9. Question: In which format does the data have to be transferred to the BAPI parameter so that it can be processed correctly?
Answer: This depends on the data type of the activated field. Consider that some fields are translated by the screen processor during the single test in Transaction SE37. If you assume that there is an error, you can find out by means of a debugging of the single test from Transaction SE37 in which format the screen processor fills the parameters.