SAP BAPI_PO_GETDETAIL Function Module for Display Purchase Order Details
BAPI_PO_GETDETAIL is a standard bapi po getdetail SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Display Purchase Order Details 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 po getdetail FM, simply by entering the name BAPI_PO_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: MEWP
Program Name: SAPLMEWP
Main Program: SAPLMEWP
Appliation area: M
Release date: 17-Sep-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PO_GETDETAIL 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_PO_GETDETAIL'"Display Purchase Order Details.
EXPORTING
PURCHASEORDER = "Purchase Order Number
* SERVICE_TEXTS = ' ' "Also Provide Service Texts
* EXTENSIONS = ' ' "Also Provide Customer's Own Fields
* ITEMS = 'X' "Also Provide Item Data
* ACCOUNT_ASSIGNMENT = ' ' "Also Provide Account Assignment Data
* SCHEDULES = ' ' "Also Provide Schedule Lines
* HISTORY = ' ' "Also Provide PO History
* ITEM_TEXTS = ' ' "Also Provide Item Texts
* HEADER_TEXTS = ' ' "Also Provide Header Texts
* SERVICES = ' ' "Also Provide Services and Limits
* CONFIRMATIONS = ' ' "Also Provide Confirmations
IMPORTING
PO_HEADER = "PO Header Data
PO_ADDRESS = "Ordering Address Data
TABLES
* PO_HEADER_TEXTS = "PO Header Texts
* PO_ITEM_CONTRACT_LIMITS = "Limits with Contract Reference
* PO_ITEM_SERVICES = "Services
* PO_ITEM_SRV_ACCASS_VALUES = "Value/Link to Service Account Assignment
* RETURN = "Return Messages
* PO_SERVICES_TEXTS = "Long Texts for Service Line
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* PO_ITEMS = "Purchase Order Items
* PO_ITEM_ACCOUNT_ASSIGNMENT = "Account Assignment Data for Item
* PO_ITEM_SCHEDULES = "Schedule Lines for Item
* PO_ITEM_CONFIRMATIONS = "Confirmations for Item
* PO_ITEM_TEXTS = "Texts for Item
* PO_ITEM_HISTORY = "PO History for Item
* PO_ITEM_HISTORY_TOTALS = "PO History for Item: Totals
* PO_ITEM_LIMITS = "Limits
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_SAPLMEWP_001 Customer Exit for Object Determination (Procurement via Catalogs)
EXIT_SAPLMEWP_002 Customer Exit: Creation of Purchase Order via BAPI_PO_CREATE
EXIT_SAPLMEWP_003 Customer Exit to Determine Allowed Catalogs
IMPORTING Parameters details for BAPI_PO_GETDETAIL
PURCHASEORDER - Purchase Order Number
Data type: BAPIEKKO-PO_NUMBEROptional: No
Call by Reference: No ( called with pass by value option)
SERVICE_TEXTS - Also Provide Service Texts
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXTENSIONS - Also Provide Customer's Own Fields
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ITEMS - Also Provide Item Data
Data type: BAPIMMPARA-SELECTIONDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ACCOUNT_ASSIGNMENT - Also Provide Account Assignment Data
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SCHEDULES - Also Provide Schedule Lines
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HISTORY - Also Provide PO History
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ITEM_TEXTS - Also Provide Item Texts
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEADER_TEXTS - Also Provide Header Texts
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERVICES - Also Provide Services and Limits
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONFIRMATIONS - Also Provide Confirmations
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PO_GETDETAIL
PO_HEADER - PO Header Data
Data type: BAPIEKKOLOptional: No
Call by Reference: No ( called with pass by value option)
PO_ADDRESS - Ordering Address Data
Data type: BAPIADDRESSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_PO_GETDETAIL
PO_HEADER_TEXTS - PO Header Texts
Data type: BAPIEKKOTXOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_CONTRACT_LIMITS - Limits with Contract Reference
Data type: BAPIESUCOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_SERVICES - Services
Data type: BAPIESLLOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_SRV_ACCASS_VALUES - Value/Link to Service Account Assignment
Data type: BAPIESKLOptional: Yes
Call by Reference: No ( called with pass by value option)
RETURN - Return Messages
Data type: BAPIRETURNOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_SERVICES_TEXTS - Long Texts for Service Line
Data type: BAPIESLLTXOptional: Yes
Call by Reference: Yes
EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
PO_ITEMS - Purchase Order Items
Data type: BAPIEKPOOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_ACCOUNT_ASSIGNMENT - Account Assignment Data for Item
Data type: BAPIEKKNOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_SCHEDULES - Schedule Lines for Item
Data type: BAPIEKETOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_CONFIRMATIONS - Confirmations for Item
Data type: BAPIEKESOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_TEXTS - Texts for Item
Data type: BAPIEKPOTXOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_HISTORY - PO History for Item
Data type: BAPIEKBEOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_HISTORY_TOTALS - PO History for Item: Totals
Data type: BAPIEKBESOptional: Yes
Call by Reference: No ( called with pass by value option)
PO_ITEM_LIMITS - Limits
Data type: BAPIESUHOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_PO_GETDETAIL 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_po_header | TYPE BAPIEKKOL, " | |||
lv_purchaseorder | TYPE BAPIEKKO-PO_NUMBER, " | |||
lt_po_header_texts | TYPE STANDARD TABLE OF BAPIEKKOTX, " | |||
lv_service_texts | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_contract_limits | TYPE STANDARD TABLE OF BAPIESUC, " | |||
lv_extensions | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_services | TYPE STANDARD TABLE OF BAPIESLL, " | |||
lt_po_item_srv_accass_values | TYPE STANDARD TABLE OF BAPIESKL, " | |||
lt_return | TYPE STANDARD TABLE OF BAPIRETURN, " | |||
lt_po_services_texts | TYPE STANDARD TABLE OF BAPIESLLTX, " | |||
lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
lv_items | TYPE BAPIMMPARA-SELECTION, " 'X' | |||
lt_po_items | TYPE STANDARD TABLE OF BAPIEKPO, " | |||
lv_po_address | TYPE BAPIADDRESS, " | |||
lv_account_assignment | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_account_assignment | TYPE STANDARD TABLE OF BAPIEKKN, " | |||
lv_schedules | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_schedules | TYPE STANDARD TABLE OF BAPIEKET, " | |||
lv_history | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_confirmations | TYPE STANDARD TABLE OF BAPIEKES, " | |||
lv_item_texts | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_texts | TYPE STANDARD TABLE OF BAPIEKPOTX, " | |||
lv_header_texts | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_history | TYPE STANDARD TABLE OF BAPIEKBE, " | |||
lv_services | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_history_totals | TYPE STANDARD TABLE OF BAPIEKBES, " | |||
lv_confirmations | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_po_item_limits | TYPE STANDARD TABLE OF BAPIESUH. " |
  CALL FUNCTION 'BAPI_PO_GETDETAIL' "Display Purchase Order Details |
EXPORTING | ||
PURCHASEORDER | = lv_purchaseorder | |
SERVICE_TEXTS | = lv_service_texts | |
EXTENSIONS | = lv_extensions | |
ITEMS | = lv_items | |
ACCOUNT_ASSIGNMENT | = lv_account_assignment | |
SCHEDULES | = lv_schedules | |
HISTORY | = lv_history | |
ITEM_TEXTS | = lv_item_texts | |
HEADER_TEXTS | = lv_header_texts | |
SERVICES | = lv_services | |
CONFIRMATIONS | = lv_confirmations | |
IMPORTING | ||
PO_HEADER | = lv_po_header | |
PO_ADDRESS | = lv_po_address | |
TABLES | ||
PO_HEADER_TEXTS | = lt_po_header_texts | |
PO_ITEM_CONTRACT_LIMITS | = lt_po_item_contract_limits | |
PO_ITEM_SERVICES | = lt_po_item_services | |
PO_ITEM_SRV_ACCASS_VALUES | = lt_po_item_srv_accass_values | |
RETURN | = lt_return | |
PO_SERVICES_TEXTS | = lt_po_services_texts | |
EXTENSIONOUT | = lt_extensionout | |
PO_ITEMS | = lt_po_items | |
PO_ITEM_ACCOUNT_ASSIGNMENT | = lt_po_item_account_assignment | |
PO_ITEM_SCHEDULES | = lt_po_item_schedules | |
PO_ITEM_CONFIRMATIONS | = lt_po_item_confirmations | |
PO_ITEM_TEXTS | = lt_po_item_texts | |
PO_ITEM_HISTORY | = lt_po_item_history | |
PO_ITEM_HISTORY_TOTALS | = lt_po_item_history_totals | |
PO_ITEM_LIMITS | = lt_po_item_limits | |
. " BAPI_PO_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_PO_GETDETAIL
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 PO_NUMBER FROM BAPIEKKO INTO @DATA(ld_purchaseorder). | ||||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_service_texts). | ||||
DATA(ld_service_texts) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_extensions). | ||||
DATA(ld_extensions) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_items). | ||||
DATA(ld_items) | = 'X'. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_account_assignment). | ||||
DATA(ld_account_assignment) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_schedules). | ||||
DATA(ld_schedules) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_history). | ||||
DATA(ld_history) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_item_texts). | ||||
DATA(ld_item_texts) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_header_texts). | ||||
DATA(ld_header_texts) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_services). | ||||
DATA(ld_services) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_confirmations). | ||||
DATA(ld_confirmations) | = ' '. | |||
Search for further information about these or an SAP related objects