‎2008 May 16 11:37 AM
Hi All,
I have an internal table having document number values it_tab.
For the above documene numbers i need to select all items DKKOPK-BETRW value having similar tax code (DFKKOPK-MWSKZ) sum the values from field DKKOPK-BETRW of all line items and display.
Pls help..
Thanks,
Sai
‎2008 May 16 11:43 AM
data : begin of itab occurs 0,
mblnr,
MWSKZ,
BETRW,
end of itab.
data : itab2 like itab occurs 0 with header line.
sort itab by mblnr mwskz betrw.
loop at itab.
itab2 = itab.
collect itab2.
clear itab.
endloop.
Hope it will work.
Regards,
madan.
‎2008 May 16 11:44 AM
if it_itab[] is not initial.
select OPBEL OPUPK BETRW MWSKZ from DFKKOPK
into itab for all entries in it_itab
where OPBEL = it_itab-doc_no.
endif.
‎2008 May 16 11:55 AM
HI,
A LOCAL VARIABLE OF TYPE BETRW INITIALISED TO ZERO.
SELECT * FROM DFKKOPK INTO TABLE II_ITAB.
SORT IT_ITAB BY MWSKZ.
LOOP AT IT_ITAB INTO WA_ITAB.
LV_BETRW = WA_ITAB-BETRW + LV_BETRW.
ON CHANGEOF MWSKZ.
WRITE: LV_BETRW.
CLEAR LV_BETRW.
ENDON.
ENDLOOP.
NOTE: you must have the MWSKZ field as the first field of the internal table.
I think this is clear for you.
Reward points if helpful.
Thanks and regards,
Narayana.
Edited by: Ammavajjala Narayana on May 16, 2008 1:24 PM