Application Development and Automation 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: 
Read only

TOTAL AMOUNT

Former Member
0 Likes
650

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
Read only

Former Member
0 Likes
611

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
Read only

Former Member
0 Likes
611

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

Read only

0 Likes
611

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

Read only

0 Likes
611

Hello

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

Bye

Gabriel

Read only

Former Member
0 Likes
612

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