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.
you might have to create a range table.. and populate it and use that range in the select...
loop at it_asset into wa_asset. ra-sign = 'E'. ra-option = 'CP' concatenate '*' it_asset-purch '*' into ra-low. append it_asset from wa_asset. clear: wa_asset. endloop. select,,,,, .. where t&*( in ra. "ra is the range table.
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.