Skip to Content
0

Formatted search to calculate discount on Sap B1 HANA

Apr 23 at 09:13 AM

23

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Abdul Mannan Apr 23 at 10:49 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Apr 23 at 01:56 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 24 at 09:07 AM
0

Hi all

thanks a lot

Best Regards

Stefano

Share
10 |10000 characters needed characters left characters exceeded