cancel
Showing results for 
Search instead for 
Did you mean: 

Automate [Inventory Valuation Simulation Report] in SAP Business One

kenan_jaddeny
Contributor
0 Kudos
454

Without using DI API, I want to achieve the automation of [Inventory Valuation Simulation Report] in SAP Business One 9.3 SQL version, where I can run it for specific items list in a sub SELECT statement.

Our items have 2 types of valuation methods: FIFO & Moving Average.

As per my research I got the following results:

  1. We can use the following SPs in the related database
    1. TmSp_IVIInventoryValueDiffsMAPnSTDItems
    2. TmSp_IVIInventoryValueDiffsFIFOItems
    3. TmSp_IVIInventoryValueDiffsSNBItems
  2. When run SQL Profiler while running the report in SAP B1 we get the following:
    1. exec sp_executesql N'SELECT COUNT(''A'') FROM [dbo].[OITM] T0 WHERE T0.[ItemCode] = (@P1) AND T0.[LstEvlPric] = (@P2) AND T0.[LstEvlDate] IS NULL ',N'@P1 nvarchar(254),@P2 numeric(25,6)',N'RS-2000442-PVS',0
    2. exec sp_executesql N'UPDATE T0 SET T0.[LstEvlPric] = @P1,T0.[LstEvlDate] = @p2 FROM [dbo].[OITM] T0 WHERE T0.[ItemCode] = (@P3) ',N'@P1 numeric(25,6),@P2 datetime2,@P3 nvarchar(254)',3150.083100,'2024-04-20 00:00:00',N'RS-2000442-PVS'

Actually what I'm looking at is away to call the inventory report SP where can run just by calling the SP name with setting the required parameters of valuation method and items list.

How to achieve this?

Regards
Kenan

SAP Business One  Microsoft SQL Server

Accepted Solutions (0)

Answers (0)