11-30-2007 1:23 PM
Hi All,
I have to filter the records from Final table T_OUTPUT based on the selection criteria, need to delete record sin T_OUTPUT if the PO number is not in T_TEMP and T_TEMP is not initial. Similarly delete records if the PO number is not in T_TEMP1 and T_TEMP1 is not initial and delete records if the PO number is not in T_TEMP2 and T_TEMP2 is not initial.
Can any one provide logic for this..
thanks in advance
Khan
11-30-2007 1:32 PM
Hi,
This is somthing like this :
loop at T_OUTPUT
...
clear t_temp.
read table t_temp with key po = t_ouptut-po
if sy-subrc ne 0.
delete t_output.
modify t_output.
endif.
...
endloop.
Hope this helps,
Erwan
11-30-2007 1:32 PM
2 ways.
1) Loop at the table T_OUTPUT.
read table t_temp with key as PO number
if no record is found then delete the entry from T_OUTPUT
continue
read table t_temp1 with key as PO number
if no record is found then delete the entry from T_OUTPUT
continue
read table t_temp2 with key as PO number
if no record is found then delete the entry from T_OUTPUT
endloop.
2) Preapare a RANGE for PO numbers in T_TEMP, T_TEMP1,T_TEMP2
then use statement
DELETE T_OUPUT WHERE NOT PO IN RANGE.
Regards,
Abhishek