cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

QUERY TO BLOCK SALES ORDER, AR INVOICE AND DELIVERY WITHOUT COST CENTRE IN SAP BUSINESS ONE

wale_adegbola
Participant
0 Kudos
317

Dear All,I need a query to block my sales order, ar invoice and delivery in SAP Business One version for HANA without selecting cost centres in the system.

Hope to get your response.

View Entire Topic
SonTran
Active Contributor
0 Kudos

Hi,

This is for Sales Order, you can modify and apply to other documents

IF :object_type = '17' and (:transaction_type = 'A' or :transaction_type ='U') 
							
THEN
		BEGIN
			IF EXISTS ( 
						select T0."DocEntry" from ORDR T0 inner join RDR1 T1 on T0."DocEntry"=T1."DocEntry"
						where T0."DocEntry" = :list_of_cols_val_tab_del 
						and ifnull(T1."OcrCode",'')=''
				) 
			THEN
				BEGIN
						error := 1701;
						error_message := 'Cost center cannot be null.';
				END;
			END IF;
		END;
END IF;

Hope this helps,

Son Tran