Skip to Content
avatar image
Former Member

Formatted search to calculate discount on Sap B1 HANA

HI EXPERTS

I'm trying to create a formatted search on Sap B1 HANA about discount managing on purchase documents. I want to manage 2 discount percentage in document rows. I have created 2 UDF (Discount1, Discount2 - field structure >> Percentage).
These 2 discounts are applied sequentially on each row of the document. The result will fill automatically the standard field DiscPrcnt by a formatted search, when the UDF Discount2 is filled up.
For example in each row we have 20% + 5%. The result will be 24%. This value fills automatically DiscPrcnt.

I need to create a formatted search that reads directly the form opened (not from the table in the database). So I use the variables.
I have done it on SQL SERVER and it works perfectly. Here you are the SQL code:

SELECT (1-((1-($[$38.U_Discount1.number]/100)) * (1-($[$38.U_Discount2.number]/100)))) *100

On Sap B1 HANA it doesn't work.

Any suggestion?

Thanks a lot

Regards

Stefano Pari

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Apr 23 at 10:49 AM

    add fields names in "" like

    SELECT (1-((1-($[$38."U_Discount1".number]/100)) * (1-($[$38."U_Discount2".number]/100)))) *100

    In HANA we need to add quotes for each field in query.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23 at 01:56 PM

    Hi,

    Check this blog how to convert SQL to HANA,

    https://blogs.sap.com/2013/10/30/syntax-of-formatted-search-in-sap-business-one-version-for-sap/

    Try this,

    SELECT (1-((1-($[$38."U_Discount1".number]/100)) * (1-($[$38."U_Discount2".number]/100)))) *100 FROM DUMMY

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 24 at 09:07 AM

    Hi all

    thanks a lot

    Best Regards

    Stefano

    Add comment
    10|10000 characters needed characters exceeded