Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: Dynamic SELECT

$
0
0

Hi,


Something like this, via creating reference and de-referencing it to field-symbol:

 

DATA if_table_name TYPE string VALUE 'T100' .

DATA it_cond TYPE STANDARD TABLE OF string .
DATA it_from TYPE STANDARD TABLE OF string .
DATA rf_into TYPE REF TO data .
FIELD-SYMBOLS: <fs_into> TYPE any .

CREATE DATA rf_into TYPE (if_table_name) .
ASSIGN rf_into->* TO <fs_into> .

APPEND if_table_name TO it_from .

APPEND 'SPRSL = SY-LANGU AND' TO it_cond .
APPEND 'ARBGB = ''00'' AND' TO it_cond .
APPEND 'MSGNR = ''001''' TO it_cond .

SELECT SINGLE * FROM (it_from) INTO <fs_into>
  WHERE (it_cond) .

 

Also, check outSELECT, Dynamic Token Specificationin ABAP Docu. The type specification for creating data reference can come from RTTI.


I'm sure you'd have found it yourself, had you searched a bit more

 

cheers

Janis


Viewing all articles
Browse latest Browse all 9069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>