on 09-12-2014 10:20 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.