Skip to Content

Inactive Items query with batch number

Hi All,

My client wanted to make Inactive items query base on inventory with batch number, batch expiration and batch admission date. The existing Inactive items is not giving us our requirements.

Can any body help me in this regards

Thanks

Dect Lariosa

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 12, 2017 at 12:54 AM

    Hi Dect,

    Just join the OITM to OBTN table

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16, 2017 at 12:47 AM

    Hi Dect,

    I got the wrong quantity for the batch.
    Try this instead :

    WITH ActiveItem as (
    SELECT DISTINCT ItemCode
    FROM OINM T1 WHERE T1.DocDate >= DATEADD(month, -6, GETDATE()))
    SELECT T0.ItemCode, T1.DistNumber, T3.Quantity
    FROM OITM T0 JOIN OBTN T1 oN T0.ItemCode = T1.ItemCode
    	JOIN OBTQ T3 ON T1.AbsEntry = T3.AbsEntry
    	LEFT JOIN ActiveItem T2 ON T0.ItemCode = T2.ItemCode 
    WHERE T0.OnHand>0 AND T3.Quantity>0		--Items with onhand qty
    	AND T2.ItemCode IS NULL				--Not Active item for the past 6 months
    	--AND T2.ItemCode IS NOT NULL		--Active Item Only for the past 6 months
    
    
    

    As for the SAP standard Inactive Report, They query all item from OITM table, minus out the result from execution of a standard SP TmSp_FetchActiveItem.

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 17, 2017 at 06:42 AM

    Hi Dect,

    Can you elaborate what is the difference, why your user said the SAP inactive report is more trusted ?
    If you feel the admission date is wrong, how can you tell? the SAP standard report does not show you batch admission date.

    Regards
    Edy

    Add comment
    10|10000 characters needed characters exceeded