‎2008 Dec 17 3:01 PM
hi,
SELECT partner addrnumber FROM but020 INTO TABLE lt_adno
WHERE partner = lt_bpiddata-bottlerid.
The above select statement is removing all the duplicate values.
but i need duplicate values also.
is there any solution?
thanks in advance,
srinivas.
‎2008 Dec 17 3:05 PM
‎2008 Dec 17 3:12 PM
yes u r correct.
in my table primary key is bottler id and mat grp id.
both are partners.
and my question is
select statement removes duplicate values.
is there any syntax for the select statement so that it should not remove duplicate values.
‎2008 Dec 17 3:09 PM
Hi,
put for all entries in select stmt
if not lt_bpiddata[] is initial.
SELECT partner addrnumber FROM but020 INTO TABLE lt_adno
for all entries in lt_bpiddata
WHERE partner = lt_bpiddata-bottlerid.
endif.
Thanks,
Krishna..
‎2008 Dec 17 3:13 PM
‎2008 Dec 17 3:21 PM
Hi,
As far as I can see, the table but020 have 2 primary keys , i.e the PARTNER and ADDRNUMBER. Now if you select an entry using a partner only, you should get all the ADDRNUMBERS for that partner as well. So no issues with your select statement. But it is not always necessary that the each partner will have multiple addresses.
However if it does and still you not getting the duplicates, then check that there is no uniquekey defined for the internal table lt_adno.
regards,
Advait
‎2008 Dec 17 3:16 PM
Hi,
Put break Pt & check values coming correnct in first internal table or not.
second query is correct of for all entries..
Thanks,
Krishna..
‎2008 Dec 17 3:22 PM
SELECT bottler material_group FROM zsupplier INTO TABLE lt_bpiddata.
IF lt_bpiddata[] IS NOT INITIAL..
SELECT partner addrnumber FROM but020 INTO TABLE lt_adno FOR ALL ENTRIES IN lt_bpiddata WHERE partner = lt_bpiddata-bottlerid.
duplicate values are getting populated into lt_bpiddata
but it not the same with lt_adno.
‎2008 Dec 17 3:22 PM
Hi,
Please select both key fields in your query. Doing this you will get all the duplicate values also.
SELECT PARTNER ADDRNUMBER FROM but020
INTO TABLE lt_adno
FOR ALL ENTRIES IN lt_bpiddata
WHERE partner = lt_bpiddata-bottlerid.
Hope it helps.
Regards,
Nadim