SAP BAPI_PR_GETDETAIL Function Module for Get Details for One MEREQ Object
BAPI_PR_GETDETAIL is a standard bapi pr 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 Get Details for One MEREQ Object 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 pr getdetail FM, simply by entering the name BAPI_PR_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: 2105
Program Name: SAPL2105
Main Program: SAPL2105
Appliation area:
Release date: 17-Mar-2005
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_PR_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_PR_GETDETAIL'"Get Details for One MEREQ Object.
EXPORTING
NUMBER = "Purchase Requisition Number
* ACCOUNT_ASSIGNMENT = ' ' "Account Assignment Data
* ITEM_TEXT = ' ' "Item Text
* HEADER_TEXT = ' ' "Header Txt
* DELIVERY_ADDRESS = ' ' "Delivery address
* VERSION = ' ' "Version Management
* SC_COMPONENTS = ' ' "Subcontracting Components
* SERIAL_NUMBERS = ' ' "Serial Numbers
* SERVICES = ' ' "External Services
IMPORTING
PRHEADER = "Transfer Structure for Enjoy Purchase Req. - Header
TABLES
* RETURN = "Return Parameter(s)
* SERIALNUMBERS = "Serial Numbers in Purchase Requisition BAPI
* SERVICEOUTLINE = "BAPI Structure for Outline of Service Package
* SERVICELINES = "BAPI Structure for Service Lines
* SERVICELIMIT = "BAPI Structure for Limit of Service Package
* SERVICECONTRACTLIMITS = "BAPI Structure for Contract Limits
* SERVICEACCOUNT = "BAPI Structure for Account Assignment to Services and Limits
* SERVICELONGTEXTS = "BAPI Structure for Long Texts in Service Package
* PRITEM = "Transfer Structure for Enjoy Purchase Req. - Item Data
* PRACCOUNT = "Transfer Structure for Enjoy Purchase Req. - Acct Assignment
* PRADDRDELIVERY = "PO Item: Address Structure BAPIADDR1 for Inbound Delivery
* PRITEMTEXT = "Transfer Structure for Enjoy Purchase Req. - Item Text
* PRHEADERTEXT = "Change Toolbar for Enjoy Purchase Req. - Header Text
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* ALLVERSIONS = "Version Management - All Version Data
* PRCOMPONENTS = "BAPI Structure for Components
IMPORTING Parameters details for BAPI_PR_GETDETAIL
NUMBER - Purchase Requisition Number
Data type: BAPIMEREQHEADER-PREQ_NOOptional: 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)
SC_COMPONENTS - Subcontracting Components
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERIAL_NUMBERS - Serial Numbers
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERVICES - External Services
Data type: BAPIMMPARA-SELECTIONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_PR_GETDETAIL
PRHEADER - Transfer Structure for Enjoy Purchase Req. - Header
Data type: BAPIMEREQHEADEROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_PR_GETDETAIL
RETURN - Return Parameter(s)
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
SERIALNUMBERS - Serial Numbers in Purchase Requisition BAPI
Data type: BAPIMEREQSERIALNOOptional: Yes
Call by Reference: Yes
SERVICEOUTLINE - BAPI Structure for Outline of Service Package
Data type: BAPI_SRV_OUTLINEOptional: Yes
Call by Reference: Yes
SERVICELINES - BAPI Structure for Service Lines
Data type: BAPI_SRV_SERVICE_LINEOptional: Yes
Call by Reference: Yes
SERVICELIMIT - BAPI Structure for Limit of Service Package
Data type: BAPI_SRV_LIMIT_DATAOptional: Yes
Call by Reference: Yes
SERVICECONTRACTLIMITS - BAPI Structure for Contract Limits
Data type: BAPI_SRV_CONTRACT_LIMITSOptional: Yes
Call by Reference: Yes
SERVICEACCOUNT - BAPI Structure for Account Assignment to Services and Limits
Data type: BAPI_SRV_ACC_DATAOptional: Yes
Call by Reference: Yes
SERVICELONGTEXTS - BAPI Structure for Long Texts in Service Package
Data type: BAPI_SRV_LONGTEXTSOptional: Yes
Call by Reference: Yes
PRITEM - Transfer Structure for Enjoy Purchase Req. - Item Data
Data type: BAPIMEREQITEMOptional: Yes
Call by Reference: Yes
PRACCOUNT - Transfer Structure for Enjoy Purchase Req. - Acct Assignment
Data type: BAPIMEREQACCOUNTOptional: Yes
Call by Reference: Yes
PRADDRDELIVERY - PO Item: Address Structure BAPIADDR1 for Inbound Delivery
Data type: BAPIMERQADDRDELIVERYOptional: Yes
Call by Reference: Yes
PRITEMTEXT - Transfer Structure for Enjoy Purchase Req. - Item Text
Data type: BAPIMEREQITEMTEXTOptional: Yes
Call by Reference: Yes
PRHEADERTEXT - Change Toolbar for Enjoy Purchase Req. - Header Text
Data type: BAPIMEREQHEADTEXTOptional: Yes
Call by Reference: Yes
EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
ALLVERSIONS - Version Management - All Version Data
Data type: BAPIMEDCM_ALLVERSIONSOptional: Yes
Call by Reference: Yes
PRCOMPONENTS - BAPI Structure for Components
Data type: BAPIMEREQCOMPONENTOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_PR_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_number | TYPE BAPIMEREQHEADER-PREQ_NO, " | |||
lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
lv_prheader | TYPE BAPIMEREQHEADER, " | |||
lt_serialnumbers | TYPE STANDARD TABLE OF BAPIMEREQSERIALNO, " | |||
lt_serviceoutline | TYPE STANDARD TABLE OF BAPI_SRV_OUTLINE, " | |||
lt_servicelines | TYPE STANDARD TABLE OF BAPI_SRV_SERVICE_LINE, " | |||
lt_servicelimit | TYPE STANDARD TABLE OF BAPI_SRV_LIMIT_DATA, " | |||
lt_servicecontractlimits | TYPE STANDARD TABLE OF BAPI_SRV_CONTRACT_LIMITS, " | |||
lt_serviceaccount | TYPE STANDARD TABLE OF BAPI_SRV_ACC_DATA, " | |||
lt_servicelongtexts | TYPE STANDARD TABLE OF BAPI_SRV_LONGTEXTS, " | |||
lt_pritem | TYPE STANDARD TABLE OF BAPIMEREQITEM, " | |||
lv_account_assignment | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lv_item_text | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_praccount | TYPE STANDARD TABLE OF BAPIMEREQACCOUNT, " | |||
lv_header_text | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_praddrdelivery | TYPE STANDARD TABLE OF BAPIMERQADDRDELIVERY, " | |||
lt_pritemtext | TYPE STANDARD TABLE OF BAPIMEREQITEMTEXT, " | |||
lv_delivery_address | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lv_version | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_prheadertext | TYPE STANDARD TABLE OF BAPIMEREQHEADTEXT, " | |||
lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
lv_sc_components | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_allversions | TYPE STANDARD TABLE OF BAPIMEDCM_ALLVERSIONS, " | |||
lv_serial_numbers | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lv_services | TYPE BAPIMMPARA-SELECTION, " SPACE | |||
lt_prcomponents | TYPE STANDARD TABLE OF BAPIMEREQCOMPONENT. " |
  CALL FUNCTION 'BAPI_PR_GETDETAIL' "Get Details for One MEREQ Object |
EXPORTING | ||
NUMBER | = lv_number | |
ACCOUNT_ASSIGNMENT | = lv_account_assignment | |
ITEM_TEXT | = lv_item_text | |
HEADER_TEXT | = lv_header_text | |
DELIVERY_ADDRESS | = lv_delivery_address | |
VERSION | = lv_version | |
SC_COMPONENTS | = lv_sc_components | |
SERIAL_NUMBERS | = lv_serial_numbers | |
SERVICES | = lv_services | |
IMPORTING | ||
PRHEADER | = lv_prheader | |
TABLES | ||
RETURN | = lt_return | |
SERIALNUMBERS | = lt_serialnumbers | |
SERVICEOUTLINE | = lt_serviceoutline | |
SERVICELINES | = lt_servicelines | |
SERVICELIMIT | = lt_servicelimit | |
SERVICECONTRACTLIMITS | = lt_servicecontractlimits | |
SERVICEACCOUNT | = lt_serviceaccount | |
SERVICELONGTEXTS | = lt_servicelongtexts | |
PRITEM | = lt_pritem | |
PRACCOUNT | = lt_praccount | |
PRADDRDELIVERY | = lt_praddrdelivery | |
PRITEMTEXT | = lt_pritemtext | |
PRHEADERTEXT | = lt_prheadertext | |
EXTENSIONOUT | = lt_extensionout | |
ALLVERSIONS | = lt_alltersions | |
PRCOMPONENTS | = lt_prcomponents | |
. " BAPI_PR_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_PR_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 PREQ_NO FROM BAPIMEREQHEADER INTO @DATA(ld_number). | ||||
"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_sc_components). | ||||
DATA(ld_sc_components) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_serial_numbers). | ||||
DATA(ld_serial_numbers) | = ' '. | |||
"SELECT single SELECTION FROM BAPIMMPARA INTO @DATA(ld_services). | ||||
DATA(ld_services) | = ' '. | |||
Search for further information about these or an SAP related objects