Skip to Content

SAP HANA Calculation view Conversion Function Doesn't work in Semantics

Hi All,

I wrote the scalar function to trim leading zeros using the process mentioned in SAP HANA Modeling Guide ( Page 148.

I used this in the semantics layer of a calculation view in the conversion functions column. Defined it as an Internal to external conversion but it doesn't seem to work.

Can you please help me understand why this doesn't work?



FUNCTION "<packagepath>::LeadingZeroTrim" (POLineNumber NVARCHAR(100)) 
	RETURNS TrimmedValue NVARCHAR(100)
	Write your function logic
 select ltrim(:POLineNumber,'0') into TrimmedValue from dummy;
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 29, 2017 at 05:02 AM

    Have you read the following two notes in the chapter?

    1) This feature is currently not supported by SAP analytic client tools. You can convert attribute values through external or customer applications that read column meta data from the BIMC_DIMENSION_VIEW.

    2) These functions are not applied in the database layer. It is used for providing hints to analytic clients on how to convert values before displaying them in the client user interface (UI).

    So if your conversion function will be applied is depending if the client supports that, as the function is not executed on DB layer. If you have tested your calc. view e.g. in HANA Studio the conversion will not be applied, because HANA Studio does not support that. Also (as the first note says) other SAP analytic client tools will not support that too.

    Maybe it is an option for you - if you do not have a client which supports the conversion - to add an additional calculation view on top of your existing calculation view as a kind of consumption view. The additional calculation view can provide the required data format via calculated columns.


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Florian,

      Thanks for the reply. I did read those notes but was hoping that there would be a way to directly apply these functions on the columns. Just like we did conversions in BW info objects. Would have been a cool feature.

      I have a requirement where we need to remove leading zeroes from fields like Material numbers, Purchase order lines, cost centers, GL accounts. Could have been a life saver to have just that function applied at the semantics.