Skip to Content
0
Former Member
Feb 22, 2010 at 11:59 PM

SBO_SP_Transactionnotifaction and Approval Procedures

15 Views

Hi,

I understand I cannot use SBO_SP to validate row level data in modules where the Approval Procedure are active.

Is there another way to do the following?

I have three header level and row level UDF's that I need to be validated before the users saves the document as draft in the approval procedure. Once the document enter the approval stages it can no longer be update to enter or change the UDF's, in the rows.

U_BU

U_DEPT

U_ProjectInv

Code being used fro other modules. I had to remove modules in approval procedure as documents would simply disaaper when saves as DRAFT.

MY CODE for non approval modules:

+++++++++++++++++++++++++++++++++

---+Force BU DEPT and PROJECT -- IN ALL REQUIRED DRAFT DOCUMENTS++++++++++++++++++++++++++++

IF @transaction_type IN ('A','U') AND @object_type = '112'

BEGIN

IF EXISTS (

select T0.Docentry

FROM ODRF T0 inner join DRF1 T1 ON T1.docentry = T0.Docentry and lineStatus ='O'

--select * from ODRF

WHERE

T0.ObjType in ('13','16','17','18','20','22','23','203','204') and

-- ('14','59','60','19''15', )Remove These object as SBO_SP is not compatible with Approval Proceedure

(

(T0.DOCENTRY = @list_of_cols_val_tab_del and NOT(T0.U_BU IN (SELECT code FROM [@sg_BU] where code = T0.U_BU)))

or

(T0.DOCENTRY = @list_of_cols_val_tab_del and NOT(T0.U_DEPT IN (SELECT code FROM [@sg_DPT] where code = T0.U_DEPT)))

or

(T0.DOCENTRY = @list_of_cols_val_tab_del and NOT(T0.PROJECT IN (SELECT Prjcode FROM [OPRJ] where PrjCode = T0.project)) and not (T0.objtype in ('59','60')))

or

(T1.DOCENTRY = @list_of_cols_val_tab_del and NOT(T1.U_BU IN (SELECT code FROM [@sg_BU] where code = T1.U_BU)))

or

(T1.DOCENTRY = @list_of_cols_val_tab_del and NOT(T1.U_DEPT IN (SELECT code FROM [@sg_DPT] where code = T1.U_DEPT)))

or

(T1.DOCENTRY = @list_of_cols_val_tab_del and NOT(T1.PROJECT IN (SELECT PrjCode FROM [OPRJ] where PrjCode = T1.project)) )--and not (@object_type in ('59','60'))

)

)

BEGIN

SELECT @Error = 1, @error_message = 'Business Unit - Department or Project missing from User Defined Fields or Rows'

END

END

++++++++++++++++++++++++++++++++++

Kind regards

Eric