‎2007 Oct 18 4:55 AM
Hi all,
i need to filter a field(account) of one internal table with another 'account' filed that exist in another internal table.
and modify the first internal table accordingly..
how can i achieve this?
requirement given is " Filter the list of accounts by those returned via the GET_ORG_DATA FM for Reconciler, Approver, and Owner "
will this work:
loop at t_items. " first internal table is t_items
read table t_items with key accounts = t_lookup-accounts. " t_lookup - 2nd IT
if syst-subrc = 0.
append t_items.
endif.
endloop.thanks,
points assured
Message was edited by:
maahi verma
‎2007 Oct 18 5:01 AM
Hi,
Here is the correct one:
loop at t_items. " first internal table is t_items
read table t_items with key accounts = t_lookup-accounts. " t_lookup - 2nd IT
if syst-subrc <> 0. " if not found, delete fisrt table data.
delete t_items.
endif.
endloop.
Regards,
‎2007 Oct 18 4:58 AM
As the requirement says, you need to filter the data based upon list of accounts.
Here is a modified pseudo code -
loop at t_items. " first internal table is t_items
<b>read table t_lookups with key accounts = t_items-accounts. </b>
if syst-subrc ne 0.
delete t_items.
endloop.
Hope this helps.
ashish
‎2007 Oct 18 5:06 AM
hi ashish,
t_lookup is the table in which the data is coming from GET_ORG_DATA function module.
and i think we need to filter the data which is not common in both the tables.
‎2007 Oct 18 5:09 AM
requirement given is " Filter the list of accounts by those returned via the GET_ORG_DATA FM for Reconciler, Approver, and Owner "
So this is the reason - we are reading T_LOOKUP table in the T_ITEMS loop and flitering data of T_ITEMS based upon T_LOOKUP.
If entry is not found, delete entry from T_ITEMS.
Hope this is clear.
ashish
‎2007 Oct 18 5:01 AM
Hi,
Here is the correct one:
loop at t_items. " first internal table is t_items
read table t_items with key accounts = t_lookup-accounts. " t_lookup - 2nd IT
if syst-subrc <> 0. " if not found, delete fisrt table data.
delete t_items.
endif.
endloop.
Regards,