Skip to Content
avatar image
Former Member

duplicate Batch number Block in Goods receipt and Receipt from Production

Hi, Experts

following is my SP to block Duplicate Batch number in Goods receipt and Receipt from production

/* Duplicate Batch Number Block Error = 900001*/ IF (:transaction_type = 'A' OR :transaction_type = 'U') AND (:object_type= '59') then SELECT COUNT(*) INTO CNT FROM IGN1 T1 INNER JOIN OIGN T2 ON T1."DocEntry" = T2."DocEntry" INNER JOIN OIBT T0 ON T0."BaseEntry" = T2."DocEntry" WHERE T0."BaseType" = 59 AND T1."DocEntry" = :list_of_cols_val_tab_del AND (T1."ItemCode" Like 'DNC-FG%%') AND T0."BatchNum" in (SELECT T0."BatchNum" FROM IGN1 T1 INNER JOIN OIGN T2 ON T1."DocEntry" = T2."DocEntry" INNER JOIN OIBT T0 ON T0."BaseEntry" = T2."DocEntry" WHERE T0."BaseType" = 59 AND (T1."ItemCode" Like 'DNC-FG%%')); IF :CNT>0 THEN error := 900001; error_message := 'Batch Number is Already Exist'; CNT := 0 ; END IF ; END IF;

but its not working can anyone guide me what am i missing my SAP Business one version is 9.2 PL06 HANA

Regards

Jamil Siddiqui

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 14, 2017 at 09:30 AM

    Issue resolved by following SP

    /* Duplicate Batch Number Block Error = 900001*/

    IF (:transaction_type = 'A'OR :transaction_type = 'U') AND (:object_type= '59') then

    SELECTCOUNT(*) INTO CNT

    FROM IGN1 T1

    INNERJOIN IBT1 T0 ON T1."DocEntry" = T0."BaseEntry"and T0."BaseType" = '59'

    where T1."DocEntry" = :list_of_cols_val_tab_del and

    T1."ItemCode"Like'DNC-FG%%'

    AND T0."BatchNum"in (SelectIfnull(T0."BatchNum",'') from IBT1 T0

    INNERJOIN IGN1 T1 ON T1."DocEntry" = T0."BaseEntry"and T0."BaseType" = '59'where

    T1."ItemCode"Like'DNC-FG%%'and T1."DocEntry" <> :list_of_cols_val_tab_del );

    IF :CNT>0 THEN

    error := 900001;

    error_message := 'Duplicate Batch Number Exist Check Batch No Again';

    CNT:= 0;

    ENDIF;

    ENDIF;

    Regards

    Jamil

    Add comment
    10|10000 characters needed characters exceeded