Skip to Content
-4

Using ABAP Function module in CDS view

Mar 06, 2017 at 01:24 PM

1.5k

avatar image
Former Member

Hello,

Could you please let me know if it is possible to use ABAP function module into CDS ?

The aim here is to convert quantity field with the FM MATERIAL_CONVERT_QUANTITY.

Thanks in advance.

Hicham

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

5 Answers

Best Answer
Horst Keller
Mar 06, 2017 at 04:25 PM
0

Exactly, "CDS view serves to define the structure of an SQL view". How should a SQL view of the database layer call an ABAP FM of the application layer?

Share
10 |10000 characters needed characters left characters exceeded
Jelena Perfiljeva
Mar 06, 2017 at 07:21 PM
1

Google -> CDS view unit conversion site:sap.com -> looks like plenty of information

Share
10 |10000 characters needed characters left characters exceeded
Horst Keller
Mar 06, 2017 at 02:12 PM
0

Do you have any idea what CDS is? If yes, how should that work?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 06, 2017 at 03:07 PM
0

if i understood correctly, CDS view is defined for existing database tables. this CDS view serves to define the structure of an SQL view and represents a projection onto one or several Dictionary tables.

the question here is if it is possible to add a new column to my cds view for example :

  • converted_value

and convert 1KG to 1000G with MATERIAL_CONVERT_QUANTITY ABAP FM instead of function UNIT_CONVERSION like bellow :

define view demo_cds_unit_conversion
with parameters to_unit:abap.unit(3)
as select from demo_expressions
{ id,
dec3 as original_value,
cast( 'MI' as abap.unit(3) ) as original_unit,
unit_conversion( quantity => dec3,
source_unit => cast( 'MI' as abap.unit(3) ),
target_unit => :to_unit,
error_handling => 'SET_TO_NULL' ) as converted_value,
:to_unit as converted_unit }

Thanks in advance.

Hicham

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 11, 2017 at 01:02 PM
0

hi,

Did you manage to consume bapi in cds view ?

Share
10 |10000 characters needed characters left characters exceeded