Contains pattern in select
I have a requirment in select statement as below.
INTO TABLE it_anla
FOR ALL ENTRIES IN it_asset
WHERE typbz = it_asset-purch. "Contains pattern
IF sy-subrc EQ 0.
SORT it_anla BY typbz anln1 anln2.
i need to select the ANLA table entries which contains the pattern IT_ASSET-purch which is not constant. like it_asset-purch* .
but its giving error if i write like this.
can any one suggest me good way of doing this.
Kuntal Nandi replied
Hi - Best way is using a range table :
"Define Range table and Work area data: i_rng TYPE RANGE OF typbz INITIAL SIZE 0, "table data: wa_wng LIKE LINE OF i_rng " Work area wa_rng-sign = 'E'. wa_rng-option = 'CP' wa_rmg-low = " Put concatenated value " Now use this range table for you selection, as you use select-option, when selecting.