Validation If unit price of GRPO is different from PO

Hi,
I  am trying to assign 1 validation for scenario mentioned in the subject. The validation which i have tried is showing me error even if i have not changed the unit price at the GRPO level.
IF @transaction_type IN (N'A', N'U') AND
(@Object_type = N'20')
begin
if exists (SELECT T1.[Price], T3.[Price] FROM OPDN T0  INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OPOR T2 ON T2.DocEntry=T1.BaseEntry  INNER JOIN POR1 T3 ON T2.DocEntry = T3.DocEntry
WHERE T1.ItemCode=T3.ItemCode And T1.[Price]<>T3.[Price])
Begin
select @Error = 10, @error_message =
'UNit price is different from PO'
Regards-
Monica.

Hi Mona
Try with this : 
If @object_type='20' AND @transaction_type = 'A'
BEGIN
If Exists
(SELECT TRUE
   FROM PDN1 T0 INNER JOIN POR1 T1
         ON T0.BaseEntry=T1.DocEntry and
            T0.BaseLine=T1.LineNum
   WHERE T0.DocEntry = @list_of_cols_val_tab_del
      AND (T0.BaseRef=' ' or T0.BaseRef IS NULL)
     AND T0.Price!=T1.Price)
Begin
SELECT @error = 1,
@error_message = 'Price is different'
End
END
The logic is same but becasue of data coming into the system . Also check in your database
select * from POR1
Hope this helps
Bishal

Similar Messages

  • Validation for Unit price

    Dear all,
    I want to make validation at row level unit price column.
    If unit price is 0 or blank of any row then document should not be added.
    Is it possible using sp_transactionnotiffication.

    HI
    Its possible through SP.
    Try the below:
    IF (@object_type = '22' AND @transaction_type IN ('A','U'))
    BEGIN
         Declare @Itemcode22 as varchar(255)     
         Declare @UnitPrice22 as nvarchar(255)
         Declare @minline22 int
         Declare @maxline22 int
         set @minline22 = (select min(T0.linenum) from QUT11 T0 where T0.docentry=@list_of_cols_val_tab_del)
         set @maxline22 = (select max(T0.linenum) from QUT1 T0 where T0.docentry=@list_of_cols_val_tab_del)
         while @minline22 <= @maxline22
         begin
        select @Itemcode22=ItemCode from QUT11 where docentry=@list_of_cols_val_tab_del And LineNum=@maxline22
         select @UnitPrice22=Price from QUT1 where docentry=@list_of_cols_val_tab_del And LineNum=@minline22
              IF @UnitPrice22 = '0' or @UnitPrice22 is NULL           
    BEGIN
              set @error = '-1'
              set @error_message = 'Quotation should not be added without unit price in' + @Itemcode22
              END
         set @minline22=@minline22+1
         end
    END
    Edited by: kambadasan on Nov 23, 2011 1:50 PM

  • Price in store was different from the price on the website (in store only)

    I saw on BB website a Toshiba Laptop listed as 379.99 and it says "in store only". So I went to a best buy store in Culver City and they didn't have the laptop but I was told that they had it at the best buy in Glendale. The guy at BB in Culver City was nice enough to try to call them but no one ever answered the phone. So I went to the store in Glendale. I Found the same laptop but I was told that the price would be $549, not $379.99. If the price changed or something, you guys should change it on your website as well.

    Here's the deal.  I just went to my Best Buy Store in Gulfport MS to get this Laptop, after shutting down my PC an 20 minutes before I got to the store.  I got there and they told me that the sale on that particular laptop did not exist and never did.  I tried to go online in the store with All the info I jotted down on this PC.  The webs for the Toshiba laptops L305D-S5892 at 379.99 and L305D-S5893 at 479.99 NO LONGER EXIST.  The sales guy chuckled when I said I got all the info with the SKU's from the Best Buy site.  I just got home and tried to bring up the pages here.  The pages come up NO LONGER EXIST.  I just talked to a friend who tried to purchase the same PC's in OHIO and the store refused to honor the online price yesterday stating that it must have been a mistake and they then tried to sell her a Compaq with 1g ram and 160 g HD, it doesn't even have the required ram to run Vista according to Microsofts website Vista requires 2g of ram. and it was more expensive, compared to the Toshiba that was listed online the Compaq is crap.  Another sales person took over and informed her that Best Buy often places these ad's online for in store purchase only but when you get there they do not honor the sale ad posted to their site.  The sales rep told her it is kind of like a teaser ad, except it's falsely advertising what they have.  They tell you that their store doesn't sell it and send you from store to store trying to find the sale item.  Then when they get enough complaints they remove it from the site as though it never existed.  Without the proof they can not be charged with false advertising.  She stated that it common practice with Best Buy to do this on their electronics.  This is BS if they post it they should honor it.    

  • Block item unit price from decrease in a A/R Invoice

    Dear experts !
    How can I prevent a sales user to decrease an item unit price in an A/R Invoice for a customer for which a special price (based on quantities) was defined. The user can increase the item unit price in the A/R Invoice for that customer.
    Thanks for your precious help.

    Hi yves,
    try below in transaction notification:
    if (@object_type = '13') and (@transaction_type IN ('A', 'U'))
    BEGIN
    IF exists (SELECT * FROM INV1 T0  INNER JOIN ITM1 T1 ON T0.ItemCode = T1.ItemCode and  T0.[PriceList]=*2*  WHERE isnull(T0.[Price],0) <> isnull(T1.[Price],0) and t0.DocEntry=@list_of_cols_val_tab_del)
              Begin
                   SET @error = 30
                   SET @error_message =N'Unit Price  can`t be different than price defined Price List'     
              end
    END
    Change price list number (bold ) in above query to price list number you want.
    you can check price list number using query
    Select * from OPLN
    - listnum column.
    Thanks,
    Neetu

  • PO Unit Price issue

    Hi Gurus.
    Have the following scenario:
    -- PO Qty is changed in Purchase order as per the Quantity delivered. In doing , the System automatically changes the Material Price
    -- Hence when the last invoice is made with reference to PO, the System shows different price than the original one.
    for example
    1.       The PO Qty was initially 462 KM and was changed to 458.7 KM. Hence the Unite Price changed to 40.65 from 40.62 as below
    Gross price = 36.92 /KM EUR
    Surcharges = 1710 (total)
    Unit Price = 36.92+(1710/458.7) = 40.65/KM
    2.       The PO Qty was again changed from 458.7 KM to 444.4 KM as below
    Now the unit price was revised to 36.92+(1710/444.4)= 40.77/ KM
    Requirement: Unit price not to be changed even after the change in the quantity, pls confirm is it possibble
    Thankyou very much

    Hi,
    As per standard SAP your requirement can't be met, please refer the Note 304178 - Absolute conditions in purchasing documents. I have pasted what is contained in the note, this cant be done.
    Summary
    Symptom
    Absolute conditions, for example, used at item level in the purchase order item, are calculated down to the item quantity.For the goods receipt, if a quantity differing from the item quantity is posted, this absolute condition is nevertheless quantity-dependent since it is only calculated proportionally.
    Other terms
    Delivery costs, freight costs, freight, absolute value, FRB1
    Reason and Prerequisites
    For the goods receipt, the actual posted quantity is not yet available, as far as the program is concerned, at price determination.If the actual posted quantity is available later, the condition technique is not used again for the calculation.Therefore the only option remaining is the proportionalization of the condition values.
    Solution
    None.

  • Unit price issues

    HI!
    In m my smartform Im getting the unit price for my invoice from the condition table directly instead of calculating it (Total / Quantity) which creates the rounding up issues. SO this works fine for us but the problem occurs when the condition pricing is like 300/ 1000 L or 4000/ 1000Kgs , what happens is that in the output the unit price and quantity when multiplied contradicts , though the net price per line item shows correctly but suppose qty is 3 L and the unit price is 300/1000L so total os .9 dollars which is correct but in  the form out put it shows  qty= 3 unit price 300  and total .9 dollrs, which si contracdictory, so what I did I used a calculation gaain and divided by condition price by condition pricing unit so when its 300/1000L it would show .3 /L which is now ok but another problem rose with metric ton, since the selling unit is MT and the unit price now after dividing by condition pricngi unit makes it per KG so output would show like qty =3 unit price  4 and total = 12000 dollars , so heer unit price is wrong as it should have been 4000/ Ton as the total os 12000 dollars.
    Is theer a way out to show the correct unit pricing as per the sales unit. I had used the code to just divide the total price of line item  divided by the Quantity but then the rounding up issues came up which was not required .
    read table is_bil_invoice-it_kond into gs_kond
    with key bil_number = gs_gen_del-bil_number
    itm_number = gs_gen_del-itm_number.
    if sy-subrc = 0.
      g_unit_price = gs_kond-kbetr / gs_kond-kpein.
    else.
    ** Loop around and get the price for it
      loop at is_bil_invoice-it_kond into gs_kond
      where bil_number = gs_gen_del-bil_number and
      itm_number = gs_gen_del-itm_number.
        if gs_gen_del-fkimg <> 0.
             g_unit_price = gs_kond-kbetr / gs_kond-kpein.
          endif.
    *  g_unit_price = g_item_tot / gs_gen_del-fkimg.
        endif.
      endloop.
    endif.
    * Get unit price and tot price.
    g_item_tot = gs_gen_del-netwr - gs_gen_del-kzwi3.
    *IF gs_gen_del-fkimg <> 0.
    *  g_unit_price = g_item_tot / gs_gen_del-fkimg.
    *ENDIF.
    thanks

    Well we would ike to grab the unit price directly from the condition mentioned in the billing documents , thats the reason this issue has errupted , We would like to pull it directly from teh document onto the invoice but as I said when its given per 1000 L or /1000 Kgs then the problem occurs as teh quantity may be in MT and the unit price in the condition on document maybe like 4000 dollars per 1000 KGS so it takes 4000 and multiplies bny quantity which is in MT which is 1000 times more than teh correct value. SO as per my piece of code its grabbing the unit price directly from teh condition in the billing document . If I just divide this unit price that I am gettimng from the condition table in Doc by the condition rate KPEIN then it works ok except in few cases like MT. The quantity will show 3 MT suppose and the unit price will be 4000/1000 = $4/ kgs so this will contradict the units but in case of per 1000L it would be ok as the resultant will be in litres only but in case of MT its converted to Kgs so basically a client will see 3 MT QTY for 4 / Kgs  and price will be 12000 dollars which dosent look alright though teh resultant is correct prioce.
    SO this becomes a special case when we dont need to divide by condition unit rate . My question is can be give such kind of exceptions in our code and proceed or will be wrong.
    Thanks

  • Unit price for invoice

    Hi Experts,
    I want to get unit price for invoice line items from BSEG table.
    How to get it.
    What is the unit price field for invoice line items.
    Regards,
    Sangeeta.

    Hi Sasi,
    Should I take the line item amount(WRBTR) for unit price from bseg table?
    Regards,
    Sangeeta.
    Edited by: Sangeeta on Dec 29, 2008 8:00 AM

  • Wrong tax in delivery and invoice (different from sales order)

    Dear All experts/gurus,
    I am curretly facing a problem relate to big error in SBO 2004A SP00 PL 16. It is disgusting actually. the problem is I create Sales order (SO) with 0 % tax (tax code: 0tax). however after I create delivery from this SO,  the price including tax is different from price including tax in the sales order, it raised to be 20%, that is also happened in AR invoice meanwhile I never change the tax code and create 20% in the define tax group form.It is only happened in creation date on 16 february 2007,after that it is all okay, nothing happened. There is none allowed to change tax grup form.
    I am afraid there are bugs or something wrong that made it happened especially relate to technical/developper. I have check company settings, BP settings and other but find out nothing that made this wrong comes. pls help me to solve this situation. I appreciate your answers so much. tks
    Rgds,
    Message was edited by:
            steve andre

    Dear Eddy, Experts/Gurus,
    The problem has appeared again. It happened on 8 March 2007, all deliveries are subjected to have 20% tax meanwhile in column tax % of  define tax groups form is zero. The big problem is how to take back all the error AR invoices sent to customer sites.
    How to cancel the invoices with wrong tax without using credit memo? could I just use querry generator to delete all the taxes created by system ? I want to reprint it and send again to customers but I don't want to use credit memo, I consider to use DTW, but I am not so sure and I wanna ask what Gurus/Experts suggestions in this forum before do that. I appreciate your answer so much. TIA

  • Unit price validation in Purchase Order, Goods Receipt PO and A/R Invoice

    Hello!
    I want to have validation of the Unit Price field in Purchase Order, Goods Receipt PO and A/R Invoice documents.
    This means that user has to get some kind of message if she/he do not enter the Unit price in above mentioned documents.
    I can not use the price lists for this, to get the field populated automatically, because I do not have all the prices...
    I am no longer newbie when it come to SAP, but this really puzzles me
    Thanks,
    Dejan

    Hello guys,
    I have tried to add this code to check if the field Unit Price was empty in the Purchase Order form (Object ID 22)
    But it gives me an error message - Error converting data type varchar to numeric (CINF)
    I am getting the same error message even if I have some value in the Unit Price field...
    I am really confused - what is wrong with it???
    Here is the code from the Transaction notification
    IF (@object_type = N'22' AND @transaction_type in (N'A', N'U') )
         BEGIN
              IF EXISTS (SELECT T1.DocEntry FROM OPOR T0 inner join POR1 T1 on T0.DocEntry = T1.DocEntry
              WHERE (T1.PriceBefDi IS NULL OR T1.PriceBefDi = ' ') AND T0.DocEntry = @list_of_cols_val_tab_del)
                   BEGIN
                        Set @error =1
                        set @error_message = 'Unit Price cannot be blank'
                   END
         END
    Thanks,
    Dejan

  • Purchase order contains an order price unit that differs from the order uni

    Purchase order contains an order price unit that differs from the order unit
    Treatment at the time of "Goods Receipt" so that the stock maintained in Kg and at the same time the purcahse order unit is also to be entered at the time of GR.

    the purchase requisition has your valuation, this is not the price you have with your vendor.
    The valuation in the PR, is automatically copied from material master, dependend on the price control, it is either the moving average or the standard price, the valuation of your current stock. If MAP then this valuation was calculated by historic stock values and receipts from maybe several vendors.
    the valuation is mainly used for the release procedure.

  • How to validate the line item values in OFR - quantity , unit price and UOM

    Hi All,
    Is there any possibility to validate the line items like quantity, unit price and UOM against the DB and stops those invoices at verifier (1 batch =10 invoices) level  if yes could you please let me know the process how to proceed further.
    due to this some the invoices are coming to OFR is with incorrect quantity, UOM and unit price different from PO lines information like quantity , UOM and unit price and those invoices are not validating from the DB and these are processed to EBS and it's effecting the GL and reporting.
    Regards,
    Anil

    Hi ,
    I did not get the exact requirement.Let me bit:
    In standard AP project lines validation will try to compare the quantity , unit price and UOM of line against the database for match which actually performed on export.
    So even if match fails batch will be exported.Now if you want to correct it before EBS,i think you can do it in the business process easily that you are consuming whether BPEL/BPM process.
    We have done this in several projects
    =========================
    But If you want that to be done from OFR side i think we need to code  UserExitPONumberValidate event to  compare the line items values against database.I need to test this also.

  • Value based on the periodic unit price (only with pr.ctrl S)

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Dear all,
    Does anyone know my question?
    Thanks,
    tuff

  • Value based on the periodic unit price(only with pr.ctrl S) field in MatMas

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Value based on the periodic unit price (only with pr.ctrl S) field in mat.

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Unit Price in Item Master Data

    Step no.1) At time of Defining Item Master Data  we are Defining Unit Price say<b> 2,000</b> <b>INR.</b> Data Saved in Price List 01.
    Now with this information I am Preparing Purchase Order.After Selecting Specific Item unit price is reflecting in P.O by default, Then I modified Unit price from 2000 INR to 2500 INR in P.O.
    Step no 2)  I received material by Goods Receipt PO
    Step no 3) When I am posting A/P Invoice based on GoodsReceipt PO in invoice the original Master Data Unit price is Reflecting.
    Now vice versa I made another Transaction also in Another System.
    In Step no 3 it is reflecting the Unit Price of Purchase Order.
    Can I know why it gives different Information for same type of Transaction. Does I followed wrong System.
    Regards
    Narender

    Please confirm the following.
    Once you select a Price in PO it should carry all the way through at the AP Invoice and should not change unless changed manually.
    Are you copying the PO >  Goods Receipt PO > AP Invoice
    And when copying to Goods Receipt PO or Invoice you are not changing the price or Pricelist
    Pls let me know
    Suda

Maybe you are looking for

  • How do I put some songs on the cloud and have others reside on my iPhone?

    Thanks

  • [Solved] Using Artwiz lime with DWM

    Hi all, I have dwm configured with statuscolors and pertag, but changing the font to lime doesn't work. It keeps falling back on the "fixed" font. For the font line in config.h, I've tried: static const char font[] = "-artwiz-lime-medium-r-normal--10

  • WCS is facing instability 4.1.83.0

    We have WCS 4.1.83.0 is installed in 2003 Server but nowadays the same is instable, When we done some analysising and found that "Wireless Network Management Application" was stopped and we were not able restart it. There is no problem with OS as wel

  • Acknowledgement in Java based appliacation

    Hello experts, I am doing SOAP-PI-Proxy Asynchronous scenario. SAP PI exposes the Web service and it is being consumed by Java application. Now client wants either system or application level positive acknowledgement in their application. please sugg

  • Battery fine (?), won't run macbook

    Hey there Fairly new (just out of warranty) MacBook. Battery is charged. Battery works fine in an older MacBook. However, on this laptop disconnecting the power adapter results in instant power off. Using the battery from another MacBook does not cha