* define the internal table which will
* hold the where clause
data w_clause_b(80) occurs 10 with header line.
data : count_rec type i.
* select the transaction which will be * used in the select statement
select-options: s_trx for tstc-tcode no intervals obligatory
default 'va01'.
move 'tcode in s_trx' to where_tab.
append where_tab
clear where_tab.
SELECT COUNT( * ) INTO COUNT_REC
FROM ZALEPRSTAT
WHERE STARTDATE GE RAW_DATE_FR
AND STARTDATE LE RAW_DATE_TO
AND (WHERE_TAB).
It works when I use:
concatenate 'tcode =' '''VA01''' into where_tab separated by space.
I have also tried various combinations including:
concatenate 'tcode in' s_trx into where_tab separated by space.
Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial DirectorI can't tell why yours isn't working! I've created the following small program which does pretty much what yours does and it works fine.
TABLES: tstc.
DATA where_tab(80) OCCURS 10 WITH HEADER LINE.
DATA : count_rec TYPE i.
SELECT-OPTIONS: s_trx FOR tstc-tcode NO INTERVALS OBLIGATORY
DEFAULT 'va01'.
MOVE 'tcode in s_trx' TO where_tab.
APPEND where_tab.
CLEAR where_tab.
SELECT COUNT( * ) INTO count_rec
FROM tstc.
WHERE (where_tab).
WRITE: count_rec.
This was first published in July 2006