2008 Jul 30 2:58 AM
Hi experts,
I'm working on a report that needed
plant,
new material code,
old material code,
material type,
special stock and
(material status ne '01')
select p~werks m~matnr m~bismt m~mtart s~sobkz
into corresponding fields of table it_mat
from ( ( MARC as p inner join MARA as m on p~matnr = m~matnr )
inner join MSEG as s on s~matnr = p~matnr )
where m~matnr in p_mcode
and m~bismt in p_ocode
and m~mtart in p_mtype
and p~werks in p_plant
and m~matkl in p_mgroup
and p~mmsta ne '01'
and s~sobkz in p_spec
order by m~matnr.
APPEND it_mat.
This is my select stament ,
and it's output layout the material code are all repeating twice or 3-5 times for the same data.
Is there anyway to take out the repeated data?
Please advice.
Thank you in advanced.
2008 Jul 30 3:16 AM
Hi,
Use
ORDER BY <field> ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_mat.
it will delete all duplicates & repeated data.
Regards
Hema
2008 Jul 30 3:16 AM
Hi,
Use
ORDER BY <field> ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_mat.
it will delete all duplicates & repeated data.
Regards
Hema
2008 Jul 30 3:51 AM
Hi,
Use ,
select pwerks mmatnr mbismt mmtart s~sobkz
into corresponding fields of table it_mat
from ( ( MARC as p inner join MARA as m on pmatnr = mmatnr )
inner join MSEG as s on smatnr = pmatnr )
where m~matnr in p_mcode
and m~bismt in p_ocode
and m~mtart in p_mtype
and p~werks in p_plant
and m~matkl in p_mgroup
and p~mmsta ne '01'
and s~sobkz in p_spec
order by m~matnr ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_mat.
APPEND it_mat.
it will delete all duplicates & repeated data.
Regards
Hema
2008 Jul 30 4:53 AM
Hi hema,
Thank you so much, it's solve ^.*
Thanks to vijay and chandra too.
I've rewards marks to you ya.
Thanks a lots !
2008 Jul 30 6:09 AM
2008 Jul 30 3:24 AM
add werks also in JOIN on MSEG.
select p~werks m~matnr m~bismt m~mtart s~sobkz
into corresponding fields of table it_mat
from ( ( MARC as p inner join MARA as m on p~matnr = m~matnr )
inner join MSEG as s on s~matnr = p~matnr and
s~werks = p~werks
)
where m~matnr in p_mcode
and m~bismt in p_ocode
and m~mtart in p_mtype
and p~werks in p_plant
and m~matkl in p_mgroup
and p~mmsta ne '01'
and s~sobkz in p_spec
order by m~matnr.
APPEND it_mat.
2008 Jul 30 4:20 AM
Hi Milka,
Try the following:
ORDER BY m~matnr ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_mat.
Regards,
Chandra Sekhar
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |