SAP Function Modules

RS_EDTR_REPLACE2 SAP Function module







RS_EDTR_REPLACE2 is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RS_EDTR_REPLACE2 into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SEUR
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RS_EDTR_REPLACE2 - RS EDTR REPLACE2





CALL FUNCTION 'RS_EDTR_REPLACE2' "
  EXPORTING
*   actual_include = SPACE      "               file just edited
*   actual_line = '000000'      "               Type of objects in OBJECTTAB
*   confirm = 'X'               "
*   confirm = 'X'               "               replace with confirmation
*   dynpro_part = 'B'           "               'L'-flow logic / 'F'-field list / B-both
*   exact_spelling = SPACE      "               Type of objects in OBJECTTAB
*   findstring = SPACE          "               Search string
*   method = SPACE              "
*   method = SPACE              "               STRING/WORD/LITERAL/FORM/PBO/PAI/DATA/TABLES/...
    objecttype =                "               Category of the objects: R/M/O/U/E/Y/T/F/G
*   replacestring = SPACE       " rstxp-tdreplace  Type of objects in OBJECTTAB
*   ddictable = SPACE           " dd02l-tabname  Type of objects in OBJECTTAB
  TABLES
    objecttab =                 "               Table of the objects to be scanned
  EXCEPTIONS
    NOT_EXECUTED = 1            "               Type of objects in OBJECTTAB
    NOT_FOUND = 2               "               Search was unsuccessful
    .  "  RS_EDTR_REPLACE2

ABAP code example for Function Module RS_EDTR_REPLACE2





The ABAP code below is a full code listing to execute function module RS_EDTR_REPLACE2 including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_objecttab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_objecttab  LIKE LINE OF it_objecttab .

DATA(ld_actual_include) = 'some text here'.
DATA(ld_actual_line) = 'some text here'.
DATA(ld_confirm) = 'some text here'.
DATA(ld_confirm) = 'some text here'.
DATA(ld_dynpro_part) = 'some text here'.
DATA(ld_exact_spelling) = 'some text here'.
DATA(ld_findstring) = 'some text here'.
DATA(ld_method) = 'some text here'.
DATA(ld_method) = 'some text here'.
DATA(ld_objecttype) = 'some text here'.

DATA(ld_replacestring) = some text here

SELECT single TABNAME
FROM DD02L
INTO @DATA(ld_ddictable).


"populate fields of struture and append to itab
append wa_objecttab to it_objecttab. . CALL FUNCTION 'RS_EDTR_REPLACE2' EXPORTING * actual_include = ld_actual_include * actual_line = ld_actual_line * confirm = ld_confirm * confirm = ld_confirm * dynpro_part = ld_dynpro_part * exact_spelling = ld_exact_spelling * findstring = ld_findstring * method = ld_method * method = ld_method objecttype = ld_objecttype * replacestring = ld_replacestring * ddictable = ld_ddictable TABLES objecttab = it_objecttab EXCEPTIONS NOT_EXECUTED = 1 NOT_FOUND = 2 . " RS_EDTR_REPLACE2
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_actual_include  TYPE STRING ,
it_objecttab  TYPE STANDARD TABLE OF STRING ,
wa_objecttab  LIKE LINE OF it_objecttab,
ld_actual_line  TYPE STRING ,
ld_confirm  TYPE STRING ,
ld_confirm  TYPE STRING ,
ld_dynpro_part  TYPE STRING ,
ld_exact_spelling  TYPE STRING ,
ld_findstring  TYPE STRING ,
ld_method  TYPE STRING ,
ld_method  TYPE STRING ,
ld_objecttype  TYPE STRING ,
ld_replacestring  TYPE RSTXP-TDREPLACE ,
ld_ddictable  TYPE DD02L-TABNAME .

ld_actual_include = 'some text here'.

"populate fields of struture and append to itab
append wa_objecttab to it_objecttab.
ld_actual_line = 'some text here'.
ld_confirm = 'some text here'.
ld_confirm = 'some text here'.
ld_dynpro_part = 'some text here'.
ld_exact_spelling = 'some text here'.
ld_findstring = 'some text here'.
ld_method = 'some text here'.
ld_method = 'some text here'.
ld_objecttype = 'some text here'.

ld_replacestring = some text here

SELECT single TABNAME
FROM DD02L
INTO ld_ddictable.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RS_EDTR_REPLACE2 or its description.