cancel
Showing results for 
Search instead for 
Did you mean: 

SAP B1 Stored Procédure : aggregate function not allowed

kingastrong
Participant
0 Kudos

Hello

With SBO_SP_TRANSACTION_NOTIFICATION

I want to sum the quantity all items (INV1) and put them in an UDF (header level OINV) directly with HANA

Im Using this query

IF :object_type = '13'  AND (:transaction_type='A' or :transaction_type='U')
THEN
BEGIN
update OINV set OINV."U_TotalQuantities" = sum(INV1."Quantity") from INV1 , OINV where INV1."DocEntry"=:list_of_cols_val_tab_del AND OINV."DocEntry"=:list_of_cols_val_tab_del ;
END;
END IF;

But i have this error , aggregate function not allowed , can you please help ?

I changed the clause where by having , still have the error , can you please give me the correct code ? thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

azizelmir
Contributor
0 Kudos

Hi Samba,

Please check this modification on your update statement:

UPDATE OINV 
Set OINV."U_TotalQuantities" =  (Select (sum(INV1."Quantity")) 
From INV1  inner join  OINV on INV1."DocEntry"=:OINV."DocEntry"
Where OINV."DocEntry"=:list_of_cols_val_tab_del)
Thank you,Aziz
kingastrong
Participant
0 Kudos

Any suggestions ?