cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA Conversion functions(in Semantic node) - Remove Leading zero

01-24-2017 8:28 PM
2566 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi Experts

I am trying to use scalar function which i created to remove leading zero and wanted to use it in conversion function under semantic node but I can not find this function when i search it.

CREATE FUNCTION "AKHATTI".Remove_Leading_Zero (im_Var1 NVARCHAR(20)) 
	RETURNS result NVARCHAR(20)
	LANGUAGE SQLSCRIPT
	SQL SECURITY INVOKER AS
BEGIN
result := REPLACE(LTRIM(REPLACE(:im_Var1, '0', ' ')), ' ', '0');
END;

The function is working perfect when tested with Select query.

Also I read in another post that this can be achived by adding function in repository but not sure how to add this function to repository, need your help here.

Thank you.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

You can follow the steps in tutorial Create a Scalar User-Defined Function to create a scalar function, which can be used as conversion function in a calc. view. Different from the tutorial you can create the function also without using a XS Project in the Eclipse based tooling. As you are using XS Classic, it is possible to add the function directly in the Eclipses based tooling via the Repositories view in the SAP HANA Development perspective or via the HANA web-based development workbench editor.

Please consider the restriction, mentioned in the documentation, which describes that conversion functions are not supported by SAP analytic client tools at the moment. E.g. SAP BusinessObjects Lumira or even the data preview in the modeling environment will not consider the conversion functions.

Regards,
Florian

Former Member
0 Likes

Hi Florian

As always appreciate for your time & help on this.

I was able to add scalar function into repository and now i can add same in semantic node but looks like it is not working in Analysis for office as mentioned by you, hopefully SAP will add this feature in future.

I have one more silly question just for my knowledge - I did above step in Dev system and when I tried to do in Quality I was not able to(as shown in screenshot)..Is this object can only be transported or something I missed in Quality.(I am doing lot of HANA modeling in Quality for some reason)

Thank you once again.

pfefferf
Active Contributor
0 Likes

Not knowing your setup and not understanding the "some reasons" why modeling on QA is necessary :-), I would assume that you do not have the required package privileges (e.g. REPO.EDIT_NATIVE_OBJECTS, REPO.ACTIVATE_NATIVE_OBJECTS, REPO.MAINTAIN_NATIVE_PACKAGES in case of native objects/packages and/or REPO.EDIT_IMPORTED_OBJECTS, REPO.ACTIVATE_IMPORTED_OBJECTS, REPO.MAINTAIN_IMPORTED_PACKAGES in case of imported objects/packages).

Former Member
0 Likes

Hi Florian

Due to cost we have only 2 bobj server(Qua,Prod) and sap S4hana have 3 server(Dev,Qua,Prod) 🙂

I tried assigning those package privilege but was not successful, I will play around in security and figure it out..

Thank you for help 🙂

Answers (0)