cancel
Showing results for 
Search instead for 
Did you mean: 

Cost Center Mandtory in Outgoing Payment

Former Member
0 Kudos

Hai Experts,

Need store procedure for cost center mandatory for both Outgoing Payment & Incoming Payment for Vendor,Customer as well as on account payment.

Regards

Mohamed Yousuf Ali M I

Accepted Solutions (1)

Accepted Solutions (1)

former_member205766
Active Contributor
0 Kudos

Hi

Try This

For Outgoing payment Vendor

IF @transaction_type='A' AND @Object_type = '46'

BEGIN

IF EXISTS (SELECT T0.DocNum FROM dbo.VPM2 T0 Inner Join dbo.OVPM T1 On T0.DocNum = T1.DocEntry

WHERE ((T0.[OcrCode]='' OR T0.[OcrCode] IS NULL) and (T0.[OcrCode2]='' OR T0.[OcrCode2] IS NULL) and (T0.[OcrCode3]='' OR T0.[OcrCode3] IS NULL) and

(T0.[OcrCode4]='' OR T0.[OcrCode4] IS NULL) and (T0.[OcrCode5]='' OR T0.[OcrCode5] IS NULL)) AND T1.DocEntry = @list_of_cols_val_tab_del And T1.DocType = 'S')

Begin

SET @Error = 1111

SET @error_message = 'At least one cost center is mandatory!'

End

End

---------------------------------------------------------------------------------------------------------------------------

For Outgoing payment Account

IF @transaction_type='A' AND @Object_type = '46'

BEGIN

IF EXISTS (SELECT T0.DocNum  FROM dbo.VPM4 T0 Inner Join dbo.OVPM T1 On T0.DocNum = T1.DocEntry

WHERE ((T0.[OcrCode]='' OR T0.[OcrCode] IS NULL) and (T0.[OcrCode2]='' OR T0.[OcrCode2] IS NULL) and (T0.[OcrCode3]='' OR T0.[OcrCode3] IS NULL) and

(T0.[OcrCode4]='' OR T0.[OcrCode4] IS NULL) and (T0.[OcrCode5]='' OR T0.[OcrCode5] IS NULL)) AND T1.DocEntry = @list_of_cols_val_tab_del And T1.DocType = 'A')

Begin

SET @Error = 1111

SET @error_message = 'At least one cost center is mandatory!'

End

End

With Regards

Balaji Sampath

Answers (0)