‎2009 Nov 09 7:33 PM
Hi experts,
I have met an odd problem during my coding.
if i use
select machtype ra rmodel from zgreit
into table lt_zgreit
where ra = '866B0020999'
and receipt_stat = 'R'.I could select 8 data from table zgreit.
but if I use
if not gt_zgrrnnh[] is initial.
* get machine receiving for selected RNN
select machtype ra rmodel from zgreit
into table lt_zgreit
for all entries in gt_zgrrnnh
where ra = gt_zgrrnnh-rnn
and receipt_stat = 'R'.
endif.I just selected 5 data from table zgreit.
and in these codes, both field RA and field RNN are typed c length 11. and '866B0020999' is one of the data of gt_zgrrnnh-rnn
Is there any reason that made the mistake?
Thanks a lot.
sincerely,
Julie
‎2009 Nov 09 7:47 PM
FOR ALL ENTRIES eliminates duplicates from the selection set. Just make sure you are selecting all the key fields and you should be OK.
Rob
‎2009 Nov 09 7:47 PM
FOR ALL ENTRIES eliminates duplicates from the selection set. Just make sure you are selecting all the key fields and you should be OK.
Rob
‎2009 Nov 10 8:22 AM
Hi Julie
FOR ALL ENTRIESdeletes the duplicate entries from the itab. That's why only 5 entries are selected. Check in your 1st select query, some of the entries must have been duplicate. Make sure you are using all the Key fields while fetching from your Ztable.
For your reference, Search by
FOR ALL ENTRIESand there you'll find lots of BLOGS on the same.
Hope this helps.
Harsh