Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

TOTAL AMOUNT

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

Hello

Try to get it from KNB1-KUNNR. The field KUNNER doesnt exist.

Bye

Gabriel

Former Member
0 Kudos

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