07-12-2007 10:22 PM
Hello experts,
I have to upload the data, i got the file with number of recordes in it
i read the data into one internal table.
now i have to sum the amount field in that file for all the records and capture that into one varible can anyone guide me how to do it?
SRI
07-12-2007 11:31 PM
Hi,
Not sure if I understood your requirement correctly..
Do you want to get the field ALTKN from the knb1 for the value in the BSEG-KUNNR..
Try this..
SELECT SINGLE * FROM KNB1 WHERE KUNNR = BSEG-KUNNR AND
BUKRS = BSEG-BUKRS.
Thanks
Naren
07-12-2007 10:40 PM
Hi,
Just loop at that internal table sum the value ..
Ex..
DATA: V_AMOUNT TYPE NETWR.
LOOP AT ITAB.
V_AMOUNT = V_AMOUNT + ITAB-AMOUNT.
ENDLOOP.
WRITE: / 'Total amount is', v_amount.
Thanks
Naren
07-12-2007 11:00 PM
naren one more doubt plz...
I am getting the customer number in the legacy file, It is bseg-kunner but in the sap system it is stored in the knb1-altkn.
how to get that value by passing this kunner...
can u guide me please....
SRI
07-12-2007 11:29 PM
Hello
Try to get it from KNB1-KUNNR. The field KUNNER doesnt exist.
Bye
Gabriel
07-12-2007 11:31 PM
Hi,
Not sure if I understood your requirement correctly..
Do you want to get the field ALTKN from the knb1 for the value in the BSEG-KUNNR..
Try this..
SELECT SINGLE * FROM KNB1 WHERE KUNNR = BSEG-KUNNR AND
BUKRS = BSEG-BUKRS.
Thanks
Naren