SAP RRS_REPLACE_VAR_FROM_VAR Function Module for Replaces variable from another variable









RRS_REPLACE_VAR_FROM_VAR is a standard rrs replace var from var SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Replaces variable from another variable 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 rrs replace var from var FM, simply by entering the name RRS_REPLACE_VAR_FROM_VAR into the relevant SAP transaction such as SE37 or SE38.

Function Group: RRS2
Program Name: SAPLRRS2
Main Program: SAPLRRS3
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RRS_REPLACE_VAR_FROM_VAR 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 'RRS_REPLACE_VAR_FROM_VAR'"Replaces variable from another variable
EXPORTING
I_INFOCUBE = "InfoProvider
I_SRDATE = "Current Date of Application Server
* I_MOSTRECENT = RS_C_FALSE "Boolean
I_T_RANGE_SOURCE = "Data of Source Variable
I_IOBJNM_SOURCE = "InfoObject
I_SX_VAR = "Table of All Variables
* I_CMPCHAVL = ' ' "Dim: Field for Any Characteristic Value
* I_INTLEN = 0 "

IMPORTING
E_T_RANGE = "Range Expanded Around SID
E_FIGURE = "DecFloat
.




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_SAPLRRS2_001 BW: Moving characteristic values

IMPORTING Parameters details for RRS_REPLACE_VAR_FROM_VAR

I_INFOCUBE - InfoProvider

Data type: RSINFOPROV
Optional: No
Call by Reference: Yes

I_SRDATE - Current Date of Application Server

Data type: SY-DATUM
Optional: No
Call by Reference: Yes

I_MOSTRECENT - Boolean

Data type: RS_BOOL
Default: RS_C_FALSE
Optional: Yes
Call by Reference: Yes

I_T_RANGE_SOURCE - Data of Source Variable

Data type: RSDD_T_RANGE
Optional: No
Call by Reference: Yes

I_IOBJNM_SOURCE - InfoObject

Data type: RSIOBJNM
Optional: No
Call by Reference: Yes

I_SX_VAR - Table of All Variables

Data type: RRO01_SX_VAR
Optional: No
Call by Reference: Yes

I_CMPCHAVL - Dim: Field for Any Characteristic Value

Data type: RSCHAVL
Default: SPACE
Optional: Yes
Call by Reference: Yes

I_INTLEN -

Data type: I
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for RRS_REPLACE_VAR_FROM_VAR

E_T_RANGE - Range Expanded Around SID

Data type: RSDD_T_RANGE
Optional: No
Call by Reference: Yes

E_FIGURE - DecFloat

Data type: RSROA_DF
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for RRS_REPLACE_VAR_FROM_VAR 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_e_t_range  TYPE RSDD_T_RANGE, "   
lv_i_infocube  TYPE RSINFOPROV, "   
lv_e_figure  TYPE RSROA_DF, "   
lv_i_srdate  TYPE SY-DATUM, "   
lv_i_mostrecent  TYPE RS_BOOL, "   RS_C_FALSE
lv_i_t_range_source  TYPE RSDD_T_RANGE, "   
lv_i_iobjnm_source  TYPE RSIOBJNM, "   
lv_i_sx_var  TYPE RRO01_SX_VAR, "   
lv_i_cmpchavl  TYPE RSCHAVL, "   SPACE
lv_i_intlen  TYPE I. "   0

  CALL FUNCTION 'RRS_REPLACE_VAR_FROM_VAR'  "Replaces variable from another variable
    EXPORTING
         I_INFOCUBE = lv_i_infocube
         I_SRDATE = lv_i_srdate
         I_MOSTRECENT = lv_i_mostrecent
         I_T_RANGE_SOURCE = lv_i_t_range_source
         I_IOBJNM_SOURCE = lv_i_iobjnm_source
         I_SX_VAR = lv_i_sx_var
         I_CMPCHAVL = lv_i_cmpchavl
         I_INTLEN = lv_i_intlen
    IMPORTING
         E_T_RANGE = lv_e_t_range
         E_FIGURE = lv_e_figure
. " RRS_REPLACE_VAR_FROM_VAR




ABAP code using 7.40 inline data declarations to call FM RRS_REPLACE_VAR_FROM_VAR

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 DATUM FROM SY INTO @DATA(ld_i_srdate).
 
DATA(ld_i_mostrecent) = RS_C_FALSE.
 
 
 
 
DATA(ld_i_cmpchavl) = ' '.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!