Skip to Content
0
Aug 29, 2008 at 08:40 AM

Aggregate Function + Summation

31 Views

Hi

I am using the below code the collect the sum of the fields H_RECIPTS and H_PAYMENTS into w_oreceipts, w_opayments.

Can you tell what is the problem with the below code as it does not give the sum, its just blank at runtime..

I checked whether there was any data with the below selection and found entries in TCJ_DOCUMENTS but the summation does not show up..

SELECT SUM( h_receipts ) SUM( h_payments )
               INTO (w_oreceipts, w_opayments)
               FROM   tcj_documents
               WHERE  comp_code     = p_bukrs
                AND   cajo_number   = wa_tcjdocs-cajo_number
                AND   document_date < s_date-low.