Skip to Content

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

Production Order-Cost Center Mandatory

   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.

Tags:
replied

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

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question