on 04-23-2018 10:13 AM
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
Hi all
thanks a lot
Best Regards
Stefano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.