Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

another problem about select..sum..

HI,

I'm back, and there is another select ..sum problem.

the following code:

SELECT aufnr SUM( wrbtr ) AS jfje FROM bsis
 into CORRESPONDING FIELDS OF TABLE it_syye
 WHERE bukrs = '1500'
 AND   aufnr = it_num-aufnr
 AND   budat >= '20040131'
 AND   budat <= q_date2
 AND   hkont = '0041010013'
 AND   shkzg = 'S'
 GROUP by aufnr.

SELECT aufnr SUM( wrbtr ) AS dfje FROM bsis
 into  CORRESPONDING FIELDS OF TABLE it_syye1
 WHERE bukrs = '1500'
 AND   aufnr = it_num-aufnr
 AND   budat >= '20040131'
 AND   budat <= q_date2
 AND   hkont = '0041010013'
 AND   shkzg = 'H'
 GROUP by aufnr.

I want to select the credit amount and debit amount from the table BSIS,but using the select sum , it looks like the field SHKZG doesn't work.

It select all the amount no matter what the SHKZG is 'S' or 'H'.

Could anyone explain that ,and give a good solution?

Thank you very much.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question