BizOneness: Vendor price lists in SAP Business one

BizOneness: Vendor price lists in SAP Business one

Due to their structure, price lists can be tricky to extract from SAP Business One. One price list you might want to look at is the vendor price list.

Price lists are stored in the ITM1 table in SAP Business One. This subtable of the master inventory table OITM links back to OITM through ItemCode, so we'll join them like that.

I'll make a simple report listing the ItemCode, Name, PriceList and Price.

SELECT
   T0.ItemCode,
   T0.ItemName, 
   T1.PriceList, 
   T0.Price
FROM 
   OITM T0
   INNER JOIN ITM1 T1 ON T0.Itemcode = T1.ItemCode 
        

This gets you a lot of repeats and irrelevant subassemblies, fees, and finished goods. You are looking at all the price lists. You only want the ones for purchased goods and the price of the purchased goods.

For purchased goods, I'll use the OITM.PrchseItem flag to select them. You have two options: I may only want active goods with the isValid flag.

I'll add the WHERE clause

WHERE 
   T0.PrchseItem = 'Y'
   AND T0.isValid = 'Y'
        

For filtering to the vendor price only, most often, you'll filter for that price list. Commonly, you'll find a name like Item Cost or BasePrice. In SAP B1, go to Inventory>Price List>Price List in SAP to list all your price lists and identify the correct one. In my case, I have Base Price as a price list for vendors as price list 1. I'll use 1, and thus add to my WHERE clause

AND t1.PriceList = 1
        

This report lists all purchases. It might be useful to identify types of purchases such as raw materials, supplies, fees, labor, and purchased finished goods. The priceList column's brother flags invntItem and sellItem can help. I'll explain this in a future newsletter, but for now, here's a CASE expression to handle our situation.

     CASE 
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'Y' AND T0.InvntItem = 'Y' THEN 'Purchased Finished Good'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'N' AND T0.InvntItem = 'Y' THEN 'Raw Material'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'Y' AND T0.InvntItem = 'N' THEN 'Fees Labor And Tasks'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'N' AND T0.InvntItem = 'N' THEN 'Supplies'
   END AS "Item Type",
        

I may want one more thing on this list -- who the preferred vendor is. For that, I added T0.CardCode to the report. For clarity, I'll add the vendor's name by joining OCRD and including OCRD.CardName. The full query would look like this:

SELECT
   T0.ItemCode,
   CASE 
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'Y' AND T0.InvntItem = 'Y' THEN 'Purchased Finished Good'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'N' AND T0.InvntItem = 'Y' THEN 'Raw Material'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'Y' AND T0.InvntItem = 'N' THEN 'Fees Labor And Tasks'
      WHEN T0.PrchseItem = 'Y' AND T0.Sellitem = 'N' AND T0.InvntItem = 'N' THEN 'Supplies'
   END AS "Item Type",
   T0.CardCode,
   T2.CardName,
   T0.ItemName, 
   T1.PriceList, 
   T1.Price,
   T0.SellItem,
   T0.InvntItem
FROM 
   OITM T0
   INNER JOIN ITM1 T1 ON T0.Itemcode = T1.ItemCode 
   INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode
WHERE 
   T0.PrchseItem = 'Y'
   AND T0.ValidFor = 'Y'
   AND T1.PriceList = 1
        

This query will get you all the information from inventory and a standard price list. There's a caution here: This way, we only get one vendor, the preferred vendor in SAP B1. We cannot track multiple vendors with these tables or be sure that the Item cost is what we paid the last time we bought it. There are some alternatives to this, which we'll discuss in upcoming newsletters.

Jeroen Erné

Teaching Ai @ CompleteAiTraining.com | Building AI Solutions @ Nexibeo.com

4 个月

Great insights on price lists and their complexities! I recently explored a similar topic and shared tips on crafting vendor price reports effectively. Check it out here: https://completeaitraining.com/blog/a-guide-to-writing-basic-vendor-price-reports-in-sap-business-one. Keep up the valuable discussions!

回复
KALPESH SONI

IT Manager - SAP Business One HANA 10, Wooden Bakery, Kuwait

4 个月

Very informative

回复
Maneesh Sharma

SAP SMEs Solution Expert | Business Process Advisor Using Technology| SAP Certified Application Associate | SAP Implementation Expert | Business Process Mapping

4 个月

Very informative

回复

要查看或添加评论,请登录

Steven Lipton的更多文章

  • Predicates and Predicate functions in HANA

    Predicates and Predicate functions in HANA

    #Bizoneness: Over the last few newsletters, we reviewed functions in HANA and their SQL equivalents. Our last in this…

  • LucaERP part 5: Building A Form

    LucaERP part 5: Building A Form

    In this series of biweekly columns, we're building an ERP from scratch, starting with the general ledger. We've learned…

  • BizOneness: Aggregate Functions in HANA

    BizOneness: Aggregate Functions in HANA

    #HANA #Bizoneness Over the last few newsletters, we've been looking at the basics of HANA. This time, I'd like to look…

  • LucaP: The Anatomy of User Interfaces for ERP

    LucaP: The Anatomy of User Interfaces for ERP

    #LucaP In the last installment of building the LucaP ERP, we discussed the part of the general journal. We have yet to…

  • Bizoneness: Common SQL and HANA types, Operators, and Functions

    Bizoneness: Common SQL and HANA types, Operators, and Functions

    Bizoneness: Common SQL and HANA types, operators, and Functions #Bizoneness #HANA Two weeks ago, I wrote the first of…

    1 条评论
  • LucaP ERP part 3: Adding General Journal Entries

    LucaP ERP part 3: Adding General Journal Entries

    #LucaP *Note:As I've gained a few followers and subscriptions in the last few weeks, I want to remind everyone that I…

  • Bizoneness: Introducing HANA

    Bizoneness: Introducing HANA

    #Bizoneness While I had planned something about the General Ledger for this newsletter, circumstances changed, so I'll…

    3 条评论
  • LucaP ERP part2: The Chart of Accounts

    LucaP ERP part2: The Chart of Accounts

    #LucaP #ERP In the ERP application, we have established credits and debits on a ledger with the five major accounts…

  • The Bizoneness Migration Guide

    The Bizoneness Migration Guide

    #Bizoneness Data migration is taking data from one source and merging it into another source. If you're very lucky, it…

  • LucaP ERP Part 1: The Basic Equation

    LucaP ERP Part 1: The Basic Equation

    #LucaP How do you start to understand the workings of an ERP system? By making one. In this biweekly column, we’ll make…

社区洞察

其他会员也浏览了