SD BAPI RFC Used the same way in S/4HANA

BAPI_QUOTATION_CREATEFROMDATA2 Create Customer Quotation

Creates a customer quotation with header, item, partner, schedule line and condition data, like VA21. It is used by CRM, CPQ or web tools that send quotations into SAP. Fill the X structures for the fields you pass, use TESTRUN to validate, and call BAPI_TRANSACTION_COMMIT afterwards only when RETURN contains no message of type E or A.

Function group
2031
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
SALESDOCUMENTINBAPIVBELN-VBELNExternal sales document number—
QUOTATION_HEADER_INBAPISDHD1Quotation header dataYes
QUOTATION_HEADER_INXBAPISDHD1XQuotation header change flags (X structure)—
SENDERBAPI_SENDERLogical sender system (ALE)—
BEHAVE_WHEN_ERRORBAPIFLAG-BAPIFLAGError handling behavior—
TESTRUNBAPIFLAG-BAPIFLAGTest run (no update)—
CONVERTBAPIFLAG-BAPIFLAGConvert partner roles and document types to internal format—
LOGIC_SWITCHBAPISDLSSD logic switch (pricing, ATP control)—

Exporting parameters

ParameterTypeDescription
SALESDOCUMENTBAPIVBELN-VBELNQuotation number created

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messages—
QUOTATION_ITEMS_INBAPISDITMQuotation item data—
QUOTATION_ITEMS_INXBAPISDITMXQuotation item change flags (X structure)—
QUOTATION_PARTNERSBAPIPARNRQuotation partnersYes
QUOTATION_SCHEDULES_INBAPISCHDLSchedule lines—
QUOTATION_SCHEDULES_INXBAPISCHDLXSchedule line change flags (X structure)—
QUOTATION_CONDITIONS_INBAPICONDPricing conditions—
QUOTATION_CONDITIONS_INXBAPICONDXCondition change flags (X structure)—
QUOTATION_TEXTBAPISDTEXTTexts—
QUOTATION_KEYSBAPISDKEYReference keys of created objects—
PARTNERADDRESSESBAPIADDR1Partner addresses—
EXTENSIONINBAPIPAREXCustomer enhancement fields (EXTENSIONIN)—

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA2'
  EXPORTING
    quotation_header_in = lv_quotation_header_in
  IMPORTING
    salesdocument = lv_salesdocument
  TABLES
    return = lt_return
    quotation_items_in = lt_quotation_items_in
    quotation_items_inx = lt_quotation_items_inx
    quotation_partners = lt_quotation_partners
    quotation_schedules_in = lt_quotation_schedules_in
    quotation_schedules_inx = lt_quotation_schedules_inx
    quotation_conditions_in = lt_quotation_conditions_in
    quotation_conditions_inx = lt_quotation_conditions_inx
    quotation_text = lt_quotation_text
    quotation_keys = lt_quotation_keys.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report