‎2010 Jul 18 11:06 AM
Hi,
I got an internal table with select-option values. for eg. it_perno with the values I BT 000160 000170.
Now i got another second internal table which is have the person number. Now i need to filter this second internal table based on the values from the select option table. my question is
i can collect all the values from 160 to 170 in a separate table by looping over the select option table. and then based on the values filter the second internal table person number.
But what would be the case if the select option contains both intervals and multiple options. For eg.
I BT 000160 000170.
I EQ 000185.
So can you suggest any good solution, that based on this select option table i need to filter the second internal table Person number.
Thanks in advance.
Regards,
anbu.
‎2010 Jul 19 6:20 AM
Hi,
Can you not use the select-options in the Select query while populating the internal table.
SELECT pernr FROM pa0000 INTO it_tab WHERE pernr IN s_pernr.
If you cannot do this and you do not want to delete the unwanted entries, then you can use the WHERE clause in the LOOP statement to process the specific entries required:
LOOP AT it_tab INTO wa_tab WHERE pernr IN s_pernr.
Regards,
Aparna Alashe.
‎2010 Jul 18 11:19 AM
Hi Anbu,
If you have the SELECT-OPTION table, use it directly in DELETE statement
TABLES SCARR.
SELECT-OPTIONS
: S_CAR FOR SCARR-CARRID.
DATA
: IT_SCARR TYPE TABLE OF SCARR,
WA_SCARR TYPE SCARR.
SELECT *
FROM SCARR
INTO TABLE IT_SCARR.
DELETE IT_SCARR WHERE CARRID NOT IN S_CAR.
LOOP AT IT_SCARR INTO WA_SCARR.
WRITE / wa_scarr-carrid.
ENDLOOP.Regards
‎2010 Jul 19 6:20 AM
Hi,
Can you not use the select-options in the Select query while populating the internal table.
SELECT pernr FROM pa0000 INTO it_tab WHERE pernr IN s_pernr.
If you cannot do this and you do not want to delete the unwanted entries, then you can use the WHERE clause in the LOOP statement to process the specific entries required:
LOOP AT it_tab INTO wa_tab WHERE pernr IN s_pernr.
Regards,
Aparna Alashe.