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: 

SUM using field symbol

mohamed_hamdi
Explorer
0 Kudos

Hellp SAP Community,

I have a program in which I have to "Calculate the amount to be paid"

This is the formula : VBRK-NETWR + VBRK-MWSBK + KONV-KWERT

The code I wrote is incomplete or missing something , can you help me out ?

NB : I have added all fields type in the internal table lt_vbak

DATA : lt_vbak TYPE STANDARD TABLE OF ty_vbak,
wa_vbak TYPE ty_vbak,
SUM TYPE P DECIMALS 2.

SELECT (I have selected all the fields used in the formula + others I need in my program)

+ some joins I need to call the field KWERT

INTO CORRESPONDING FIELDS OF TABLE @lt_vbak

LOOP AT lt_vbak ASSIGNING FIELD-SYMBOL(<FS_WA>).
IF <FS_WA> IS ASSIGNED.
SUM=<FS_WA>-NETWR + <FS_WA>-MWSBK + <FS_WA>-KWERT>
ENDIF.

ENDLOOP.

1 REPLY 1

0 Kudos

Hello,

Everything seem fine. Can you explain in more details. When you run this code what is the problem.