SAP BAPI_SALESORDER_CHANGE Function Module for Sales order: Change Sales Order









BAPI_SALESORDER_CHANGE is a standard bapi salesorder change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Sales order: Change Sales Order processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi salesorder change FM, simply by entering the name BAPI_SALESORDER_CHANGE into the relevant SAP transaction such as SE37 or SE38.

Function Group: 2032
Program Name: SAPL2032
Main Program: SAPL2032
Appliation area: V
Release date: 18-Mar-1999
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_SALESORDER_CHANGE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'"Sales order: Change Sales Order
EXPORTING
SALESDOCUMENT = "Order Number
* ORDER_HEADER_IN = "Order Header
ORDER_HEADER_INX = "Sales Order Check List
* SIMULATION = "Simulation Mode
* BEHAVE_WHEN_ERROR = ' ' "Error Handling
* INT_NUMBER_ASSIGNMENT = ' ' "Internal Item Number Assignment
* LOGIC_SWITCH = "SD Checkbox for the Logic Switch
* NO_STATUS_BUF_INIT = ' ' "No Refresh of Status Buffer

TABLES
RETURN = "Return Code
* ORDER_CFGS_VALUE = "Configuration: Characteristic Values
* ORDER_CFGS_BLOB = "Internal Configuration Data (SCE)
* ORDER_CFGS_VK = "Configuration: Variant Condition Key
* ORDER_CFGS_REFINST = "Configuration: Reference Item / Instance
* SCHEDULE_LINES = "Schedule Lines
* SCHEDULE_LINESX = "Check Table for Schedule Lines
* ORDER_TEXT = "Texts
* ORDER_KEYS = "Output Table of Reference Keys
* CONDITIONS_IN = "Conditions
* CONDITIONS_INX = "Conditions Checkbox
* ORDER_ITEM_IN = "Order Items
* EXTENSIONIN = "Customer Enhancement for VBAK, VBAP, VBEP
* ORDER_ITEM_INX = "Sales Order Items Check Table
* PARTNERS = "Communications Fields: SD Document Partner: WWW
* PARTNERCHANGES = "Partner changes
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Org./Company)
* ORDER_CFGS_REF = "Configuration: Reference Data
* ORDER_CFGS_INST = "Configuration: Instances
* ORDER_CFGS_PART_OF = "Configuration: Part-of Specifications
.



IMPORTING Parameters details for BAPI_SALESORDER_CHANGE

SALESDOCUMENT - Order Number

Data type: BAPIVBELN-VBELN
Optional: No
Call by Reference: No ( called with pass by value option)

ORDER_HEADER_IN - Order Header

Data type: BAPISDH1
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_HEADER_INX - Sales Order Check List

Data type: BAPISDH1X
Optional: No
Call by Reference: No ( called with pass by value option)

SIMULATION - Simulation Mode

Data type: BAPIFLAG-BAPIFLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

BEHAVE_WHEN_ERROR - Error Handling

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

INT_NUMBER_ASSIGNMENT - Internal Item Number Assignment

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LOGIC_SWITCH - SD Checkbox for the Logic Switch

Data type: BAPISDLS
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_STATUS_BUF_INIT - No Refresh of Status Buffer

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_SALESORDER_CHANGE

RETURN - Return Code

Data type: BAPIRET2
Optional: No
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_VALUE - Configuration: Characteristic Values

Data type: BAPICUVAL
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_BLOB - Internal Configuration Data (SCE)

Data type: BAPICUBLB
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_VK - Configuration: Variant Condition Key

Data type: BAPICUVK
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_REFINST - Configuration: Reference Item / Instance

Data type: BAPICUREF
Optional: Yes
Call by Reference: No ( called with pass by value option)

SCHEDULE_LINES - Schedule Lines

Data type: BAPISCHDL
Optional: Yes
Call by Reference: No ( called with pass by value option)

SCHEDULE_LINESX - Check Table for Schedule Lines

Data type: BAPISCHDLX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_TEXT - Texts

Data type: BAPISDTEXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_KEYS - Output Table of Reference Keys

Data type: BAPISDKEY
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONDITIONS_IN - Conditions

Data type: BAPICOND
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONDITIONS_INX - Conditions Checkbox

Data type: BAPICONDX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_ITEM_IN - Order Items

Data type: BAPISDITM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXTENSIONIN - Customer Enhancement for VBAK, VBAP, VBEP

Data type: BAPIPAREX
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_ITEM_INX - Sales Order Items Check Table

Data type: BAPISDITMX
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARTNERS - Communications Fields: SD Document Partner: WWW

Data type: BAPIPARNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARTNERCHANGES - Partner changes

Data type: BAPIPARNRC
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARTNERADDRESSES - BAPI Reference Structure for Addresses (Org./Company)

Data type: BAPIADDR1
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_REF - Configuration: Reference Data

Data type: BAPICUCFG
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_INST - Configuration: Instances

Data type: BAPICUINS
Optional: Yes
Call by Reference: No ( called with pass by value option)

ORDER_CFGS_PART_OF - Configuration: Part-of Specifications

Data type: BAPICUPRT
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_SALESORDER_CHANGE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_salesdocument  TYPE BAPIVBELN-VBELN, "   
lt_order_cfgs_value  TYPE STANDARD TABLE OF BAPICUVAL, "   
lt_order_cfgs_blob  TYPE STANDARD TABLE OF BAPICUBLB, "   
lt_order_cfgs_vk  TYPE STANDARD TABLE OF BAPICUVK, "   
lt_order_cfgs_refinst  TYPE STANDARD TABLE OF BAPICUREF, "   
lt_schedule_lines  TYPE STANDARD TABLE OF BAPISCHDL, "   
lt_schedule_linesx  TYPE STANDARD TABLE OF BAPISCHDLX, "   
lt_order_text  TYPE STANDARD TABLE OF BAPISDTEXT, "   
lt_order_keys  TYPE STANDARD TABLE OF BAPISDKEY, "   
lt_conditions_in  TYPE STANDARD TABLE OF BAPICOND, "   
lt_conditions_inx  TYPE STANDARD TABLE OF BAPICONDX, "   
lt_order_item_in  TYPE STANDARD TABLE OF BAPISDITM, "   
lv_order_header_in  TYPE BAPISDH1, "   
lt_extensionin  TYPE STANDARD TABLE OF BAPIPAREX, "   
lt_order_item_inx  TYPE STANDARD TABLE OF BAPISDITMX, "   
lv_order_header_inx  TYPE BAPISDH1X, "   
lt_partners  TYPE STANDARD TABLE OF BAPIPARNR, "   
lv_simulation  TYPE BAPIFLAG-BAPIFLAG, "   
lt_partnerchanges  TYPE STANDARD TABLE OF BAPIPARNRC, "   
lv_behave_when_error  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lt_partneraddresses  TYPE STANDARD TABLE OF BAPIADDR1, "   
lv_int_number_assignment  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lv_logic_switch  TYPE BAPISDLS, "   
lt_order_cfgs_ref  TYPE STANDARD TABLE OF BAPICUCFG, "   
lt_order_cfgs_inst  TYPE STANDARD TABLE OF BAPICUINS, "   
lv_no_status_buf_init  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lt_order_cfgs_part_of  TYPE STANDARD TABLE OF BAPICUPRT. "   

  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'  "Sales order: Change Sales Order
    EXPORTING
         SALESDOCUMENT = lv_salesdocument
         ORDER_HEADER_IN = lv_order_header_in
         ORDER_HEADER_INX = lv_order_header_inx
         SIMULATION = lv_simulation
         BEHAVE_WHEN_ERROR = lv_behave_when_error
         INT_NUMBER_ASSIGNMENT = lv_int_number_assignment
         LOGIC_SWITCH = lv_logic_switch
         NO_STATUS_BUF_INIT = lv_no_status_buf_init
    TABLES
         RETURN = lt_return
         ORDER_CFGS_VALUE = lt_order_cfgs_value
         ORDER_CFGS_BLOB = lt_order_cfgs_blob
         ORDER_CFGS_VK = lt_order_cfgs_vk
         ORDER_CFGS_REFINST = lt_order_cfgs_refinst
         SCHEDULE_LINES = lt_schedule_lines
         SCHEDULE_LINESX = lt_schedule_linesx
         ORDER_TEXT = lt_order_text
         ORDER_KEYS = lt_order_keys
         CONDITIONS_IN = lt_conditions_in
         CONDITIONS_INX = lt_conditions_inx
         ORDER_ITEM_IN = lt_order_item_in
         EXTENSIONIN = lt_extensionin
         ORDER_ITEM_INX = lt_order_item_inx
         PARTNERS = lt_partners
         PARTNERCHANGES = lt_partnerchanges
         PARTNERADDRESSES = lt_partneraddresses
         ORDER_CFGS_REF = lt_order_cfgs_ref
         ORDER_CFGS_INST = lt_order_cfgs_inst
         ORDER_CFGS_PART_OF = lt_order_cfgs_part_of
. " BAPI_SALESORDER_CHANGE




ABAP code using 7.40 inline data declarations to call FM BAPI_SALESORDER_CHANGE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single VBELN FROM BAPIVBELN INTO @DATA(ld_salesdocument).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_simulation).
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_behave_when_error).
DATA(ld_behave_when_error) = ' '.
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_int_number_assignment).
DATA(ld_int_number_assignment) = ' '.
 
 
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_no_status_buf_init).
DATA(ld_no_status_buf_init) = ' '.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!