SAP OTC Process – BAPI Quotation Create Extension- Part 1
SAP OTC (Order-to-Cash) process is the core process of SAP Sales and distribution module. SAP OTC process involves various steps. The first process is ‘ENQUIRY’ from the customers, then ‘QUOTATION’, next is the ‘SALES ORDER’ followed by ‘STANDARD ORDER’ , ‘SHIPPING’, ‘DELIVERY’ , ‘PICKING’ etc.
SAP BAPI (Business Application Programming Interfaces) are widely in SAP Environment for creating, updating and deleting business documents along with reading from the backend database as well. BAPIs are the API methods of SAP business object types, and stored in Business Objects Repository (BOR).
This blog discusses Extension for BAPIs which are part of OTC process. This document is part 1 of the SAP OTC Process extensions serious. Part 2 discusses Sales Order extension.
In Current blog , I am discussing Quotation extension scenario for BAPI_QUOTATION_CREATEFROMDATA2. As discussed earlier, QUOTATION is response to customer Inquiry.
Before we move on to the coding side. There are tables and structures, that must extended with the custom fields.
(1)The first step is to add custom fields in the VBAP (Sales document Item level) . I am taking date and time fields, as part of the custom data as show in the below screen capture.
(2) The next step is adjusting the following structures :
- Adjust the following structures for customer enhancements to table VBAP:
Here , I have demonstrated adding custom fields in 3 out of 6 structures. Adjusting all structures are mandatory.
(3) After adjusting required structures I move on to the coding part of BAPI BAPI_QUOTATION_CREATEFROMDATA2 for the BAPI extension process.
(a) First we need to declare extension container to hold custom data as show below
This container needs to be filled and, then supplied at the ‘extensionin’ table for the BAPI_QUOTATION_CREATEFROMDATA2.
(4) Now lets fill up some data using function module ‘BAPISDORDER_GETDETAILEDLIST‘ based on inquiry.
(6) Schedule lines needs to be adjust for example transport planning date, Goods issue date ,scheduling lines date etc as show below.
(7) For updating custom fields and creating quotations, i am using times and dates fields from table ‘AFVV‘ these fields need to be updating along with quotation creation as part of custom fields data. I am reading date and time fields and putting them in the internal table .
(8) Next step is updating the extension container
(9) Now we are ready to call the BAPI_QUOTATION_CREATEFROMDATA2
(10) I executed the program and check extension container.
extension container is ready ,
(11) Now I have to check if I have the new quotation number in variable
As you can see in the above screen capture, the BAPI returns the new quotation number indicating the successful execution of BAPI.
(12) Finally I check the new quotation number in VBAP TABLE and check if custom fields are updated.
All the Custom fields are updated for the newly created Quotation.
Thanks for reading.
For Sales Order Extension Scenario please Proceed to Part 2.
Link is broken.. Please correct:
Small addition, in S4Hana 1809 system, no need to append Z fields in below structure you mentioned.