Skip to Content

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

Stored Procedure to block cost center or profit center to present in JE

Hi ...

I have a case where i need to block if either one of the cost center or the Profit Center is not present in the manual journal entry.

Below is my Stored Procedure which i have written....My Problem is that this block allows me to update only if both the Cost Center and the Profit Center is Present and does not allow if any one is present.

IF @object_type='30' AND (@transaction_type='A' or @transaction_type='U')

BEGIN

  if(Select Count(*) from OJDT T0  INNER JOIN JDT1 T1 ON T0.TransId=T1.TransId

  INNER JOIN OACT T2 ON T2.AcctCode=T1.Account

  where  T2.ExportCode LIKE '1%' And (isnull(T1.ProfitCode,0)='0'  OR ISNULL(T1.OcrCode2,'')='')  and

   T0.TransId=@list_of_cols_val_tab_del)>0

  begin

  SET @error = 0201

     SET @error_message= 'R1'

end

end

What could be the problem...?

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