cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert from internal to external format

former_member199630
Contributor
0 Kudos

Hi all,

There are a lot of cases where SAP saves a value in the tables with an "internal format", this is really common for example with the dates, but this applies to material, customers, etc.

In the case of a material, SAP saves the value with a lot of zeros in the left 000000000030400580, if we see that value through any t-code or SE16 itself to see the data of the MARA table, SAP shows the value without the zeros 30400580, this is because applies an alpha conversion function that convert from internal to external format the value.

When we go to HANA and we create a calc view, the data is always shown as it is in the table with the interal format, I mean with all zeros.

We recently installed the SPS11 and we realized that in the Semantic node, there are a new section called "Converion Functions", where it seems it is exacly what we were looking for, convert from internal to external a value, and also from external to internal.

The situation I am having, I cannot find any standar function in the box. So, maybe there is something we have to install before using them. Do you know?

I tried to look for in the SCN about this but I could find anything, just the normal conversion functions that we can use for example in calculated columns, such as to_date, to_int, to_decimal, etc.

Thanks, Fede

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

Hello Fede,

up to now there are no "standard" conversion functions delivered which you can use. Also not via a separate package (of course it might be that specific packages contains conversion functions for their own needs, but not with the intention for a general reuse).

You have to implement your own scalar functions which do the required conversion.

Regards,

Florian

former_member199630
Contributor
0 Kudos

Hi Florian,

Ok, Now I understand, I should create my own functions.

To test this, I created a function but I cannot find it in the Internal to external dialog box.

Do you know why?

The function seems to be working as I expect.

Thanks, Fede

pfefferf
Active Contributor
0 Kudos

You have to create the function as repository object (.hdbscalarfunction).

former_member199630
Contributor
0 Kudos

Hi Florian,

First at all, thanks for your help!

I could create the scalar functions and now I can see them in the dialog box in the semantics.

But, it seems they are not working.

For example, I did two scalar functions very simple to add zeros and remove zeros for the MATNR (Material).

When I use the functions in a dummy select, they are working ok.

But when I include the functions in the Semantic, I expected to convert the values when I do a data preview, or when I use them in a variable, removing the left zeros (converting to external format).

Data preview example:

Example in the variable value help.

Thanks, Fede

pfefferf
Active Contributor
0 Kudos

To my knowledge (and the little piece of information available in the Modeling Guide) there is no support for that conversion functions in the data preview or in other SAP analytic client tools. The conversion has to be done by the clients themself using the functions available in the metadata information (_SYS_BI.BIMC_DIMENSION_VIEW).

Regards,

Florian