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

Doubt on read statement

Former Member
0 Likes
284

HI Friends,

I am using a code like as below

loop at itab assigning <fl_itab>.

read table inttab assigning <fl_inttab> with key matnr = <fl_itab-matnr>.

material = <fl_inttab>-matnr.

endloop.

my questio is .

i am reading inttab internal table .if (suppose) this internal table has duplicate records for a material number which value will be assigned to output field(material).will read statement will take only the first record of many duplicate record...

please help me

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
268

Yes it will take the first record.

you can check the sy-subrc value after the execution of the READ statement.

loop at itab assigning <fl_itab>.

read table inttab assigning <fl_inttab> with key matnr = <fl_itab-matnr>.

if sy-subrc eq 0.

material = <fl_inttab>-matnr.

endif.

endloop.

1 REPLY 1
Read only

Former Member
0 Likes
269

Yes it will take the first record.

you can check the sy-subrc value after the execution of the READ statement.

loop at itab assigning <fl_itab>.

read table inttab assigning <fl_inttab> with key matnr = <fl_itab-matnr>.

if sy-subrc eq 0.

material = <fl_inttab>-matnr.

endif.

endloop.