FM to calculate Customer Discounts

Hello Experts,
                           I need a function module to calculate customer discounts. customer cash discounts that get displayed based on payment terms is what I need.
Any pointers to other threads will be much appreciated.
Thanks!
Rahul.

Try this
CALL FUNCTION 'ISU_S_DISCOUNT_PROVIDE'
EXPORTING
x_rabzus = st_discount_hdr-rabzus
x_ab = wa_discount_item-ab
x_wmode = '2'
IMPORTING
y_obj = xy_obj
EXCEPTIONS
not_found = 1
foreign_lock = 2
general_fault = 3
OTHERS = 4.
all the details of the discount are returned in type xy_obj
change the details of the discount in ie. xy_obj-edsch ie.:
loop at xy_obj-edsch assigning <fs_edsch>.
add 10 to <fs_edsch>-rabproz.
endloop.
set the control parameters and the okcode
xy_obj-contr-no_dialog = 'X'.
xy_obj-contr-db_update = 'X'.
xy_obj-contr-upd_online = 'X'.
xy_obj-auto-edscd_okcode = 'SAVE'.
call the function module to effect the changes
CALL FUNCTION 'ISU_S_DISCOUNT_CHANGE'
EXPORTING
x_rabzus = st_discount_hdr-rabzus
x_ab = wa_discount_item-ab
x_no_dialog = 'X' "!!!!
x_obj = xy_obj
IMPORTING
y_db_update = sw_db_update
EXCEPTIONS
not_found = 1
foreign_lock = 2
cancelled = 3
general_fault = 4
not_authorized = 5
OTHERS = 6.
do not forget to:
commit work.
[end abap coding]
In the pbo of screen 200 (which is called in the 'change' function module') there is a 'suppress dialog' statement, which is executed under a certain condition. So if you set all control switches correctly and do a call function with export parameter x_no_dialog set to 'X' then the changes are processed without interruption of this screen.
You have set the ucomm to 'save' and therefore the pai of screen 200 is processed correctly as well....

Similar Messages

  • Trying to create a formula to calculate a discounted percentage, I need Help!?!?

    I am learning as I go.  I have a form I am working on and I need to calculate a discount.  So I created a combo box that I want to add 5 and 10% into.  I want my salesman to choose one of those percentages and have it calculate the 5% or 10% discount off the subtotal and give me a dollar amount in the discount field.
    5% x $100.00(subtotal) =  discount amount $5.00
    I am really not sure where to start with this.  Hoping for some pros out there to give me the dummies version of how to.

    As the export value for each of these options enter 0.05 and 0.1, resp.,
    and then you'll be able to just use the drop-down field directly in a
    Product calculation, together with the subtotal field, to calculate the
    value of the discount.

  • Active Export list of customer discount set up into Excel file

    Hi Every Body,
    How to export a list of customer discount from plant to Excel Spread sheet.  Please provide me your valuable inputs
    Thanks
    Prasad

    Hi Prasad,
    I think you can use the pricing reports to first generate a list of that discount condition type in a report format and then export it to an excel sheet.
    See if the standard pricing reports in V/LD given by SAP is useful for you if you are using standard condition tables. If not, then you can easily create a new report for your condition type and the condition tables that you have used for that.
    Hope this helps.
    Aribis

  • Customer discount when posting payments

    Hi All,
    I would like to know how to use the customer discount when posting payments.  When using F-28.What is the configuration required for that? Please advise me...
    good answers r appreciated.
    regards
    Karnam

    Hi,
    Steps for Cash Discount allowed to customers:
    1. Create Terms of Payments in  OBB8
    2. Mention your Terms of Payments in Customers Master data:
    Go to FD02: Give your company code and customer a/c number and press enter
    Click on company code data ---> Go to Payment Transactions.
    Give your Terms of Payments here and save the data
    3. Go to the TCode: OBXI
    Give your Chart of Accounts and press Enter
    Here give your Cash Discount Granted a/c or Cash Discount allowed GL a/c number
    Note: Create Cash Discount Allowed or Granted Account with post automatically  in FS00.
    4. Go to F-28 to post Incoming Payments
    Give necessary details and click on Process Open Items
    Select the amount which you want post.
    Note:
    1.Discount  allowed a/c gets posted automatically.
    2. In OBA4, we have to Discount Rate. For ex. 10%.
    3. In OBB8, while determining Terms of Payments we can give discount rate within 10% which we have mentioned in Tcode: OBA4.
    Hope this helps you in detail
    Regards,
    Kannusamy S
    Edited by: Kannusamy.S on May 29, 2009 7:39 AM

  • Scales in  customer  discount needed  at  totals  level

    Hello,
    when  creating  a  value  scale  discount  for  customer ,the  discount  only  applies  when  document  item  fullfills 
    the  scale  value  and  doesnt  take  into  account  the  document  total  value at  header  level?
    What  can  be  wrong?
    Thanks in  advance  and  best  regards
    L

    Hi,
    You can use group condition (KGRPE) option to calculate base value for scales
    system proposes based on items related to same group- If necessary you can use routinue also
    check in condition type customizing
    Thanks
    Chidambaram

  • Is there function module to calculate customer arrears after due date?

    Hello,
    Can any one tell me how to calculate arrears after due date for customer?  Is there any specific function modue?
    BTW, in my case, we do not trigger dunning procedure. There is no data will be updated in table MHND.
    Thank You and Best Regards,
    Muriel

    Dear Andreas,
    Thanks for your reply. I need function rather than standard report, caulse I have to develop a ABAP program.
    I  find function ITEM_OVERDUE_DAYS which solved my problem.
    Thanks for your help.

  • How to calculate tax / discount amount on PO

    Hi,
    I have to calculate tax and discount on Purchase order and have add that to ekpo-netwr to get the actual amount. Can you please tell me how to do that?
    So far I have been taking the EKKO-KNUMV and going to KONV table and serach for records with that KNUMV. But here I am stuck.
    I can not understand (I mean I can not find the field to distinguish) which of the records is actually being used in the PO and has an amount (non-zero) against it, which I see in ME23N in "Condition" at header label.
    Reward Points Guaranteed.
    Regards,
    Anid

    Hi,
    Ya. Actually I need to know the Discount, Indiviual taxes (Like Freight tax etc) which we see the the "condition" tab of Header Data in ME23N. I have to make a total of them and subtract from (Sum of EKPO-NETWR ) to calculate the ACTUAL PRICE.

  • How to calculate Bill Discount, Letter of Credit, Deposits & Cheque amount!

    Hi,
    I have a requirement where in I have to develop a report to display bank balance chart with the following details in the output.They are :
    1. Posting Date
    2. Bill Discount (BD)
    3. Letter of Credit(LC)
    4. Cheque Amount may be cheque issued.
    5. Deposits.
    Above are the information which i have to display based on Posting Date range , Company Code and Bank Key present in the selection-screen.
    Below are my few observations:
    1. To retrieve the Bill Discount, I am first fetching the data from BKPF table by checking the document types 'DZ' ,'KZ', Company code and Posting Date Range. Then using document number,company code present in these entries along with Posting key = 39 and special GL indicator = 'W' retrieving the data like DMBTR,WRBTR from BSEG.
    2. Similarly for Letter of Credit amount retrieving the data in the same way as mentioned above except special GL indicator will be 'Y'.
    Now please correct me if my approach is wrong. Request you all to throw some light as I am Technical Consultant and humbly looking forward to all your help.
    Also, request to let me know the logic or process how one can calculate fourth point as well as Fifth point as mentioned above.
    I am just looking for flow of data/process flow/standard transactions through which I can see these above mentioned things which can help me in building the logic. At least a general approach to this will be appreciated highly.
    Regards,
    Raghavendra Kulkarni.
    Edited by: raghavendra kulkarni on Jul 8, 2010 2:31 PM

    Hi,
    I have a requirement where in I have to develop a report to display bank balance chart with the following details in the output.They are :
    1. Posting Date
    2. Bill Discount (BD)
    3. Letter of Credit(LC)
    4. Cheque Amount may be cheque issued.
    5. Deposits.
    Above are the information which i have to display based on Posting Date range , Company Code and Bank Key present in the selection-screen.
    Below are my few observations:
    1. To retrieve the Bill Discount, I am first fetching the data from BKPF table by checking the document types 'DZ' ,'KZ', Company code and Posting Date Range. Then using document number,company code present in these entries along with Posting key = 39 and special GL indicator = 'W' retrieving the data like DMBTR,WRBTR from BSEG.
    2. Similarly for Letter of Credit amount retrieving the data in the same way as mentioned above except special GL indicator will be 'Y'.
    Now please correct me if my approach is wrong. Request you all to throw some light as I am Technical Consultant and humbly looking forward to all your help.
    Also, request to let me know the logic or process how one can calculate fourth point as well as Fifth point as mentioned above.
    Edited by Raghavendra Kulkarni.
    I am just looking for flow of data/process flow/standard transactions through which I can see these above mentioned things which can help me in building the logic. At least a general approach to this will be appreciated highly.
    Regards,
    Raghavendra Kulkarni.

  • On time Payment - Customer Discount

    Hi All,
    We are generating the invoice and sending it to the customer.
    Now we expect the customer to pay for it.
    We have a policy in our company, like if the customer pays on time or before a cut off date then the customer is eligible for discounts.
    That is, during posting of payments, the customer will be given cash discount.
    How do we map this process in SAP.
    Regards

    Hi,
    In payment terms mention the discount that you want to give and period in days within which this discount to be given.
    In F-28, enter the required data like document date and posting date and system will show you the list of invoices valid till that posting date for that particular customer along with discount in % and in amount based on the payment terms that you have assigned in Sales order
    Hope you understood now
    regards,
    Sagar

  • IS-Media/CA: Customer discount - refund

    Hi,
    We have business issue as below in SAP IS- Media contract accounts and receivables.
    Business Issue:
    We have payment method "P". Customer who has payment method "P" will get discount.
    Business unknowingly removed payment method "P" and processed orders therefore discount is not been given. This is happened only for certain period (1 month). Later business found and they changed to payment method to "P" and now customer is giving with discount.
    Now business would like to give credit to the customer to the extent of the discount amount that has not given during that particular period.
    - We can't give credit memo in our case since the discount amount is very small amount.
    Please advice how to proceed to credit the customer to the extent of that of discount amount.
    Thanks in advance and timely help would be appreciable.
    Regards,
    Muneendra

    Hi Experts,
    Kindly check the issue and suggest us with your points.
    Waiting for your replies.......
    Regards,
    Muneendra

  • Customer Discount

    Hi Team,
    Client requirement is give 20% discount to the customer whenever payment received within 3 days. When receiving payment with clearing (F-28) or (F-32) from the customer system should purpose the discount amount wherever it is applicable. Second scenario is system should auto calcualte the discount amount when payment received in part but within due date.
    Please send your valuable feed back and oblige.
    Best Regards,

    Dear talk2me
    You can maintain via payment terms in OBB8. here you can maintain percentage with due dates.(no.of days)
    also you have to maintain in OBXI  (discount GL a/c)
    Regards
    shankar

  • Issue in using custom discount condition type in pricing agreement at Service Contract line item level

    Hello
    We are facing an issue while using a Z discount condition type in price agreement at service contract line item level.
    A Z Condition type has been created in ECC and assigned to the pricing procedure. This pricing procedure is downloaded in CRM and determined in the service contract.
    A condition maintenance group using this Z condition type is created in CRM and assigned to service contract item category.
    Condition records are created in CRM for this condition type/condition maintenance group for specific products along with sales org and discount percentage.
    But when the price agreement(using this condition type) is used at the item level of a service contract, the system throws errors (related to product/unit of measure and sales org, even though no issues seem to be there)and thus the price agreement is not allowed to be used.
    If anyone has worked on such kind of scenario, please get in touch, I will share more details for the same. 
    Regards
    Ankit Arora

    Dear Ankit,
    Once the pricing procedure is downloaded, please maintain the document pricing procedure at service contract header level, and maintain the customer pricing procedure at business partner sales area billing data.
    In spro, maintain the pricing procedure for the combination of sales area, document pricing procedure, customer pricing procedure.
    Please crosscheck whether the condition table is active or not.
    Regards,
    Maddy

  • Customer discount when netting vendor payment with customer receivable

    Hi Guru,
    We built the netting process in which we net the vendor payment with customer receivable.  There is a problem.  The payment program takes the discount off from the receivable even after the term discount period.  e.g. we have a receivable from the customer with a 1% discount with one month term which expires on July 31.  I do a payment run with a posting date of Aug 26.  The payment program still gives the 1% discount to the receivable thereby reducing the amount of receivable and increasing the amount of our net payment. 
    Is this a glitch?  OR have I missed any configuration??
    Thanks
    Linda

    Hi
    while running the APP for a vendor, the system will suggest all open items due from vendor account and customer account.
    This can be changed at the time of APP.
    Assign points if helpful,
    Regards
    Sunil

  • If qty 11, then calculate 10% discount on amount

    New to java scripting, I've been looking and need help on the following...
    3 fields: 
    quant subtotal
    amount subtotal
    discount
    If "quant subtotal" is >11, then "discount" =  ("amount subtotal" ) (-10%)
    If "quant subtotal" is <=11, then "discount" =  0

    Since its an AcroForm the article provides the correct information.
    The solutuion is to create a caculation script in the "discount" field.
    var nQuantity = this.getFeild("quant subtotal").value;
    if(nQuantity > 11)
        event.value = this.getFeild("amount subtotal" ).value * 0.1;
    else
       event.value = 0;
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

  • Customer Discount with authorization level

    Dear Expert
    Please i want to have this in place when giving discount i.e When we want to give customers discount if the discount is 5% below some one with a lower profile or Role should be able to give but when discount Exceed 5% only a super user should be able to give or authorize. how do i do the settings to achieve this.
    thanks

    Use different condition types. Restrict the upper value of the less controlled condition type.
    Control who has authorization to the more controlled condition using the authorization object for condition types (V_KONH_VKS).
    In your pricing configuration, have the presence of the more controlled condition result in the exclusion of the less controlled.

Maybe you are looking for

  • XML file Synchronization

    Hi All, I have created an XML file from a table in oracle. Now, the requirement is, to update the file as soon as any DML occurs in the respective table. Does anyone have an idea how to implement it?? One way culd b to create trigger on the possible

  • Vbdkr

    hi, From which partner function LAND1 value in VBDKR structure is coming, as VBDKR is a billing document header. LAND1 is a country key. thanks in advance

  • Audit Vault  Agent sizing (harware requirements)

    Hi, I need to provide my customer an estimation of the disk space needed for the Audit Vault Agent, size of archivelog files of the source database so that REDO collector could work without problems, and other demands of source side (audit vault agen

  • Funds management & leading Ledger

    Hi, I am working on ECC 6.0 and have define 0L as leading ledger. Now we want to go for funds management to cater to budgeting requirement. On activation of funds management, for every transaction system ask to define the leading ledger which already

  • IBooks on a computer

    Can I download iBooks onto my computer to read an eBook there.  I don't have an iPad or iPhone.