SAP BAPI_PO_GETDETAIL1 Function Module for Detail Information for a Purchase Order
BAPI_PO_GETDETAIL1 is a standard bapi po getdetail1 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Detail Information for a Purchase 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 po getdetail1 FM, simply by entering the name BAPI_PO_GETDETAIL1 into the relevant SAP transaction such as SE37 or SE38.
Function Group: 2012
Program Name: SAPL2012
Main Program: SAPL2012
Appliation area:
Release date: 16-Mar-2005
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PO_GETDETAIL1 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_GETDETAIL1'"Detail Information for a Purchase Order.
EXPORTING
PURCHASEORDER = "Purchasing Document Number
* ACCOUNT_ASSIGNMENT = ' ' "Account Assignment Data
* ITEM_TEXT = ' ' "Item Text
* HEADER_TEXT = ' ' "Header Txt
* DELIVERY_ADDRESS = ' ' "Delivery address
* VERSION = ' ' "Version Management
* SERVICES = ' ' "External Service Data
* SERIALNUMBERS = ' ' "Serial Numbers
* INVOICEPLAN = ' ' "Invoicing Plan
IMPORTING
POHEADER = "Purchase Order Header Data
POEXPIMPHEADER = "Foreign Trade: Export/Import: Header Data
TABLES
* RETURN = "Return Parameter(s)
* POSERVICES = "Communication Structure: Create Service Line
* POSRVACCESSVALUES = "External Services: Account Assignment Distribution for Service Lines
* POTEXTHEADER = "Header Texts
* POTEXTITEM = "Item Texts
* POEXPIMPITEM = "Foreign Trade: Item Data
* POCOMPONENTS = "BAPI Structure for Components
* POSHIPPINGEXP = "Export Structure for Shipping Data
* POHISTORY = "Purchase Order History
* POHISTORY_TOTALS = "Purchase Order History - Totals
* POCONFIRMATION = "Vendor Confirmation
* POITEM = "Purchase Order Item
* ALLVERSIONS = "Version Data
* POPARTNER = "Partner
* EXTENSIONOUT = "ExtensionOut
* SERIALNUMBER = "Serial Numbers in Purchase Order BAPIs
* INVPLANHEADER = "Invoicing Plan: Header Data
* INVPLANITEM = "Invoicing Plan: Item Data
* POHISTORY_MA = "Transfer Structure for Purchase Order History Account Assignment Level
* POADDRDELIVERY = "Addresses for Inward Delivery (Item)
* POSCHEDULE = "Delivery Schedule
* POACCOUNT = "Account Assignment Fields
* POCONDHEADER = "Conditions (header)
* POCOND = "Conditions (Items)
* POLIMITS = "External Services: Limits
* POCONTRACTLIMITS = "Communication Structure: Contract 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_SAPL2012_001 Customer Exit for Creating an Enjoy Purchase Order Using BAPI_PO_CREATE1
EXIT_SAPL2012_002 Customer Exit for Changing an Enjoy Purchase Order Using BAPI_PO_CHANGE
EXIT_SAPL2012_003 Customer Exit for Creating an Enjoy Purchase Order Using BAPI_PO_CREATE1
EXIT_SAPL2012_004 Customer Exit for Changing an Enjoy Purchase Order Using BAPI_PO_CHANGE
IMPORTING Parameters details for BAPI_PO_GETDETAIL1
PURCHASEORDER - Purchasing Document Number
Data type: BAPIMEPOHEADER-PO_NUMBEROptional: No
Call by Reference: No ( called with pass by value option)
ACCOUNT_ASSIGNMENT - Account Assignment Data
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ITEM_TEXT - Item Text
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEADER_TEXT - Header Txt
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DELIVERY_ADDRESS - Delivery address
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VERSION - Version Management
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERVICES - External Service Data
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERIALNUMBERS - Serial Numbers
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INVOICEPLAN - Invoicing Plan
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PO_GETDETAIL1
POHEADER - Purchase Order Header Data
Data type: BAPIMEPOHEADEROptional: No
Call by Reference: No ( called with pass by value option)
POEXPIMPHEADER - Foreign Trade: Export/Import: Header Data
Data type: BAPIEIKPOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_PO_GETDETAIL1
RETURN - Return Parameter(s)
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
POSERVICES - Communication Structure: Create Service Line
Data type: BAPIESLLCOptional: Yes
Call by Reference: Yes
POSRVACCESSVALUES - External Services: Account Assignment Distribution for Service Lines
Data type: BAPIESKLCOptional: Yes
Call by Reference: Yes
POTEXTHEADER - Header Texts
Data type: BAPIMEPOTEXTHEADEROptional: Yes
Call by Reference: Yes
POTEXTITEM - Item Texts
Data type: BAPIMEPOTEXTOptional: Yes
Call by Reference: Yes
POEXPIMPITEM - Foreign Trade: Item Data
Data type: BAPIEIPOOptional: Yes
Call by Reference: Yes
POCOMPONENTS - BAPI Structure for Components
Data type: BAPIMEPOCOMPONENTOptional: Yes
Call by Reference: Yes
POSHIPPINGEXP - Export Structure for Shipping Data
Data type: BAPIMEPOSHIPPEXPOptional: Yes
Call by Reference: Yes
POHISTORY - Purchase Order History
Data type: BAPIEKBEOptional: Yes
Call by Reference: Yes
POHISTORY_TOTALS - Purchase Order History - Totals
Data type: BAPIEKBESOptional: Yes
Call by Reference: Yes
POCONFIRMATION - Vendor Confirmation
Data type: BAPIEKESOptional: Yes
Call by Reference: Yes
POITEM - Purchase Order Item
Data type: BAPIMEPOITEMOptional: Yes
Call by Reference: Yes
ALLVERSIONS - Version Data
Data type: BAPIMEDCM_ALLVERSIONSOptional: Yes
Call by Reference: Yes
POPARTNER - Partner
Data type: BAPIEKKOPOptional: Yes
Call by Reference: Yes
EXTENSIONOUT - ExtensionOut
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
SERIALNUMBER - Serial Numbers in Purchase Order BAPIs
Data type: BAPIMEPOSERIALNOOptional: Yes
Call by Reference: Yes
INVPLANHEADER - Invoicing Plan: Header Data
Data type: BAPI_INVOICE_PLAN_HEADEROptional: Yes
Call by Reference: Yes
INVPLANITEM - Invoicing Plan: Item Data
Data type: BAPI_INVOICE_PLAN_ITEMOptional: Yes
Call by Reference: Yes
POHISTORY_MA - Transfer Structure for Purchase Order History Account Assignment Level
Data type: BAPIEKBE_MAOptional: Yes
Call by Reference: Yes
POADDRDELIVERY - Addresses for Inward Delivery (Item)
Data type: BAPIMEPOADDRDELIVERYOptional: Yes
Call by Reference: Yes
POSCHEDULE - Delivery Schedule
Data type: BAPIMEPOSCHEDULEOptional: Yes
Call by Reference: Yes
POACCOUNT - Account Assignment Fields
Data type: BAPIMEPOACCOUNTOptional: Yes
Call by Reference: Yes
POCONDHEADER - Conditions (header)
Data type: BAPIMEPOCONDHEADEROptional: Yes
Call by Reference: Yes
POCOND - Conditions (Items)
Data type: BAPIMEPOCONDOptional: Yes
Call by Reference: Yes
POLIMITS - External Services: Limits
Data type: BAPIESUHCOptional: Yes
Call by Reference: Yes
POCONTRACTLIMITS - Communication Structure: Contract Limits
Data type: BAPIESUCCOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_PO_GETDETAIL1 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_poheader | TYPE BAPIMEPOHEADER, " | |||
lv_purchaseorder | TYPE BAPIMEPOHEADER-PO_NUMBER, " | |||
lt_poservices | TYPE STANDARD TABLE OF BAPIESLLC, " | |||
lt_posrvaccessvalues | TYPE STANDARD TABLE OF BAPIESKLC, " | |||
lt_potextheader | TYPE STANDARD TABLE OF BAPIMEPOTEXTHEADER, " | |||
lt_potextitem | TYPE STANDARD TABLE OF BAPIMEPOTEXT, " | |||
lt_poexpimpitem | TYPE STANDARD TABLE OF BAPIEIPO, " | |||
lt_pocomponents | TYPE STANDARD TABLE OF BAPIMEPOCOMPONENT, " | |||
lt_poshippingexp | TYPE STANDARD TABLE OF BAPIMEPOSHIPPEXP, " | |||
lt_pohistory | TYPE STANDARD TABLE OF BAPIEKBE, " | |||
lt_pohistory_totals | TYPE STANDARD TABLE OF BAPIEKBES, " | |||
lt_poconfirmation | TYPE STANDARD TABLE OF BAPIEKES, " | |||
lt_poitem | TYPE STANDARD TABLE OF BAPIMEPOITEM, " | |||
lv_poexpimpheader | TYPE BAPIEIKP, " | |||
lv_account_assignment | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_allversions | TYPE STANDARD TABLE OF BAPIMEDCM_ALLVERSIONS, " | |||
lt_popartner | TYPE STANDARD TABLE OF BAPIEKKOP, " | |||
lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
lt_serialnumber | TYPE STANDARD TABLE OF BAPIMEPOSERIALNO, " | |||
lt_invplanheader | TYPE STANDARD TABLE OF BAPI_INVOICE_PLAN_HEADER, " | |||
lt_invplanitem | TYPE STANDARD TABLE OF BAPI_INVOICE_PLAN_ITEM, " | |||
lt_pohistory_ma | TYPE STANDARD TABLE OF BAPIEKBE_MA, " | |||
lv_item_text | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_poaddrdelivery | TYPE STANDARD TABLE OF BAPIMEPOADDRDELIVERY, " | |||
lt_poschedule | TYPE STANDARD TABLE OF BAPIMEPOSCHEDULE, " | |||
lv_header_text | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_poaccount | TYPE STANDARD TABLE OF BAPIMEPOACCOUNT, " | |||
lv_delivery_address | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lv_version | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_pocondheader | TYPE STANDARD TABLE OF BAPIMEPOCONDHEADER, " | |||
lt_pocond | TYPE STANDARD TABLE OF BAPIMEPOCOND, " | |||
lv_services | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_polimits | TYPE STANDARD TABLE OF BAPIESUHC, " | |||
lv_serialnumbers | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lv_invoiceplan | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_pocontractlimits | TYPE STANDARD TABLE OF BAPIESUCC. " |
  CALL FUNCTION 'BAPI_PO_GETDETAIL1' "Detail Information for a Purchase Order |
EXPORTING | ||
PURCHASEORDER | = lv_purchaseorder | |
ACCOUNT_ASSIGNMENT | = lv_account_assignment | |
ITEM_TEXT | = lv_item_text | |
HEADER_TEXT | = lv_header_text | |
DELIVERY_ADDRESS | = lv_delivery_address | |
VERSION | = lv_version | |
SERVICES | = lv_services | |
SERIALNUMBERS | = lv_serialnumbers | |
INVOICEPLAN | = lv_invoiceplan | |
IMPORTING | ||
POHEADER | = lv_poheader | |
POEXPIMPHEADER | = lv_poexpimpheader | |
TABLES | ||
RETURN | = lt_return | |
POSERVICES | = lt_poservices | |
POSRVACCESSVALUES | = lt_posrvaccessvalues | |
POTEXTHEADER | = lt_potextheader | |
POTEXTITEM | = lt_potextitem | |
POEXPIMPITEM | = lt_poexpimpitem | |
POCOMPONENTS | = lt_pocomponents | |
POSHIPPINGEXP | = lt_poshippingexp | |
POHISTORY | = lt_pohistory | |
POHISTORY_TOTALS | = lt_pohistory_totals | |
POCONFIRMATION | = lt_poconfirmation | |
POITEM | = lt_poitem | |
ALLVERSIONS | = lt_alltersions | |
POPARTNER | = lt_popartner | |
EXTENSIONOUT | = lt_extensionout | |
SERIALNUMBER | = lt_serialnumber | |
INVPLANHEADER | = lt_invplanheader | |
INVPLANITEM | = lt_invplanitem | |
POHISTORY_MA | = lt_pohistory_ma | |
POADDRDELIVERY | = lt_poaddrdelivery | |
POSCHEDULE | = lt_poschedule | |
POACCOUNT | = lt_poaccount | |
POCONDHEADER | = lt_pocondheader | |
POCOND | = lt_pocond | |
POLIMITS | = lt_polimits | |
POCONTRACTLIMITS | = lt_pocontractlimits | |
. " BAPI_PO_GETDETAIL1 |
ABAP code using 7.40 inline data declarations to call FM BAPI_PO_GETDETAIL1
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 BAPIMEPOHEADER INTO @DATA(ld_purchaseorder). | ||||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_account_assignment). | ||||
DATA(ld_account_assignment) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_item_text). | ||||
DATA(ld_item_text) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_header_text). | ||||
DATA(ld_header_text) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_delivery_address). | ||||
DATA(ld_delivery_address) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_version). | ||||
DATA(ld_version) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_services). | ||||
DATA(ld_services) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_serialnumbers). | ||||
DATA(ld_serialnumbers) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_invoiceplan). | ||||
DATA(ld_invoiceplan) | = ' '. | |||
Search for further information about these or an SAP related objects