on 10-25-2013 2:15 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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;
Hi,
Have you checked with my reply?
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In your attached case, the qty should be 800 or 1,600?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.