Skip to Content

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

Need to Restrict Batch # field

Upon Goods Receipt - I need to restrict the Batch # field to XXXX-XXXX

Former Member
Former Member replied

Hi Daniel,

I'm really sorry, there is a mistake on the query(on the if exists section), please use this one

IF @transaction_type IN ('A') AND (@object_type = '59' )

BEGIN

    IF exists (select 1 from OIBT where (LEN(BatchNum) != '9' or LEN(BatchNum) - LEN(REPLACE(BatchNum, '-', '')) != 1 or CHARINDEX('-', BatchNum) != 5) and BaseType = '59' and BaseEntry = @list_of_cols_val_tab_del)

    BEGIN

        set @error = 1

        set @error_message = 'Batch Format Must Be ####-####' 

        select @error, @error_message

    END

END


I have tested it here and it works just fine


Regards,

Wongso

0 View this answer in context

Helpful Answer

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