SAP RM_SAVE_HIST_STATE_OF_DATA Function Module for RM: Speichern eines Datenstandes auf die Datenbank (SFGDT-Tabellen)
RM_SAVE_HIST_STATE_OF_DATA is a standard rm save hist state of 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 RM: Speichern eines Datenstandes auf die Datenbank (SFGDT-Tabellen) 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 rm save hist state of data FM, simply by entering the name RM_SAVE_HIST_STATE_OF_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: JBRB
Program Name: SAPLJBRB
Main Program: SAPLJBRB
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RM_SAVE_HIST_STATE_OF_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 'RM_SAVE_HIST_STATE_OF_DATA'"RM: Speichern eines Datenstandes auf die Datenbank (SFGDT-Tabellen).
EXPORTING
HIST_STATE_ID = "ID des zu sichernden Datenstandes
* DATE = SY-DATUM "Selektionsdatum
* KURSART = "
IMPORTING
ERROR_ITAB = "Fehlertabelle
CHANGING
SFGDT = "selektierte Geschäftsdaten
EXCEPTIONS
INPUT_DATA_ERROR = 1 SFGDT_ERROR = 2 DB_INSERT_ERROR = 3
IMPORTING Parameters details for RM_SAVE_HIST_STATE_OF_DATA
HIST_STATE_ID - ID des zu sichernden Datenstandes
Data type: JBRSVKO-SV_STATE_IDOptional: No
Call by Reference: Yes
DATE - Selektionsdatum
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: Yes
KURSART -
Data type: ATRAS-SKURSARTOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RM_SAVE_HIST_STATE_OF_DATA
ERROR_ITAB - Fehlertabelle
Data type: TVEH_ERROR_ITAB_TABOptional: No
Call by Reference: Yes
CHANGING Parameters details for RM_SAVE_HIST_STATE_OF_DATA
SFGDT - selektierte Geschäftsdaten
Data type: TVS_SFGDT_TABOptional: No
Call by Reference: Yes
EXCEPTIONS details
INPUT_DATA_ERROR - Fehler in den Eingangsdaten
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SFGDT_ERROR - Fehler beim Auflösen des SFGDT
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DB_INSERT_ERROR - Fehler beim Schreiben auf die Datenbank
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RM_SAVE_HIST_STATE_OF_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: | ||||
| lv_sfgdt | TYPE TVS_SFGDT_TAB, " | |||
| lv_error_itab | TYPE TVEH_ERROR_ITAB_TAB, " | |||
| lv_hist_state_id | TYPE JBRSVKO-SV_STATE_ID, " | |||
| lv_input_data_error | TYPE JBRSVKO, " | |||
| lv_date | TYPE SY-DATUM, " SY-DATUM | |||
| lv_sfgdt_error | TYPE SY, " | |||
| lv_kursart | TYPE ATRAS-SKURSART, " | |||
| lv_db_insert_error | TYPE ATRAS. " |
|   CALL FUNCTION 'RM_SAVE_HIST_STATE_OF_DATA' "RM: Speichern eines Datenstandes auf die Datenbank (SFGDT-Tabellen) |
| EXPORTING | ||
| HIST_STATE_ID | = lv_hist_state_id | |
| DATE | = lv_date | |
| KURSART | = lv_kursart | |
| IMPORTING | ||
| ERROR_ITAB | = lv_error_itab | |
| CHANGING | ||
| SFGDT | = lv_sfgdt | |
| EXCEPTIONS | ||
| INPUT_DATA_ERROR = 1 | ||
| SFGDT_ERROR = 2 | ||
| DB_INSERT_ERROR = 3 | ||
| . " RM_SAVE_HIST_STATE_OF_DATA | ||
ABAP code using 7.40 inline data declarations to call FM RM_SAVE_HIST_STATE_OF_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 SV_STATE_ID FROM JBRSVKO INTO @DATA(ld_hist_state_id). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_date). | ||||
| DATA(ld_date) | = SY-DATUM. | |||
| "SELECT single SKURSART FROM ATRAS INTO @DATA(ld_kursart). | ||||
Search for further information about these or an SAP related objects