Skip to Content
avatar image
Former Member

How can ;you generate headers from CDS views

I have built a CDS view that contains a field generated by a CONCAT statement 'concat( carrid, connid ) as flight'. The actual CDS view is as follows:

@AbapCatalog.sqlViewName: 'zha400_jm_cds_4'

define view zha400_jm_ddl_4 as

select from sbook

{ concat( carrid, connid ) as flight,

fldate, bookid, customid, loccuram }

I use this view in an ABAP program and it returns the expected result in an internal table. When the table is used in an ALV, there is no column heading for that field. I thought that I could use the annotation @EndUserText.label: 'Flight' immediately prior to the concat line to generate a heading, but it does not work. What I want to know is how can I generate the column heading?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 20, 2017 at 11:05 PM

    ALV don`t support CDS annotations (yet), so you have to set the column text with the field catalog/column definition

    If you want to use annotations you can read them with class CL_DD_DDL_ANNOTATION_SERVICE (if already exists) or tables DDHEADANNO and DDFIELDANNO)

    Add comment
    10|10000 characters needed characters exceeded