2008 Jun 09 7:44 PM
hi,
how to use a where condition on a dynamic internal table.
existing code as shown below is taking enormous processing time.
loop at itab.
loop at dynamic_hased_tab in to <fs_dynamic_tab>
assign component 'field1' of structure <fs_dynamic_tab> to <fs_field1>
if itab-field1 = <fs_field1>
****logic
endif.
endloop.
endloop.
-
loop at itab.
loop at dynamic_hased_tab where...
processing logic
endloop.
endloop.
instead of above code i want something like this.is it possible. please let me know if you have any ideas on how to performance tune the code.
Thanks,
KK.
hi,
how to use a where condition on a dynamic internal table.
existing code as shown below is taking enormous processing time.
loop at itab.
loop at dynamic_hased_tab in to <fs_dynamic_tab>
assign component 'field1' of structure <fs_dynamic_tab> to <fs_field1>
if itab-field1 = <fs_field1>
****logic
endif.
endloop.
endloop.
-
loop at itab.
loop at dynamic_hased_tab where...
processing logic
endloop.
endloop.
instead of above code i want something like this.is it possible. please let me know if you have any ideas on how to performance tune the code.
Thanks,
KK.
2008 Jun 09 7:56 PM
Hi Kumar,
I think u can not directly write where conditon to the dynamic internal table u need to write the this way as u said
loop at itab.
loop at dynamic_hased_tab in to <fs_dynamic_tab>
assign component 'field1' of structure <fs_dynamic_tab> to <fs_field1>
if itab-field1 = <fs_field1>
------
------
endif.
endloop.
endloop.Please check the below blog:
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
Best regards,
raam
2008 Jun 09 8:15 PM
Hi,
thanks for your prompt response.
if i'm looping and checking fields row by row, it will loop on all records in my dynamic table which means for every entry i will be looping 'n' number of times , n is the no. of records.
is there any way to avoid that.
Thanks,
KK.
2008 Jun 09 9:31 PM
Hello,
See this: [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae].
Regards.
2008 Jun 10 7:01 PM
Hi David,
Thanks for the post .
I didnt find anything specific to my question.
thanks,
KK.
2008 Jun 10 8:12 PM
Have you tried class cl_rs_where ?
Check following link:
/people/ravishankar.rajan/blog/2006/12/21/building-dynamic-sql-statements-using-the-clrswhere-class
G@urav.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |