SAP BAPI_SALESORDER_GETLIST Function Module for Sales order: List of all Orders for Customer









BAPI_SALESORDER_GETLIST is a standard bapi salesorder getlist 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: List of all Orders for Customer 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 getlist FM, simply by entering the name BAPI_SALESORDER_GETLIST into the relevant SAP transaction such as SE37 or SE38.

Function Group: 2032
Program Name: SAPL2032
Main Program: SAPL2032
Appliation area: V
Release date: 25-Jul-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_SALESORDER_GETLIST 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_GETLIST'"Sales order: List of all Orders for Customer
EXPORTING
CUSTOMER_NUMBER = "Customer number
SALES_ORGANIZATION = "Sales organization
* MATERIAL = "Material number
* DOCUMENT_DATE = "Entry date
* DOCUMENT_DATE_TO = "Entry date up to and including
* PURCHASE_ORDER = "Customer purchase order number
* TRANSACTION_GROUP = 0 "Single-Character Indicator
* PURCHASE_ORDER_NUMBER = "Customer Purchase Order Number
* MATERIAL_EVG = "Long Material Number

IMPORTING
RETURN = "Error Text

TABLES
SALES_ORDERS = "Table of orders for the customer
.



IMPORTING Parameters details for BAPI_SALESORDER_GETLIST

CUSTOMER_NUMBER - Customer number

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

SALES_ORGANIZATION - Sales organization

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

MATERIAL - Material number

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

DOCUMENT_DATE - Entry date

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

DOCUMENT_DATE_TO - Entry date up to and including

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

PURCHASE_ORDER - Customer purchase order number

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

TRANSACTION_GROUP - Single-Character Indicator

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

PURCHASE_ORDER_NUMBER - Customer Purchase Order Number

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

MATERIAL_EVG - Long Material Number

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

EXPORTING Parameters details for BAPI_SALESORDER_GETLIST

RETURN - Error Text

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

TABLES Parameters details for BAPI_SALESORDER_GETLIST

SALES_ORDERS - Table of orders for the customer

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

Copy and paste ABAP code example for BAPI_SALESORDER_GETLIST 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:
lv_return  TYPE BAPIRETURN, "   
lt_sales_orders  TYPE STANDARD TABLE OF BAPIORDERS, "   
lv_customer_number  TYPE BAPI1007-CUSTOMER, "   
lv_sales_organization  TYPE BAPIORDERS-SALES_ORG, "   
lv_material  TYPE BAPIORDERS-MATERIAL, "   
lv_document_date  TYPE BAPIORDERS-DOC_DATE, "   
lv_document_date_to  TYPE BAPIORDERS-DOC_DATE, "   
lv_purchase_order  TYPE BAPIORDERS-PURCH_NO, "   
lv_transaction_group  TYPE BAPIFLAG-BAPIFLAG, "   0
lv_purchase_order_number  TYPE BAPIORDERS-PURCH_NO_C, "   
lv_material_evg  TYPE BAPIMGVMATNR. "   

  CALL FUNCTION 'BAPI_SALESORDER_GETLIST'  "Sales order: List of all Orders for Customer
    EXPORTING
         CUSTOMER_NUMBER = lv_customer_number
         SALES_ORGANIZATION = lv_sales_organization
         MATERIAL = lv_material
         DOCUMENT_DATE = lv_document_date
         DOCUMENT_DATE_TO = lv_document_date_to
         PURCHASE_ORDER = lv_purchase_order
         TRANSACTION_GROUP = lv_transaction_group
         PURCHASE_ORDER_NUMBER = lv_purchase_order_number
         MATERIAL_EVG = lv_material_evg
    IMPORTING
         RETURN = lv_return
    TABLES
         SALES_ORDERS = lt_sales_orders
. " BAPI_SALESORDER_GETLIST




ABAP code using 7.40 inline data declarations to call FM BAPI_SALESORDER_GETLIST

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 CUSTOMER FROM BAPI1007 INTO @DATA(ld_customer_number).
 
"SELECT single SALES_ORG FROM BAPIORDERS INTO @DATA(ld_sales_organization).
 
"SELECT single MATERIAL FROM BAPIORDERS INTO @DATA(ld_material).
 
"SELECT single DOC_DATE FROM BAPIORDERS INTO @DATA(ld_document_date).
 
"SELECT single DOC_DATE FROM BAPIORDERS INTO @DATA(ld_document_date_to).
 
"SELECT single PURCH_NO FROM BAPIORDERS INTO @DATA(ld_purchase_order).
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_transaction_group).
 
"SELECT single PURCH_NO_C FROM BAPIORDERS INTO @DATA(ld_purchase_order_number).
 
 


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!