cancel
Showing results for 
Search instead for 
Did you mean: 

Production Order-Cost Center Mandatory

Former Member
0 Kudos

   Dear Experts,

In Production order Transaction,

Cost center mandatory

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

BEGIN

IF EXISTS (SELECT T0.DocEntry FROM dbo.WOR1 T0

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 T0.DocEntry = @list_of_cols_val_tab_del)

Begin

SET @Error = 1111

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

End

End

My Requirement Dimension 3 mandatory in production order.

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

try this

IF @transaction_type = 'A'

   AND @Object_type = '202'

BEGIN

    IF EXISTS (

           SELECT T0.DocEntry

           FROM   dbo.WOR1 T0

           WHERE  

                      ISNULL(T0.[OcrCode],'') = ''

                      AND ISNULL(T0.[OcrCode2],'') = '' 

                      AND isnull(T0.[OcrCode3],'') = '' 

                      AND isnull(T0.[OcrCode4],'') = '' 

                      AND isnull(T0.[OcrCode5],'') = '' 

                 

                  AND T0.DocEntry = @list_of_cols_val_tab_del

       )

    BEGIN

        SET @Error = 1111

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

    END

END

Former Member
0 Kudos

Dear Kennedy,

Thanks for your reply. But not working above SP_TN

Former Member
0 Kudos

Hai,

Dimension 3 only mandatory not any one of cost center

KennedyT21
Active Contributor
0 Kudos

post your Dimension screen shot...

Former Member
0 Kudos

Dear Kennedy,

Please find the attachment.

As you provided, SP always shown at least one cost mandatory

but my requirement in production order header level dimension 3 only mandatory

KennedyT21
Active Contributor
0 Kudos

try this

IF @transaction_type = 'A'

   AND @Object_type = '202'

BEGIN

    IF EXISTS (

           SELECT T0.DocEntry

           FROM   dbo.OWOR T0

           WHERE 

                  

                      isnull(T0.[OcrCode3],'') = ''

               

                  AND T0.DocEntry = @list_of_cols_val_tab_del

       )

    BEGIN

        SET @Error = 1111

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

    END

END

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Experts,

Its urgent. Any updates.