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: 

Read an internal table using range.

kowong
Participant
0 Kudos

Dear Expert,

Example:

SELECT-OPTIONS so_klart for kssk-klart.

and I have an internal table it_kssk , which i want to filter by the selection range above.

since it_kssk already populated with data with the previous SQL statements, and I dont want to execute another SQL statement for the filtering. I am trying to avoid selecting it again using SQL because this is a heavy table...

I would like to find a way to read it_kssk with something like this

" read table it_kssk with key kssk-klart <b>IN SO_KLART</b> " ....

Or any function module to do this?

Or any suggestions?

using this way below is kind of tiresome...

LOOP at so_klart .

IF so_klart -option = "EQ"

read table xxxxx.....

elseif so_klart-option = "NE"

read table XXX...

else if ...

.....

Endloop...

Thank you.

Message was edited by:

Kokwei Wong

Message was edited by:

Kokwei Wong

Message was edited by:

Kokwei Wong

null

3 REPLIES 3

Former Member
0 Kudos
REPORT YARRANGE. 
TABLES YTXLFA1. 
RANGES: VENDOR FOR YTXFLA1-LIFNR. 

- - - -  
- - - -- 
- - - -  

SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB  
WHERE LIFNR IN VENDOR. 

Here with RANGES  user has to design an internal table with fields -  
SIGN,OPTION,LOW and HIGH EXPLICITLY. 

reward points if it isuse full ...

Girish

Former Member
0 Kudos

take a itab like

data : begin of imatnr occurs 0,

matnr like mara-matnr,

end of imatnr.

select matnr into table imatnr where matnr in so_matnr.

loop at it_mara.

read table imatnr with key matnr = it_mara-matnr.

if sy-subrc ne 0.

delete it_mara.

endif.

endloop.

regards

shiba dutta

jayanthi_jayaraman
Active Contributor

Hi,

Try this.

delete it_kssk where not klart in so_klart.