Skip to Content
avatar image
-4
Former Member

Using ABAP Function module in CDS view

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Mar 06, 2017 at 04: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?

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06, 2017 at 07:21 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06, 2017 at 02:12 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 06, 2017 at 03: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 :

    • 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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2017 at 01:02 PM

    hi,

    Did you manage to consume bapi in cds view ?

    Add comment
    10|10000 characters needed characters exceeded