Skip to Content
0
Former Member
Apr 08, 2008 at 05:56 PM

Help for dynamic selection

14 Views

Hello guy,

I want to dynamically search for the occurrence of certain words in each data record(each field) in each table. Below is my code

Parameters: p_tabname like dd02l-tabname.


SELECT * FROM dd02l
  INTO  TABLE itab
  WHERE as4local = 'A'
   AND tabname = p_tabname

 LOOP AT itab INTO w_tab.
CREATE DATA ref_itab TYPE STANDARD TABLE OF (w_tab-tabname).
    ASSIGN ref_itab->* TO <fs_itab>.
   
CREATE DATA ref_wa TYPE (w_tab-tabname).
    ASSIGN ref_wa->* TO <fs_wa>.

 SELECT * FROM (w_tab-tabname)
    INTO CORRESPONDING FIELDS OF TABLE <fs_itab>.
   DESCRIBE TABLE  itab. "check if the table contains entries.
   IF sy-tfill > 0.
LOOP AT <fs_itab> INTO <fs_wa>. " loop at each table that contains entries and search for the strings or characters
SEARCH <fs_wa> for 'bbbb_' and '3456*' and '8970*' and '2980*'  "this is not working
* If any of the entries exist in a table, I would like to give out the table name, the field which contains this entry and the dataelement
* of the field that contain the entry

      ENDLOOP.
ENDIF.
 ENDLOOP.

Can some one please show me how to move forward to achieve this?

Thank you

Nadin