SAP BAPI_SALESORDER_CHANGE Function Module for Sales order: Change Sales Order (2024)

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:
SAP BAPI_SALESORDER_CHANGE Function Module for Sales order: Change Sales Order (1)

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. "

&nbsp&nbspCALL 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



SAP BAPI_SALESORDER_CHANGE Function Module for Sales order: Change Sales Order (2024)

FAQs

How do I change sales order quantity in SAP? ›

  1. SAP menu path. Role ZSBM=>Cost Reimbursable=>Sales Orders=> VA02 - Change Sales Order.
  2. SAP Fast Path. At the Command Line, enter: /nVA02.
Jan 31, 2006

Which function module delete sales order in SAP? ›

To delete an SAP Sales Order, call bapi_salesorder_change function module with sales order number (VBELN) as the salesdocument parameter and set order_header_inx-updateflag to 'D' (indicates DELETE action).

How do I create a sales order in BAPI? ›

Step-by-step Creation of sales order using BAPI in ODATA services
  1. Go to T-code 'SEGW' and click on create an icon. ...
  2. Right click on Data model–>Import–>RFC.
  3. Give the Entity type name and Data sources. ...
  4. Select the Header details as well as item and what we want to require choose those the fields and click on next button.
Apr 10, 2017

How do I change my sales order on BOM? ›

Follow these steps to change a sales order BOM:
  1. Choose Logistics Production Master Data Bills of Material Bill of Material Order BOM Change . ...
  2. Enter the following data that identifies the BOM on the initial screen: ...
  3. Confirm your entries to go to the Item Overview page.
  4. Enter the Item Category of the BOM.

How to use VA02 in SAP? ›

Enter the sales order ID or search for a specific sales order using the search criteria. In the Manage Sales Orders app, choose the sales order you want to change and switch to change mode. In the Manage Sales Orders app, choose the sales order ID and then choose Change Sales Order - VA02.

How to use VA03 in SAP? ›

Display Sales Orders - VA03
  1. Choose the Display Sales Orders - VA03 app. ...
  2. In the Manage Sales Orders app, choose the sales order you want to display.
  3. In the Manage Sales Orders app, choose the sales order ID and then choose Display Sales Order - VA03.

What is the tcode for sales order changes in SAP? ›

Sales Order Change Report TCodes
#TCODEDescription
1VA01Create sales order
2VA02change sales order
3SE38ABAP Editor
4MIGOGoods Movement
27 more rows

What is the tcode of FBL5N in SAP? ›

Transaction FBL5N is a standard report that returns an ALV grid which contains fields such as Document Number and Account (AKA Customer number). GuiXT has the ability to interact with and manipulate the data, but not change the look and feel of the ALV Screens.

Is it possible to delete sales order in SAP? ›

Choose Sales – A/R Sales Order and find the sales order you want to cancel. In the menu bar, choose Data Cancel. The status Cancelled appears.

What is the SAP module used for sales order management? ›

SAP Sales and Distribution module is a part of SAP Logistics module that manages customer relationship starting from raising a quotation to sales order and billing of the product or service. This module is closely integrated with other modules like SAP Material Management and PP.

How do I delete old sales orders in SAP? ›

To do this, proceed as follows:
  1. Go to the Sales Orders view in the Sales Orders work center.
  2. Open the sales order that you want to cancel.
  3. Select the Extended View on the Document Flow screen of the sales order.
  4. Note down all document IDs that you have to cancel.

How do I get a list of open sales order in SAP? ›

You can check the open order status in VA02 in status tab. (double click on item and at item level chk the status) or check in transaction VA05 all the open orders. In SAP SD, the document flow will summarize the status of each document.

How do you change quantity in SAP? ›

For changing material quantity for any material in particular plant ,you have to add or remove the stock through MIGO (Good receipt or Goods Issue ) Transaction.

Can we change the quantity in SAP? ›

You can change the requirement (or required) quantity of an item at any time. You can change the quantity on the collective processing screen or on the detail screen. On the detail screen, the required quantity (in the stockkeeping unit) and the quantity withdrawn to-date are also displayed.

How do you update a quantity in SAP? ›

Activate Quantity / Value Updating in SAP S4 Hana
  1. IMG Path: Logistics-General -> Material-Master -> Basic-Settings -> Material Types -> Define attributes of material types.
  2. Tranasaction Code: OMS2.

How do I change a quantity in VA02 SAP? ›

User Exit for Changing Item Quantity in VA02 upon Openning
  1. Run tcode VA02.
  2. Enter Order Number.
  3. run exit, Change Quantity and Uom <<<
  4. Result: VA02 screen is displayed with new quantity (still in change mode).
Nov 14, 2011

Top Articles
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 6126

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.