Skip to Content
0
Former Member
Mar 23, 2009 at 09:42 AM

Reg: SP_Transaction

20 Views

Hi All,

I had written a SQL code, when the user enters a GRPO with out PO reference, then it should not add the transaction.

when i add a new GRPO without PO reference, it gives the message as "Operation completed successfully", but does not add the transaction.

the below is code written:

if @object_type= '20' and @transaction_type = 'A' 
begin
	if exists (select T0.docentry from opdn T0 inner join pdn1 T1 on T1.docentry = T0.docentry 
and T1.docentry = @list_of_key_cols_tab_del
where T1.baseref = '-1')
     begin
	set @error = 1
	set @error_message = N'GRPO Cannot be raised directly'
     end
end 

Please help me out to resolve.

Regards

Shanker. T