Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP CDS unit conversion

madhu21vari
Explorer
0 Likes
3,632

Hi,

i am executing the standard View demo_cds_unit_conversion, i gave to converted unit as 'USD'. But the view is not displaying converted quantity and it is displaying 000000.


Please help me why the conversion is not happening.

Hi,

i am executing the standard View demo_cds_unit_conversion, i gave to converted unit as 'USD'. But the view is not displaying converted quantity and it is displaying 000000.


Please help me why the conversion is not happening.

6 REPLIES 6
Read only

pfefferf
Active Contributor
0 Likes
1,939

As you can see within the CDS view, the error handling is configured, that in case of any error, the result is set to null/the initial value.

In case you wanna find out the reason, copy the view and change the error handling to "FAIL_ON_ERROR" (check the documentation here).

But my "assumption" would be that you wanna do a currency conversion and not unit conversion, because you are trying to pass "USD" (which I interpret as currency) to the unit conversion functionality. For currency conversion you should check CDS View demo_cds_curr_conv.

Regards,
Florian

Read only

madhu21vari
Explorer
0 Likes
1,939

Thank you for your response.

one more question please do you have any predefined function like conversion exit alpha output / input.

Thank you,

Madhavi

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,939

These are no standard views.

They are defined in encapsulated package SABAPDEMOS.

Those are demos for purposes of the ABAP documentation only.

You must not use them productively.

Read only

0 Likes
1,939

Thank you Keller, i went through all the demo programs, but the cast function is not working for my logic.

i have field1 in the table 1 with character length of 20, but this field is compared to the field1 in table 2 which is 10 characters for the same data. Traditionally i am using conversion_exit_alpha_output for conversion .is there any function that replace this functionality in CDS . please assist me .

Read only

madhu21vari
Explorer
0 Likes
1,939

Thank you, i am trying to convert the field ( to conversion exit_alpha _ouput) in the select while creating a view .

is there any functions available to convert the data .

Regards,

Madhavi

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,939

Why don't you simply look into the documentation?