AR Credit Memo Unit Price Stored Procedure

Dear All,
I am trying to make a SP for A/R Credit Memo wherein the user will not have the option to make the unit price less than the defined price list.
I am using the below SP but its not working and the AR Credit Memo is getting added without any blockage. Please advise
-------------------------------AR Credit Memo Row Price Change-------------------------
IF @OBJECT_TYPE = '14' AND (@TRANSACTION_TYPE = 'A')
  BEGIN
  IF EXISTS(
  SELECT T1.docnum
  FROM ORIN T1 Inner join RIN1 T2 on T2.DocEntry = T1.DocEntry
  INNER JOIN ITM1 T3 on T3.ItemCode = T2.Itemcode and T3.PriceList = '2'
  where t1.docentry = @list_of_cols_val_tab_del
    AND T2.Price < T3.Price)
   BEGIN
    SELECT @ERROR=1,@ERROR_MESSAGE='The price in the line is lesser than the Sales price!'
  END
end
Note : I am also using a SP for blocking AR Invoice with unit price change and that SP is working perfectly fine.
IF @OBJECT_TYPE = '13' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U')
  BEGIN
  IF EXISTS(
  SELECT T1.docnum
  FROM OINV T1 Inner join INV1 T2 on T2.DocEntry = T1.DocEntry
  INNER JOIN ITM1 T3 on T3.ItemCode = T2.Itemcode and T3.PriceList = '2'
  where t1.docentry = @list_of_cols_val_tab_del
    AND T2.Price < T3.Price)
   BEGIN
    SELECT @ERROR=1,@ERROR_MESSAGE='The price in the line is lesser than the Sales price!'
  END
end
Kind Regards,
Ravi

Hi,
Tested only your main part query and working as expected.
1. Make sure correct database is selected for above procedures
2.  Make sure item tested is  same for both invoice and credit memo and same price list.
3. Tested in SQL, there is no problem in blocking AR invoice.
Thanks & Regards,
Nagarajan

Similar Messages

  • Credit memo with different Pricing procedure

    Hi all,
    I am Creating Credit memo with reference to contract, my requirement is system should not copy Contract pricing procedure for Credit Memo we have different Pricing procedure for credit memo
    But the Problem is while i am creating a credit Memo with reference to Contract system will coping contract pricing procedure i need Credit Memo pricing Procedure in credit memo and system should populate all credit memo condition types default y  in credit memo
    i am using credit memo condition types condition class A - Discount or surcharge and Calculat.type - B - Fixed amount
    can any one guide me how config in sap while creating credit memo with reference to sales contract system should copy different Pricing procedure its having own condition types
    Thanks
    Rajesh

    Hi
    Check it out your Pricing type in Copy Controls(SPRO-Sales & Distribution-Sales-Maintain copy control for Sales Documents-Copy control Sales document to Sales document- Select your Source & Target document types- Select your Item categorty- details)
    Regards

  • ABGL Post Credit memo for asset

    Hi,
    In transaction ABGL (Credit Memo in Invoice Year), I wanted to issue credit memo for price difference in acquisition of asset.
    issue background:-
    asset bought without PO (F-90), last year 2010
    Now we want to post Credit memo for this asset.
    Error hit:
    Acquisition value negative in area 01.
    Message no. AA617
    What is this error message mean? How to resolve this?

    Hi,
    in OADB, our setting :-
    Acquisition value = +
    NBV = +
    Investment grants = 0
    Revaluation = 0
    Ordinary depreciat. = *
    Special Depr. = *
    Unplanned Depreciat. = *
    Transfer of reserves = -
    Interest = 0
    Revaluation ord.dep. = 0
    I follow your step, i change acquisition value field to "-", it prompt me this message:-
    Caution: generic values for real depreciation area (refer to long text)
    Message no. AC246
    Diagnosis
    You set up depreciation area 01 so that all types of acquisition values are allowed. However, this only makes sense for derived depreciation areas.
    System Response
    Warning message. The system allows the setting, but note that it can lead to undesired effects for real depreciation areas.
    Procedure
    Check the setting.
    I change theAcquisition value  + to -?

  • Is it possible to deduct the amount of old A/R Credit Memo from new Sales invoice against the same customer ?

    Dear Friends,
    this issue is for my client which is in Retail Industry.
    In sales when customer is buying items of Price 1000 and want's adjustment of Credit Memo Of Price 700 in this Invoice we have to do the following process :
    1) Change The Payment Terms Immediate To Another like Net 30 (Because there is a default payment terms Immediate for all customer)
    2) Add that invoice of Price 1000.
    3) Open Incoming Payment-->Select Customer-->Select Credit Memo of 700-->Select that price 1000 invoice and collect remaining payment by payment means.
    But this process is difficult to follow in Retail Industry. In all cases they collect the payment by Payment Means in A/R Invoice because there is a Payment Terms Immediate for all customers.
    Is there any process by which we can select the credit memo like process in which we use for advance payment ?
    or   any other way to simplify this process ?

    Hi Swapnil Vichare...
    Create a credit Note 1st , then make a invoice with the credit note amount open.. and using the reconcilation you need to reconcile all the trascation...
    No other possible ways, but using sdk you can develop..
    Regards
    Kennedy

  • Can't Set Item Value After Calling Stored Procedure

    In a forms6i program unit, I call a stored procedure. The stored procedure executes successfully. Then I set the value of a date item on a data block to sysdate.
    When I run the form and execute the program unit the stored procedure executes successfully, but then the program unit gives me a No Data Found error when I set the value of the date item on the block. The value of the date item never changes. However, if I comment out the call to the stored procedure, the date item changes to sysdate and there is no error message generated.
    Just to be sure, I moved the logic to set the date item value to a separate button on the form. Then I re-ran the program unit. The stored procedure executed successfully. Then I clicked the button to set the value of the date field on the block, which gave me the same no data found error.
    Then I commented out the call in the program unit and re-ran the test. The program unit executed. Then I clicked the button to set the date value in the block and it was set to sysdate with no errors.
    Why can I not set the date item after running a stored procedure?

    Seems like a MSDTC config issue
    See if this helps
    http://support.microsoft.com/kb/2027550/en-us
    http://zarez.net/?p=1469
    http://danieladeniji.wordpress.com/2013/03/06/microsoft-sql-server-linked-server-error-the-partner-transaction-manager-has-disabled-its-support-for-remotenetw/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • LIV - credit memo : error message shown for unit price variances

    hi
    In LIV for Credit Memo, there is no warning nor error message shown for unit price variances (price different from that in PO).  Request not allow to have unit price variances for Credit Memo. pls advice how can i do it
    thanks

    Hi,
    If you are posting a credit memo against a PO you cannot post it for MORE than the value of the PO, the system gives you the message that says something like, the value entered is higher than the PO value and so the PO value has been used.
    Is this giving you a particular problem?
    remember that youare generating the credit memo and so you can ask the vendor for whatever you want (although you may not actually get it). It is not like entering an invoice where the vendor is specifying the values.
    Steve B

  • Pricing procedure for Credit Memo request WITHOUT reference

    Dear friends,
    I have come across a requirement where credit memo request has to be created without reference to preceding document. i.e. for just giving some credit to customer may be for over pricing or giving some credit to customer (as to maintain good relation).
    So generally we have different pricing procedure for Cr/Dr process.
    thus i have different pricing procedure for Cr/Dr process than normal sales process.
    here i have copied pricing procedure of normal sales and added extra condition type for manual pricing, which overrides basic pricing condition type.
    but calculate the discount and taxes on the manual price.
    I would like to know whether discounts and taxes condition type's should be used
    in the cr/dr process without reference to preceding document. and suggest me the right condition types to be used in cr/dr pricing procedure without reference.
    Thanks.

    HI,
    Remove all the other condition types from the procedure and keep only those which you need.
    Regards
    Abhilash

  • Allow manual price entry in Debit/Credit memo request but not in STD Order

    The same pricing procedure is used for Standard order and Debit/Credit say ZRVA01.
    All condition types in ZRVA01 is set to "D" - not possible to process manually in V/06 since business requirement is not allow for manual pricing in sales order creation.
    When the Debit/Credit note is created(despite of create w/ or w/o reference to billing document), we need to have the user be able to overwrite the price value, able to delete condition type Surcharge, Discount since in some cases for the credit note, the original price might be too high and we only need to credit the customer for the wrong price.
    Question is how to allow 'no limitation'  (change with can be made, field Manaual entries in V/06) for all condtion types in pricing procedure but only for Debit/Credit memo request ?

    Thank you all, but if I create new condition to allow manual, how could I overwrite or delete some non relevant condition type in credit note
    i.e. in STD order we have ZPR0 (base price), ZD01(discount), ZS01(surcharge)  and we found out  that the ZPR0 and ZS01 was over charged, hence, we need to issue the Credit note to the customer, when create a credit memo request, the user will be able to change the value in ZPR0 and ZS01 and be able to delete ZD01 (as it is non relevant for credit note). How such the new condition type would applied?

  • Credit memo request with different Pricing procedure

    Hi all,
    I am Creating Credit memo with reference to contract, my requirement is system should not copy Contract pricing procedure for Credit Memo we have different Pricing procedure for credit memo
    But the Problem is while i am creating a credit Memo with reference to Contract system will coping contract pricing procedure i need Credit Memo pricing Procedure in credit memo and system should populate all credit memo condition types default y in credit memo
    i am using credit memo condition types condition class A - Discount or surcharge and Calculat.type - B - Fixed amount
    can any one guide me how config in sap while creating credit memo with reference to sales contract system should copy different Pricing procedure its having own condition types
    Thanks
    Rajesh

    To call a separate Pricing Procedure for Credit Memo Request, ensure that Document Pricing Procedure for Contract and Credit Memo Request are different. Based on Different Document Pricing Procedure, it is possible to configure to determine separate pricing procedure.
    +In SD, Pricing Procedure is determined (T.Code: OVKK) based on Sales Area (Sales Organization + Distribution Centre + Division) + Customer Pricing Procedure + Document Pricing Procedure. Sales Area is determined in Sales Order Header Level. Customer Pricing Procedure is determined from Customer Master. Document Pricing Procedure is determined from Sales Document Type / Billing Type (if configured).+
    Through copy control detting, maintain Pricing Type as 'B' for carrying out new price.
    Regards,
    Rajesh Banka

  • Query for approval procedure - A/R invoice and A/R credit memo

    Dear all,
    Need one help regarding approval procedure.
    Query :- If we do A/R credit memo and days from A/R invoice to A/R credit memo are geter than 180 then A/R credit memo
                  shoild go to the approval. (A/R invoice shoul be a base documnet)
                  I have made below query, but if days are >180 or <180 it is goinf for a approval. Can any one suggest for this.
    SELECT distinct 'TRUE'
      FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry
    inner join ORIN T3 on T2.DocEntry = T3.DocEntry
    where  DATEDIFF(day,T0.[DocDate],T3.DocDate) > 180
    <a href="http://megaupload2.name/">megaupload</a>, <a href="http://www.btjunkie.name/">btjunkie</a>,  <a href="http://www.freedownloadgames.name/">games</a>

    Hi,
    Try:
    SELECT distinct 'TRUE'
    FROM OINV T0
    inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry AND T2.BaseType = 13
    inner join ORIN T3 on T2.DocEntry = T3.DocEntry
    where DATEDIFF(day,T0.DocDate,T3.DocDate) > 180 AND T3.DocEntry=$[ORIN.DocEntry.number\]
    Thanks,
    Gordon

  • Price Difference Account being hit while making AP credit Memo

    Hello Experts,
    Price Difference Account is being hit while creating AP Credit Memo. I am creating an independent AP Credit Memo (i.e. without any base document). After posting A/P Credit Memo when I look at the Journal Entry it shows 99.43% of amount goes to Price Difference Account and the rest 0.57% goes to Stock account.
    Help required please.
    Thanks & Regards,
    Edited by: Shahzad Nazir on Jan 19, 2011 5:54 PM

    Hi Nazir,
    This entry may have resulted because once you created the GRPO say for item A, the stock would have been consumed in production. And once you created Invoice and after that when you created credit memo, the system could not find the stock so it posted the difference in price difference account. Please run inventory posting list of the items in grpo to check the same.
    Thanks,
    Joseph

  • Only price should reflect in Credit Memo

    Hi
    How to copy only PR00(Price ) from F2 to G2(Credit Memo). Requirement is, client create cedit memo wrt F2 only . And they want to use this G2 if the customer is not paying the balace amount.So the client wants to create a credit memo for the unpaid amount only.No taxation should reflect in the credit memo.
    Is there any settings in copying Control?
    regards
    subhasish

    HI,
    Any how in copy contol settings from one document to other document in VTAF or VTFA there at item level if you select price type as B new pricing will be carried out..
    Then while you are creating any document wrf to any other document then it will not copy the pricing from previous document. It will carry out new pricing there..
    But u have to one OVKK settings there you have to do pricing determination for that Credit memo request or credit memo document pricng also..
    Hope you have understood...
    Regards
    sankar

  • Price getting Re-determined in Credit Memo when PO is entered

    Hello all,
    While creating a credit memo request from an invoice, the prices are copied perfectly, (In the copy control pricing type is D (copy price unchanged)). Now once I enter the PO number the prices of the items are getting re-determined. The items actually have bracket prices, so when each item price is getting redetermined the bracket is only applied to individual items and not to all the items as it should be because the scale formula is for monthly calculation. On close analysis I have found that all items having different delivery dates their prices are getting re-determined. I have checked it is not because of any user exit and its pure Standard SAP code that is doing this based on the XVBKD table, where if there is any entry at the item level, it is re-determining the price. Has anyone faced a similar situation, if yes pls let us know of any solution.
    Thanks in advance
    Anirban

    Dear Rupak,
    Your price / Quantity is copying correctly from Billing means your Copy Control settings are proper.
    Now while creating Credit Memo Request, after you change Quantity you are currently selecting Update & "B" - i.e. Carry out new pricing.
    Here instead of "B" select "A".
    A means - Copy price components and redetermine scales.
    Here the system:
    1. does not determine any new condition types
    2. and only redetermines the scale prices for changed quantities
    I guess this will definitely solve your problem.
    Hope this helps...
    Thanks,
    Jignesh Mehta

  • Approval procedure if user change in the unit price at Purchase Order

    Dear Experts,
    I have defined purchase price list in the item master data. I want an approval if there is any devaition in the purchase price list and unit price which is defined in the purchase order. It will always go for the approval.
    Regards,
    Ravindera

    Dear Ravindera,
    Approval is only working on the header level. Unless you just care about the first line, no approval procedure can be built for other lines.
    You can block those PO by SP_TN instead.
    Thanks,
    Gordon

  • Stored Procedure for Zero Price in GRPO

    Hi all,
       Can anybody let me know the required stored procedure for restricting zero price in the GRPO transaction .
    Thanks in advance ,
    Aditya

    Use this in your SBO_SP_TransactionNotification
    IF @transaction_type = 'A' AND @object_type = '20'
    BEGIN
    IF EXISTS (SELECT T0.ItemCode FROM [dbo\].[PDN1\] T0
    WHERE (T0.Price = 0 OR T0.Price IS NULL) AND T0.DocEntry = @list_of_cols_val_tab_del
    BEGIN
    SELECT @Error = 1, @error_message = 'Item without Price'
    END
    END
    Suda

Maybe you are looking for

  • Addition of key figure in master data attributes.

    Hi All, I have a scenario to DPO (Days payable outstanding) amount in FI. I need to calculate purchases amount From 2LIS_O3_BF Based on the given input dates from customer .The Company code wise ACCOUNT PAYABLE amount  to be calculated from OFI_AP_4.

  • Problems restoring Ipad 3

    I am having problems with my Ipad 3. I went to use it and suddenly i wasnt able to input my password in the unlock screen. I could press the numbers but nothing would seem to show up in the 4 slots to input my password. The screen wasnt frozen and i

  • ONLINELOG

    Hi, I have problem with the second online redo log file. SQL> ALTER DATABASE OPEN; ALTER DATABASE OPEN; ERROR at line 1: ORA-00322: log 2 of thread 1 is not current copy ORA-00312: online log 2 thread 1: 'D:\ORACLEXE\ORADATA\XE\O1_MF_2_266RQQDC_.LOG'

  • Safari Browser White Out in IPAD 3

    Dear All, I am experiencing an issue using ipad at our office for business. We have a web application which is running continuously in safari browser. The site is 24x365 running in the ipad and the ipad is kept as a room terminal infront of meeting r

  • 10.5.7 breaks RDC and Exchange 2007 connectivity?

    I just installed 10.5.7 and now I find I cannot receive mail from our Exchange 2007 server (Entourage 2008) or connect to our file server (SBS 2008 standard). I only found one mention of this anywhere else (http://www.macfixit.com/article.php?story=2