‎2007 Sep 01 9:35 AM
Hi Gurus,
I am fetching the Records from GLPCA TABLE according to selection-criteria as well as
for all entries in it_mara internal table(code given below).
but data base table having 18 records(as per selection criteria) my internal table having 14 records, the remaining four records are duplicate records in data base table.
there are four records with all field values are equal. but only one record is coming into internal table. remaining three are not coming
and there are two records with all field values are equal but only one record is coming into internal table. remaining one is not coming
but I awant that duplicate records also.
if any body know please give me the answer.
Regards,
Shashikumar.G
SELECT a~matnr
b~maktx
INTO TABLE it_mara
FROM mara AS a
INNER JOIN makt AS b
ON bmatnr = amatnr
AND b~spras = sy-langu
WHERE mtart = 'RAW'
AND matkl IN ('101', '102','103','104','105','106').
IF it_mara IS NOT INITIAL.
SORT: it_mara BY matnr.
SELECT rrcty
matnr
stagr
ksl
msl
INTO TABLE it_glpca
FROM glpca AS a
FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr
AND kokrs = p_kokrs
AND rbukrs = p_bukrs
AND gsber = p_gsber
AND rprctr = p_prctr
AND poper = p_period.
endif.
‎2007 Sep 01 9:42 AM
Hi..Shasikumar..
<b>You have to fetch the Keyfield GL_SIRID of the Table GLPCA.</b>
So add this field in your Itab also...
Then it will give all those records .. otherwise it will return the distinct records.
IF it_mara IS NOT INITIAL.
SORT: it_mara BY matnr.
<b>SELECT
GL_SIRID </b>
rrcty
matnr
stagr
ksl
msl
INTO TABLE it_glpca
FROM glpca AS a
FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr
AND kokrs = p_kokrs
AND rbukrs = p_bukrs
AND gsber = p_gsber
AND rprctr = p_prctr
AND poper = p_period.
endif.
<b>reward if Helpful.</b>
‎2007 Sep 01 9:42 AM
Hi..Shasikumar..
<b>You have to fetch the Keyfield GL_SIRID of the Table GLPCA.</b>
So add this field in your Itab also...
Then it will give all those records .. otherwise it will return the distinct records.
IF it_mara IS NOT INITIAL.
SORT: it_mara BY matnr.
<b>SELECT
GL_SIRID </b>
rrcty
matnr
stagr
ksl
msl
INTO TABLE it_glpca
FROM glpca AS a
FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr
AND kokrs = p_kokrs
AND rbukrs = p_bukrs
AND gsber = p_gsber
AND rprctr = p_prctr
AND poper = p_period.
endif.
<b>reward if Helpful.</b>
‎2007 Sep 01 10:00 AM
Hi Varma,
My problem was solved with ur answer.
Thanks and Regards,
Shashikumar.G