SAP RH_FETCH_DATA Function Module for Read PLOG-data
RH_FETCH_DATA is a standard rh fetch data 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 PLOG-data 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 rh fetch data FM, simply by entering the name RH_FETCH_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHDB
Program Name: SAPLRHDB
Main Program: SAPLRHDB
Appliation area: H
Release date: 26-Sep-1999
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function RH_FETCH_DATA 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 'RH_FETCH_DATA'"Read PLOG-data.
EXPORTING
* AEDTM = '00000000' "Change date
* PRIOX = '%' "Priority
* SEQNR = '987' "Sequential number
* SUBTY = ' ' "Subtype
* UNAME = ' ' "Last Changed By
* VARYF = ' ' "Variation field
* VDATA = ' ' "Data
* BEGDA = '19000101' "Start date
* ENDDA = '99991231' "End Date
* HISTO = '%' "Historical record flag
* INFTY = ' ' "Infotype
* ISTAT = ' ' "Status
* OBJID = ' ' "Object ID
OTYPE = "Object type
PLVAR = "Plan version
TABLES
DATA = "Data table of the PLOG records found
EXCEPTIONS
NOT_FOUND = 1
IMPORTING Parameters details for RH_FETCH_DATA
AEDTM - Change date
Data type: PLOG-AEDTMDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRIOX - Priority
Data type: PLOG-PRIOXDefault: '%'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEQNR - Sequential number
Data type: PLOG-SEQNRDefault: '987'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBTY - Subtype
Data type: PLOG-SUBTYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
UNAME - Last Changed By
Data type: PLOG-UNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VARYF - Variation field
Data type: PLOG-VARYFDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VDATA - Data
Data type: WPLOG-VDATADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
BEGDA - Start date
Data type: PLOG-BEGDADefault: '19000101'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENDDA - End Date
Data type: PLOG-ENDDADefault: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)
HISTO - Historical record flag
Data type: PLOG-HISTODefault: '%'
Optional: Yes
Call by Reference: No ( called with pass by value option)
INFTY - Infotype
Data type: PLOG-INFTYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ISTAT - Status
Data type: PLOG-ISTATDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJID - Object ID
Data type: PLOG-OBJIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OTYPE - Object type
Data type: PLOG-OTYPEOptional: No
Call by Reference: No ( called with pass by value option)
PLVAR - Plan version
Data type: PLOG-PLVAROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_FETCH_DATA
DATA - Data table of the PLOG records found
Data type: WPLOGOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - Requested data not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_FETCH_DATA 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_data | TYPE STANDARD TABLE OF WPLOG, " | |||
lv_aedtm | TYPE PLOG-AEDTM, " '00000000' | |||
lv_not_found | TYPE PLOG, " | |||
lv_priox | TYPE PLOG-PRIOX, " '%' | |||
lv_seqnr | TYPE PLOG-SEQNR, " '987' | |||
lv_subty | TYPE PLOG-SUBTY, " SPACE | |||
lv_uname | TYPE PLOG-UNAME, " SPACE | |||
lv_varyf | TYPE PLOG-VARYF, " SPACE | |||
lv_vdata | TYPE WPLOG-VDATA, " SPACE | |||
lv_begda | TYPE PLOG-BEGDA, " '19000101' | |||
lv_endda | TYPE PLOG-ENDDA, " '99991231' | |||
lv_histo | TYPE PLOG-HISTO, " '%' | |||
lv_infty | TYPE PLOG-INFTY, " SPACE | |||
lv_istat | TYPE PLOG-ISTAT, " SPACE | |||
lv_objid | TYPE PLOG-OBJID, " SPACE | |||
lv_otype | TYPE PLOG-OTYPE, " | |||
lv_plvar | TYPE PLOG-PLVAR. " |
  CALL FUNCTION 'RH_FETCH_DATA' "Read PLOG-data |
EXPORTING | ||
AEDTM | = lv_aedtm | |
PRIOX | = lv_priox | |
SEQNR | = lv_seqnr | |
SUBTY | = lv_subty | |
UNAME | = lv_uname | |
VARYF | = lv_varyf | |
VDATA | = lv_vdata | |
BEGDA | = lv_begda | |
ENDDA | = lv_endda | |
HISTO | = lv_histo | |
INFTY | = lv_infty | |
ISTAT | = lv_istat | |
OBJID | = lv_objid | |
OTYPE | = lv_otype | |
PLVAR | = lv_plvar | |
TABLES | ||
DATA | = lt_data | |
EXCEPTIONS | ||
NOT_FOUND = 1 | ||
. " RH_FETCH_DATA |
ABAP code using 7.40 inline data declarations to call FM RH_FETCH_DATA
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 AEDTM FROM PLOG INTO @DATA(ld_aedtm). | ||||
DATA(ld_aedtm) | = '00000000'. | |||
"SELECT single PRIOX FROM PLOG INTO @DATA(ld_priox). | ||||
DATA(ld_priox) | = '%'. | |||
"SELECT single SEQNR FROM PLOG INTO @DATA(ld_seqnr). | ||||
DATA(ld_seqnr) | = '987'. | |||
"SELECT single SUBTY FROM PLOG INTO @DATA(ld_subty). | ||||
DATA(ld_subty) | = ' '. | |||
"SELECT single UNAME FROM PLOG INTO @DATA(ld_uname). | ||||
DATA(ld_uname) | = ' '. | |||
"SELECT single VARYF FROM PLOG INTO @DATA(ld_varyf). | ||||
DATA(ld_varyf) | = ' '. | |||
"SELECT single VDATA FROM WPLOG INTO @DATA(ld_vdata). | ||||
DATA(ld_vdata) | = ' '. | |||
"SELECT single BEGDA FROM PLOG INTO @DATA(ld_begda). | ||||
DATA(ld_begda) | = '19000101'. | |||
"SELECT single ENDDA FROM PLOG INTO @DATA(ld_endda). | ||||
DATA(ld_endda) | = '99991231'. | |||
"SELECT single HISTO FROM PLOG INTO @DATA(ld_histo). | ||||
DATA(ld_histo) | = '%'. | |||
"SELECT single INFTY FROM PLOG INTO @DATA(ld_infty). | ||||
DATA(ld_infty) | = ' '. | |||
"SELECT single ISTAT FROM PLOG INTO @DATA(ld_istat). | ||||
DATA(ld_istat) | = ' '. | |||
"SELECT single OBJID FROM PLOG INTO @DATA(ld_objid). | ||||
DATA(ld_objid) | = ' '. | |||
"SELECT single OTYPE FROM PLOG INTO @DATA(ld_otype). | ||||
"SELECT single PLVAR FROM PLOG INTO @DATA(ld_plvar). | ||||
Search for further information about these or an SAP related objects