Skip to Content

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

Cost Center Mandtory in Outgoing Payment

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question