Skip to Content
0

How to block selection of batch number already expired during delivery creation/Inventory Transfer

Nov 15, 2016 at 05:00 AM

172

avatar image

Hi all,

Help Needed!

How to block selection of batch number already expired during delivery creation/Inventory Transfer/Goods Issue

SAP HANA /SQL below procedure not working...

--#Block if Batch Expired---------
IF :Object_type = '10000044' THEN
Declare temp_var_101 integer;
SELECT
(SELECT cOUNT (t0."AbsEntry" )
FROM OBTN T0
WHERE t0."AbsEntry" = :list_of_cols_val_tab_del
AND DAYS_BETWEEN(t0."ExpDate",CURRENT_DATE)>=0) INTO temp_var_101 FROM DUMMY;
IF :temp_var_101 > 0 THEN
SELECT 1, 'Selected Batch Expire' INTO ERROR, error_message FROM DUMMY;
END IF;
END IF;

Danish

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Shyam Kumar Nov 15, 2016 at 06:00 AM
0

Hi,

Do you have Quality Management module, if QM is there then we can directly send the expired batch stock to blocked stock.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

No, we are using SAP B1 9.1 PL06 HANA

0
Pradnya S Nov 16, 2016 at 08:13 AM
0

Hi,

Is this query giving result after executing as a normal query. I guess, some issue regarding date function.

Regards

Pradnya

Share
10 |10000 characters needed characters left characters exceeded
Mohd Danish Dec 06, 2016 at 10:51 AM
0

Help needed on this,its not working,

--#Expired Batch Restriction
IF LTRIM(RTRIM(:object_type)) = '60' AND (:transaction_type='A') THEN
DECLARE item nvarchar(20);
DECLARE batch nvarchar(32);
DECLARE whs nvarchar(8);
DECLARE expDate timestamp;
SELECT OBTN."ItemCode", OBTN."DistNumber", OBTW."WhsCode", OBTN."ExpDate" INTO item, batch, whs, expDate FROM IGE1
INNER JOIN OBTW ON OBTW."WhsCode" = IGE1."WhsCode" AND IGE1."ItemCode" = OBTW."ItemCode" AND IGE1."DocEntry" = CAST(:list_of_cols_val_tab_del AS integer)
INNER JOIN OBTN ON OBTW."ItemCode" = OBTN."ItemCode" AND OBTW."WhsCode"=OBTN."DistNumber";
IF (LTRIM(RTRIM(:item)) <> '' AND LTRIM(RTRIM(:batch)) <> '' AND :expDate < CURRENT_DATE) THEN
SELECT -1 INTO error FROM DUMMY;
SELECT 'Error' || :batch || ' for item ' || :item || ' in Whs ' || :whs || ' has expired.choose a diffnt batch' INTO error_message FROM DUMMY;
END IF;
END IF;

Share
10 |10000 characters needed characters left characters exceeded