Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 12, 2014 at 09:50 AM

    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

    Add comment
    10|10000 characters needed characters exceeded