Application Development and Automation 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 only

Read from internal table.

Former Member
0 Likes
529

hi frnd's

Values in the internal_table must be compared with the screen field value entered.

Whether the where condition can be used in the read table syntax.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
497

Where condition cannot be used to compare in read statement.

YOu have to use "with Key"

read table itab with key field1 = <value>

field2 = <value2.

Regards,

ravi

4 REPLIES 4
Read only

Former Member
0 Likes
498

Where condition cannot be used to compare in read statement.

YOu have to use "with Key"

read table itab with key field1 = <value>

field2 = <value2.

Regards,

ravi

Read only

Former Member
0 Likes
497

Hi,

if it is paramter then

read table it_matnr with key matnr = p_matnr.

if it is select option then

loop at it_matnr where matnr in s_matnr.

do some thing...
exit.
endloop.

Regards

vijay

Read only

Former Member
0 Likes
497

Hi Suganya,

You can use where condition with READ statement.

READ TABLE ITAB WITH KEY ITAB-FIELD = SCREEN_FIELD-VALUE.

<b>You can perform only =(equals) condition with READ statement.</b>

<b>If you need to perform any other condtion apart from =(equals) then use LOOP...ENDLOOP WITH WHERE <condition>.</b>

LOOP AT ITAB WHERE ITAB-FIELD <> SCREEN_FIELD-VALUE.

"Do some operation

ENDLOOP.

Thanks,

Vinay

Read only

Former Member
0 Likes
497

suganya,

As the others said you need to use Loop … endloop for NE(not equal) conditions.

Remember to Sort your internal table before the READ statement and use the addition BINARY SEARCH to increase you search.

Please, mark ALL useful answers if it helps you.

Regards,Felipe Cunha [FpdC]

Message was edited by: Felipe Cunha