2017 Mar 06 1:24 PM
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
2017 Mar 06 4:25 PM
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?
2017 Mar 06 2:12 PM
Do you have any idea what CDS is? If yes, how should that work?
2017 Mar 06 3:07 PM
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 :
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
2017 Mar 06 4:25 PM
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?
2017 Mar 06 7:21 PM
Google -> CDS view unit conversion site:sap.com -> looks like plenty of information
2017 Oct 11 2:02 PM
2019 Jan 16 9:43 AM
Hi,
CDS Views are basically designed to interact the DB directly and CDS create entity in DB level so basically we are using native DB quarry in CDS. But for any ABAP function or class method there is a way we can use inside our CDS via AMDP, so we call it CDS view with table functions. for that we have to create AMDP class and method and inside our method we can call Function module or Bapi. Then we can use the AMDP class method in side our CDS view to achive our requarement but compare to other CDS views AMDP uses CDS will decrease your performance.
Thanks,
Suman Sekhar Mohapatra
2023 Jun 04 1:04 PM
2023 Jun 04 1:17 PM