SAP BAPI_REQUISITION_GETITEMS Function Module for Read Purchase Requisition Item









BAPI_REQUISITION_GETITEMS is a standard bapi requisition getitems SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Purchase Requisition Item 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 requisition getitems FM, simply by entering the name BAPI_REQUISITION_GETITEMS into the relevant SAP transaction such as SE37 or SE38.

Function Group: MEWQ
Program Name: SAPLMEWQ
Main Program: SAPLMEWQ
Appliation area: M
Release date: 17-Sep-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_REQUISITION_GETITEMS 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_REQUISITION_GETITEMS'"Read Purchase Requisition Item
EXPORTING
* PREQ_NO = "Purchase Requisition Number
* DELIV_DATE = "Delivery Date
* REL_DATE = "Release Date
* SHORT_TEXT = "Material Short Text
* ASSIGNED_ITEMS = ' ' "Including Assigned Purchase Requisition Items
* CLOSED_ITEMS = ' ' "Including Closed Purchase Requisition Items
* DELETED_ITEMS = ' ' "Including Deleted Purchase Requisition Items
* PARTIALLY_ORDERED_ITEMS = ' ' "Including Partially Ordered Requisition Items
* ONLY_NON_MATERIAL_ITEMS = ' ' "Only Purchase Requisition Items Without Material
* OPEN_ITEMS = 'X' "Open Purchase Requisition Items
* MATERIAL_EVG = "Long Material Number
* PUR_GROUP = "Purchasing Group
* PREQ_NAME = "Requisitioner
* PREQ_DATE = "As of Request Date
* MATERIAL = "Material Number
* MAT_GRP = "Material Group
* TRACKINGNO = "Requirement Tracking Number
* PLANT = "Plant
* DOC_TYPE = "Document Type

TABLES
REQUISITION_ITEMS = "Table of Purchase Requisition Items
* RETURN = "Return Messages
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLMEWQ_001 Customer Exit: Creation of Purch. Requisition via BAPI_REQUISITION_CREATE

IMPORTING Parameters details for BAPI_REQUISITION_GETITEMS

PREQ_NO - Purchase Requisition Number

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

DELIV_DATE - Delivery Date

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

REL_DATE - Release Date

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

SHORT_TEXT - Material Short Text

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

ASSIGNED_ITEMS - Including Assigned Purchase Requisition Items

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

CLOSED_ITEMS - Including Closed Purchase Requisition Items

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

DELETED_ITEMS - Including Deleted Purchase Requisition Items

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

PARTIALLY_ORDERED_ITEMS - Including Partially Ordered Requisition Items

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

ONLY_NON_MATERIAL_ITEMS - Only Purchase Requisition Items Without Material

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

OPEN_ITEMS - Open Purchase Requisition Items

Data type: BAPIMMPARA-SELECTION
Default: 'X'
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)

PUR_GROUP - Purchasing Group

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

PREQ_NAME - Requisitioner

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

PREQ_DATE - As of Request Date

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

MATERIAL - Material Number

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

MAT_GRP - Material Group

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

TRACKINGNO - Requirement Tracking Number

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

PLANT - Plant

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

DOC_TYPE - Document Type

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

TABLES Parameters details for BAPI_REQUISITION_GETITEMS

REQUISITION_ITEMS - Table of Purchase Requisition Items

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

RETURN - Return Messages

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

Copy and paste ABAP code example for BAPI_REQUISITION_GETITEMS 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_preq_no  TYPE BAPIEBAN-PREQ_NO, "   
lt_requisition_items  TYPE STANDARD TABLE OF BAPIEBANC, "   
lv_deliv_date  TYPE BAPIEBAN-DELIV_DATE, "   
lv_rel_date  TYPE BAPIEBAN-REL_DATE, "   
lv_short_text  TYPE BAPIEBAN-SHORT_TEXT, "   
lv_assigned_items  TYPE BAPIMMPARA-SELECTION, "   SPACE
lv_closed_items  TYPE BAPIMMPARA-SELECTION, "   SPACE
lv_deleted_items  TYPE BAPIMMPARA-SELECTION, "   SPACE
lv_partially_ordered_items  TYPE BAPIMMPARA-SELECTION, "   SPACE
lv_only_non_material_items  TYPE BAPIMMPARA-SELECTION, "   SPACE
lv_open_items  TYPE BAPIMMPARA-SELECTION, "   'X'
lv_material_evg  TYPE BAPIMGVMATNR, "   
lt_return  TYPE STANDARD TABLE OF BAPIRETURN, "   
lv_pur_group  TYPE BAPIEBAN-PUR_GROUP, "   
lv_preq_name  TYPE BAPIEBAN-PREQ_NAME, "   
lv_preq_date  TYPE BAPIEBAN-PREQ_DATE, "   
lv_material  TYPE BAPIEBAN-MATERIAL, "   
lv_mat_grp  TYPE BAPIEBAN-MAT_GRP, "   
lv_trackingno  TYPE BAPIEBAN-TRACKINGNO, "   
lv_plant  TYPE BAPIEBAN-PLANT, "   
lv_doc_type  TYPE BAPIEBAN-DOC_TYPE. "   

  CALL FUNCTION 'BAPI_REQUISITION_GETITEMS'  "Read Purchase Requisition Item
    EXPORTING
         PREQ_NO = lv_preq_no
         DELIV_DATE = lv_deliv_date
         REL_DATE = lv_rel_date
         SHORT_TEXT = lv_short_text
         ASSIGNED_ITEMS = lv_assigned_items
         CLOSED_ITEMS = lv_closed_items
         DELETED_ITEMS = lv_deleted_items
         PARTIALLY_ORDERED_ITEMS = lv_partially_ordered_items
         ONLY_NON_MATERIAL_ITEMS = lv_only_non_material_items
         OPEN_ITEMS = lv_open_items
         MATERIAL_EVG = lv_material_evg
         PUR_GROUP = lv_pur_group
         PREQ_NAME = lv_preq_name
         PREQ_DATE = lv_preq_date
         MATERIAL = lv_material
         MAT_GRP = lv_mat_grp
         TRACKINGNO = lv_trackingno
         PLANT = lv_plant
         DOC_TYPE = lv_doc_type
    TABLES
         REQUISITION_ITEMS = lt_requisition_items
         RETURN = lt_return
. " BAPI_REQUISITION_GETITEMS




ABAP code using 7.40 inline data declarations to call FM BAPI_REQUISITION_GETITEMS

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 PREQ_NO FROM BAPIEBAN INTO @DATA(ld_preq_no).
 
 
"SELECT single DELIV_DATE FROM BAPIEBAN INTO @DATA(ld_deliv_date).
 
"SELECT single REL_DATE FROM BAPIEBAN INTO @DATA(ld_rel_date).
 
"SELECT single SHORT_TEXT FROM BAPIEBAN INTO @DATA(ld_short_text).
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_assigned_items).
DATA(ld_assigned_items) = ' '.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_closed_items).
DATA(ld_closed_items) = ' '.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_deleted_items).
DATA(ld_deleted_items) = ' '.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_partially_ordered_items).
DATA(ld_partially_ordered_items) = ' '.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_only_non_material_items).
DATA(ld_only_non_material_items) = ' '.
 
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_open_items).
DATA(ld_open_items) = 'X'.
 
 
 
"SELECT single PUR_GROUP FROM BAPIEBAN INTO @DATA(ld_pur_group).
 
"SELECT single PREQ_NAME FROM BAPIEBAN INTO @DATA(ld_preq_name).
 
"SELECT single PREQ_DATE FROM BAPIEBAN INTO @DATA(ld_preq_date).
 
"SELECT single MATERIAL FROM BAPIEBAN INTO @DATA(ld_material).
 
"SELECT single MAT_GRP FROM BAPIEBAN INTO @DATA(ld_mat_grp).
 
"SELECT single TRACKINGNO FROM BAPIEBAN INTO @DATA(ld_trackingno).
 
"SELECT single PLANT FROM BAPIEBAN INTO @DATA(ld_plant).
 
"SELECT single DOC_TYPE FROM BAPIEBAN INTO @DATA(ld_doc_type).
 


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!