Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hide screen generated by a FM

Former Member
0 Likes
778

Hi experts,

I created a Form that replace contents in ABAP program dynamically and it works.

the problem is when I call the function "RS_FIND_REPLACE_GLOBAL" a new screen appears asking whit all the occurrences  of the variable I'm looking to replace in the program. I want this operation to be executed in background.

I added "IN BACKGROUND TASK " when calling the function, but it does not replace the variable.
Any help please.

DATA: boolean(1),

         object_type(3).

   DATA: findstring(30),

         findstring_length LIKE sy-fdpos,

         replacestring TYPE rseur-tdreplace,

         replacestring_length LIKE sy-fdpos.

   CONSTANTSfalse LIKE boolean VALUE ' ',

             true  LIKE boolean VALUE 'X'.

* Includetab für FB RS_GET_ALL_INCLUDES

   DATA: BEGIN OF includetab OCCURS 100,

           default LIKE sy-repid,

         END OF includetab.

   DATA: BEGIN OF enqtab OCCURS 50,

           pgm LIKE sy-repid,

           st,                            "S=Source / T=Textpool

           noupd,                         "No Update for this Member!

           text,

         END OF enqtab.

   DATA: BEGIN OF objs_to_scan OCCURS 0,

         mark(1),

         program LIKE sy-repid,

         name(61),

         progtype(1),

       END OF objs_to_scan.

   DATA: seokey TYPE seocpdkey.

   objs_to_scan-mark = objs_to_scan-progtype  = 'X'.

   objs_to_scan-program = p_prgm. "rs38m-programm.

   APPEND objs_to_scan.

   object_type = 'R'.

   LOOP AT objs_to_scan.

     CALL FUNCTION 'RS_ACCESS_PERMISSION'

       EXPORTING

         mode         = 'FREE'

         object       = objs_to_scan-program

         object_class = 'ABAP'.

   ENDLOOP.

   CLEAR ds_correction.

   LOOP AT t_correction FROM sy-tabix INTO ds_correction.

     findstring            = ds_correction-name_var.

     findstring_length     = strlen( findstring ).

     replacestring         = ds_correction-name_cor.

     replacestring_length  = strlen( replacestring ).

   ENDLOOP.

   CALL FUNCTION 'RS_FIND_REPLACE_GLOBAL'

     EXPORTING

       objecttype           = object_type

       findstring           = findstring

       findstring_length    = findstring_length

       method               = 'STRING'

       exact_spelling       = ' '

       replacestring        = replacestring

       replacestring_length = replacestring_length

       i_find_or_replace    = 'REPLACE'

       monitor_activation   = 'X'

     TABLES

       objecttab            = objs_to_scan

     EXCEPTIONS

       not_found            = 01

       not_executed         = 02

       OTHERS               = 03.



Thank you for your time.

Hi experts,

I created a Form that replace contents in ABAP program dynamically and it works.

the problem is when I call the function "RS_FIND_REPLACE_GLOBAL" a new screen appears asking whit all the occurrences  of the variable I'm looking to replace in the program. I want this operation to be executed in background.

I added "IN BACKGROUND TASK " when calling the function, but it does not replace the variable.
Any help please.

DATA: boolean(1),

         object_type(3).

   DATA: findstring(30),

         findstring_length LIKE sy-fdpos,

         replacestring TYPE rseur-tdreplace,

         replacestring_length LIKE sy-fdpos.

   CONSTANTSfalse LIKE boolean VALUE ' ',

             true  LIKE boolean VALUE 'X'.

* Includetab für FB RS_GET_ALL_INCLUDES

   DATA: BEGIN OF includetab OCCURS 100,

           default LIKE sy-repid,

         END OF includetab.

   DATA: BEGIN OF enqtab OCCURS 50,

           pgm LIKE sy-repid,

           st,                            "S=Source / T=Textpool

           noupd,                         "No Update for this Member!

           text,

         END OF enqtab.

   DATA: BEGIN OF objs_to_scan OCCURS 0,

         mark(1),

         program LIKE sy-repid,

         name(61),

         progtype(1),

       END OF objs_to_scan.

   DATA: seokey TYPE seocpdkey.

   objs_to_scan-mark = objs_to_scan-progtype  = 'X'.

   objs_to_scan-program = p_prgm. "rs38m-programm.

   APPEND objs_to_scan.

   object_type = 'R'.

   LOOP AT objs_to_scan.

     CALL FUNCTION 'RS_ACCESS_PERMISSION'

       EXPORTING

         mode         = 'FREE'

         object       = objs_to_scan-program

         object_class = 'ABAP'.

   ENDLOOP.

   CLEAR ds_correction.

   LOOP AT t_correction FROM sy-tabix INTO ds_correction.

     findstring            = ds_correction-name_var.

     findstring_length     = strlen( findstring ).

     replacestring         = ds_correction-name_cor.

     replacestring_length  = strlen( replacestring ).

   ENDLOOP.

   CALL FUNCTION 'RS_FIND_REPLACE_GLOBAL'

     EXPORTING

       objecttype           = object_type

       findstring           = findstring

       findstring_length    = findstring_length

       method               = 'STRING'

       exact_spelling       = ' '

       replacestring        = replacestring

       replacestring_length = replacestring_length

       i_find_or_replace    = 'REPLACE'

       monitor_activation   = 'X'

     TABLES

       objecttab            = objs_to_scan

     EXCEPTIONS

       not_found            = 01

       not_executed         = 02

       OTHERS               = 03.



Thank you for your time.

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
707

FM RS_FIND_REPLACE_GLOBAL has the screen as part of the process, and that can't be hidden.

I created a Form that replace contents in ABAP program dynamically and it works.

I'm unable to follow the question. You created a custom program to replace the "words" in the ABAP program and, you mentioned that it works?

Can you specify what you trying to achieve?

Regards,
Naimesh Patel

Read only

0 Likes
707

FM RS_FIND_REPLACE_GLOBAL has the screen as part of the process, and that can't be hidden.


So if the screen can't be hidden, How can I  replace many variables in the same time (not one by one) without calling the FM, going back and recall it again ?!


Thank you for your time.


Kind regards.

EBrudra.