cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate Creation of Batch on GRPO

0 Kudos

Hello,

We been encountering this kind of problem, upon creation of batch on GRPO, we notice that it allowed duplicate batch on same item and quantity, but when we tried to simulate the problem we did not encountered it again, our worry is, it might happened again, so we need to identify the cause of the problem and how to avoid it. I think it is a system bug, where using SAP B1 8.81 PL 4. Attach is the screen shot

Regards,

Ellie

Accepted Solutions (1)

Accepted Solutions (1)

former_member197621
Active Contributor
0 Kudos

Hi Rebelin,

System won't block the duplicate batch number, so you have to block through Stored procedure.

Try this below Stored Procedure,

IF @object_type ='20' and @transaction_type in ('A','U')   

BEGIN

        if  exists(Select distinct 'Error' from IBT1 B1 , IBT1 B2

                                                  where b1.BatchNum in (isnull(b2.BatchNum,'')) and B1.BaseEntry = @list_of_cols_val_tab_del

                                                            and b2.BaseEntry <> @list_of_cols_val_tab_del and b2.BaseType = 20 and  b1.BaseType = 20 )

          begin

                  SET @error = 2000

                              SET @error_message = 'Duplicte Batch not allowed'

          end

End

0 Kudos

thank you so much, I try this one

regards

ellie

0 Kudos

Sir Prasanna S

I could like to add the itemcode and docnum in the condition how to do this.

Regards,

Ellie

former_member197621
Active Contributor
0 Kudos

Hi Rebelin,

I can't understand , explain me with example.

0 Kudos

because we might use the same batch no, as long as the docnum, item code and line no is not the same

ex: grpo docnum 1234, itemcode = xxxxx, qty = 5, lineno = 1

     grpo docnum 1234, itemcode = zzzzz, qty = 5, lineno = 2

     grpo docnum 1234, itemcode = xxxxx, qty = 10, lineno = 3

batch no = 111111 for that document

regards,

ellie

former_member197621
Active Contributor
0 Kudos

Hi Rebelin,

Try this below SP, Same batch number different item code now you can create. System won't block.

Note: Same document same batch number duplication system won't allow , this is system behaviour.

IF @object_type ='20' and @transaction_type in ('A','U')  

BEGIN

        if  exists(Select distinct 'Error' from IBT1 B1 , IBT1 B2

                                                  where b1.BatchNum in (isnull(b2.BatchNum,'')) and B1.BaseEntry = @list_of_cols_val_tab_del

                                                and b1.ItemCode = B2.ItemCode  and b2.BaseEntry <> @list_of_cols_val_tab_del and b2.BaseType = 20 and  b1.BaseType = 20 )

          begin

                  SET @error = 2000

                              SET @error_message = 'Duplicte Batch not allowed'

          end

End

0 Kudos

try this one:

IF (:object_type = '20' AND :transaction_type='A') THEN

declare batch nvarchar(8000);

SELECT ifnull((Select count(*) from IBT1 B1 , IBT1 B2 where b1."BatchNum" in (ifnull(b2."BatchNum",'')) and B1."BaseEntry" =:list_of_cols_val_tab_del and b2."BaseEntry" <> :list_of_cols_val_tab_del and b2."BaseType" = 20 and b1."BaseType" = 20

group by b1."BatchNum"

having count(distinct B1."ItemCode") > 1

),0) INTO temp1 from DUMMY;

IF :temp1>0 THEN

SELECT '-496', 'Duplicte Batch not allowed.' INTO error, error_message FROM DUMMY;

END IF;

END IF;

Answers (3)

Answers (3)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Have you checked with my reply?

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

In your attached case, the qty should be 800 or 1,600?

Thanks,

Gordon

0 Kudos

Hello Gordon,

It should be 800, we only received it once, I understand that the system can reused the batch no. in the same item, but does its allowed to be reused in same document as well, even though the quantity received already had a batch no created.

Regards,

Ellie 

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

There is system message ( The batch already exists. Continue?) to user to assign different batch number.

This is standard system behavior.

Thanks & Regards,

Nagarajan

0 Kudos

Yes I know that the system does not allow same batch no on the same item with the same qty, however we encountered the problem as saw on the attach, as you can see the system allow it, that;s why I raise the concern.

Regards,

Ellie

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

System will allow same batch number if the item number is same.

Why system allows?

For example, you have ordered item XXX with 5 EA with batch number 1234. But due to urgent requirement, you have requested vendor to send at least  1 EA. So received item with batch no 1234.

Whenever you receive balance 4 EA for XXX item, system allow to add same batch number 1234.

If you don't want to assign same batch number, system allows to assign different batch.

Thanks & Regards,

Nagarajan

0 Kudos

Hello

Our scenario is we create GRPO in item xxx with 400 qty then we batch it,

let say batch 1 on item xxx with 400 qty ... but on oitl table the record is

batch 1 on item xxx with 400 qty - logentry 1

batch 1 on item xxx with 400 qty - logentry 2

or the other instance it allow different batch on same item with the same qty

batch x on item xxx with 400 qty - logentry 1

batch y on item xxx with 400 qty - logentry 2

we just noticed this problem when one of the users complain about the stock qty, that's why we dont know the cause of the duplication, bec when we simulate it, we can not duplicate the problem.

So I raise the concern here.

Regards,

Ellie

Regards,

Ellie

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Log entry is created by SAP for each transaction.

From the above screen shot, the above item was received two times through GRPO. So system created two log entry for same item.

There is no problem in system.

Thanks & Regards,

Nagarajan