‎2007 Jul 20 7:12 PM
hi,
In a program we need to use a loop into an internal table with a where condition is decided on run time.
"Select" from database table is using dynamic where clause and it is working fine.
For the loop part does any one have any idea on this? if we can have dynamic where clause in a loop into internal tab?
Thanks
‎2007 Jul 20 7:36 PM
Hi,
May be you use field-symbols in place of internal table
ASSIGN COMPONENT <ls_cha> OF STRUCTURE <ls_thatcha> TO <l_thatfld>
aRs
‎2007 Jul 20 7:45 PM
Hi,
You can't use 'loop where' dynamically .
Have you already tried to use Ranges and CHECK statement?
Like:
First mount range options;
Loop at <table>.
Check using the range.
endloop.
Maybe it's works for you !!
Marcelo Ramos
‎2007 Sep 03 9:33 AM
hi
good
go through this FM.
CLDY_DYN_SEL_WHERETAB_CREATE
DYNSQL_GENERATE_WHERE_CLAUSE
RH_DYNAMIC_WHERE_BUILD
in the IT_WHERE you need to write the correct conditions, like
IT_WHERE-FIELD1 = 'DATE1 = Sy-DATUM and'.
Append IT_WHERE.
IT_WHERE-FIELD1 = 'DATE2 = Sy-DATUM'.
Append IT_WHERE.
thanks
mrutyun^