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

BAPI_SAG_CHANGE Change Scheduling Agreement

Changes the header, items, account assignments, conditions, partners, texts and subcontracting components of a scheduling agreement (ME32L). Developers use it in programs that update agreement prices or item data in bulk from external systems. Fill the matching …X structure (HEADERX, ITEMX, ITEM_CONDITIONX and so on) with 'X' for every field you change, try it first with TESTRUN and call BAPI_TRANSACTION_COMMIT when RETURN has no errors; delivery schedule lines are maintained separately, not through this BAPI.

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

Importing parameters

ParameterTypeDescriptionRequired
PURCHASINGDOCUMENTBAPIMEOUTHEADER-NUMBERScheduling agreement numberYes
HEADERBAPIMEOUTHEADERHeader data—
HEADERXBAPIMEOUTHEADERXHeader data change flags—
VENDOR_ADDRESSBAPIMEOUTADDRVENDORVendor address—
HEAD_EXPORT_IMPORTBAPIMEOUTEIKPHeader foreign trade data—
HEAD_EXPORT_IMPORTXBAPIMEOUTEIKPXHeader foreign trade data change flags—
TESTRUNBAPIFLAG-BAPIFLAGTest run (no update)—
TECHNICAL_DATABAPIMEOUTTECHTechnical control data—

Exporting parameters

ParameterTypeDescription
EXP_HEADERBAPIMEOUTHEADERResulting header data
EXP_HEAD_EXPORT_IMPORTBAPIMEOUTEIKPResulting header foreign trade data

Tables parameters

ParameterTypeDescriptionRequired
ITEMBAPIMEOUTITEMItem data—
ITEMXBAPIMEOUTITEMXItem data change flags—
ACCOUNTBAPIMEOUTACCOUNTAccount assignments—
ACCOUNTXBAPIMEOUTACCOUNTXAccount assignment change flags—
HEAD_CONDITIONBAPIMEOUTHEADERCONDHeader conditions—
HEAD_CONDITIONXBAPIMEOUTHEADERCONDXHeader condition change flags—
ITEM_COND_VALIDITYBAPIMEOUTVALIDITYItem condition validity periods—
ITEM_COND_VALIDITYXBAPIMEOUTVALIDITYXValidity period change flags—
ITEM_CONDITIONBAPIMEOUTCONDITIONItem conditions—
ITEM_CONDITIONXBAPIMEOUTCONDITIONXItem condition change flags—
ITEM_COND_SCALE_QUANBAPIMEOUTITEMSCALEQUANItem condition quantity scales—
PARTNERBAPIMEOUTPARTNERPartners—
PARTNERXBAPIMEOUTPARTNERXPartner change flags—
SC_COMPONENTBAPIMEOUTCOMPONENTSubcontracting components—
SC_COMPONENTXBAPIMEOUTCOMPONENTXSubcontracting component change flags—
HEADER_TEXTBAPIMEOUTTEXTHeader texts—
ITEM_TEXTBAPIMEOUTITEMTEXTItem texts—
EXTENSIONINBAPIPAREXCustomer extension fields (input)—
RETURNBAPIRET2Return messages—

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_SAG_CHANGE'
  EXPORTING
    purchasingdocument = lv_purchasingdocument
  IMPORTING
    exp_header = lv_exp_header
    exp_head_export_import = lv_exp_head_export_import
  TABLES
    item = lt_item
    itemx = lt_itemx
    account = lt_account
    accountx = lt_accountx
    head_condition = lt_head_condition
    head_conditionx = lt_head_conditionx
    item_cond_validity = lt_item_cond_validity
    item_cond_validityx = lt_item_cond_validityx
    item_condition = lt_item_condition
    item_conditionx = lt_item_conditionx.

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