‎2008 Oct 21 1:09 PM
Hi all,
I have an itab and filled it with necessary data and displayed it.
What my requirement is that for example when user entered 5 different werks (plant) to select data, I need to show the stock status of these werks...
And it is not predictable how many werks she will enter to select, it may be 3 or 5 or even more.
How can I arrange my itab to show these info?
Thanks.
deniz.
‎2008 Oct 21 1:21 PM
You need to use dynamic internal table for this. please search in this forum with key work " dynamic internal table ", you can find lot of thread related to that.
a®
‎2008 Oct 21 1:24 PM
Take the werke/plants the person has selected, i.e. 3 out of 5, and save it one range table (itab with values). Use this itab to form an outer loop.
In the inner loop use the itab with all master data and extension WHERE
and form a condition like: WHERE [inner_loop_wa]-WERK EQ [outer_loop_wa]-WERK.
i.e.:
LOOP AT werk_selection_itab INTO werk_selection_wa.
LOOP AT masterdata_itab INTO masterdata_itab_wa WHERE masterdata_itab_wa-werk EQ werk_selection_wa-werk.
...further processing...
+ ...i.e. COLLECT masterdata_itab_wa INTO result_itab.+
ENDLOOP.
ENDLOOP.
Hope that helps a little.
-Norbert