Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Internal Table

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

former_member195698
Active Contributor
0 Kudos

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