Skip to Content
avatar image
Former Member

CDS View error: System error in program CL_RS_BASE and form CREATE_DTAPRO_FROM_DDFIELD-0CURRENCY

Hello Gurus,

I tried to create CDS views for selfstudy, however it caused below error, and I've no idea how to fix it. I searched in SAP Q&A, and found another friend asked same question, however no anwsers so far.

I used S4HANA 1511 for test. I found Class CL_RS_BASE is related SAP BW, is that because there is something missing in the system. If I remove the annotation

@Analytics.dataCategory: #CUBE, then the error will be gone. Cannot find the reason so far.

System error in program CL_RS_BASE and form CREATE_DTAPRO_FROM_DDFIELD-0CURRENCY

Because the main CDS view linked to other CDS views, so I'd like to put all codes here. Hope it will not bother you too much.

My main CDS view code for ZXSZ_I_FlightByAirport:

@AbapCatalog.sqlViewName: 'ZXSZ_IFLIGHTA'
@ClientDependent: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Flight By Airport'
@Analytics.dataCategory: #CUBE
@VDM.viewType: #COMPOSITE

define view ZXSZ_I_FlightByAirport as select from ZXSZ_I_FLIGHT

{
@ObjectModel.foreignKey.association: '_Airline'
key ZXSZ_I_FLIGHT.Airline, 
@ObjectModel.foreignKey.association: '_FlightConnection'
key ZXSZ_I_FLIGHT.FlightConnection, 
key ZXSZ_I_FLIGHT.FlightDate, 
@EndUserText.label: 'Airport From'
@ObjectModel.foreignKey.association: '_AirportFrom'
key ZXSZ_I_FLIGHT._FlightConnection.AirportFrom,
@EndUserText.label: 'Airport To'
@ObjectModel.foreignKey.association: '_AirportTo'
key ZXSZ_I_FLIGHT._FlightConnection.AirportTo,
@Semantics.currencyCode: true
key ZXSZ_I_FLIGHT.Currency, 
@ObjectModel.foreignKey.association: '_AircraftType'
ZXSZ_I_FLIGHT.AircraftType, 
@Semantics.amount.currencyCode: 'Currency'
@DefaultAggregation: #MIN
ZXSZ_I_FLIGHT.FlightPrice, 
@DefaultAggregation: #SUM
ZXSZ_I_FLIGHT.MaximumNumberOfSeats, 
@DefaultAggregation: #SUM
ZXSZ_I_FLIGHT.NumberOfOccupiedSeats,
@Semantics.amount.currencyCode: 'Currency'
@DefaultAggregation: #SUM
ZXSZ_I_FLIGHT.CurrentBookingsTotalAmount, 

/* Associations */
ZXSZ_I_FLIGHT._AircraftType, 
ZXSZ_I_FLIGHT._Airline, 
ZXSZ_I_FLIGHT._FlightConnection,
ZXSZ_I_FLIGHT._FlightConnection._AirportFrom,
ZXSZ_I_FLIGHT._FlightConnection._AirportTo
}

As below are relevant CDS views.

ZXSZ_I_FLIGHT

@AbapCatalog.sqlViewName: 'ZXSZ_IFLIGHT'
@ClientDependent: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Flight'
@Analytics.dataCategory: #CUBE
@Analytics.dataExtraction.enabled: true
@VDM.viewType: #BASIC
define view ZXSZ_I_FLIGHT as select from sflight

association [0..1] to ZXSZI_AIRLINE as _Airline
    on $projection.Airline = _Airline.Airline
association [0..1] to ZXSZ_I_FLIGHTCONNECTION as _FlightConnection
    on $projection.Airline = _FlightConnection.Airline
    and $projection.FlightConnection = _FlightConnection.FlightConnection
association [0..1] to ZXSZ_I_AIRCRAFTTYPE as _AircraftType
    on $projection.AircraftType = _AircraftType.AircraftType
{
    @ObjectModel.foreignKey.association: '_Airline'
    key sflight.carrid          as Airline, 
    @ObjectModel.foreignKey.association: '_FlightConnection'
    key sflight.connid          as FlightConnection, 
    key sflight.fldate          as FlightDate, 
    @Semantics.amount.currencyCode: 'Currency'
    @DefaultAggregation: #MIN
    sflight.price           as FlightPrice, 
    @Semantics.currencyCode: true
    sflight.currency        as Currency, 
    @ObjectModel.foreignKey.association: '_AircraftType'
    sflight.planetype       as AircraftType, 
    @DefaultAggregation: #SUM
    sflight.seatsmax        as MaximumNumberOfSeats,
    @DefaultAggregation: #SUM
    sflight.seatsocc        as NumberOfOccupiedSeats,
    @DefaultAggregation: #SUM
    @Semantics.amount.currencyCode: 'Currency'
    sflight.paymentsum      as CurrentBookingsTotalAmount,
    /* Associations */
    _AircraftType, 
    _Airline, 
    _FlightConnection
}

ZXSZI_AIRLINE

@AbapCatalog.sqlViewName: 'ZXSZIAIRLINE'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Airline'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #DIMENSION
@Analytics.dataExtraction.enabled: true
@ObjectModel.representativeKey: 'Airline'
define view ZXSZI_AIRLINE as select from scarr 
association [0..1] to ZXSZ_I_AIRLINETEXT as _Text
 on $projection.Airline = _Text.Airline
{
key scarr.carrid as Airline,
@Semantics.currencyCode: true
scarr.currcode as AirlineLocalCurrency,
@Semantics.url: true
scarr.url as AirlineURL,
_Text
}  

ZXSZ_I_AIRLINETEXT

@AbapCatalog.sqlViewName: 'ZXSZ_IAIRLINET'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Airline description'
@ObjectModel.dataCategory: #TEXT
@Analytics.dataExtraction.enabled: true
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'Airline'
define view ZXSZ_I_AIRLINETEXT as select from scarr {
    key scarr.carrid as Airline,
    
//    @semantics.language: true
//    key spras as language,
    @Semantics.text: true
    @EndUserText.label: 'Airline Name'
    scarr.carrname as AirlineName
    
}

ZXSZ_I_FLIGHTCONNECTION

@AbapCatalog.sqlViewName: 'ZXSZ_IFCONN'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Flight Connection'
@Analytics.dataCategory: #DIMENSION
@Analytics.dataExtraction.enabled: true
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'FlightConnection'
define view ZXSZ_I_FLIGHTCONNECTION as select from spfli 
association [0..1] to ZXSZI_AIRLINE as _Airline
  on $projection.Airline = _Airline.Airline
association [0..1] to ZXSZ_I_AIRPORT as _AirportFrom
  on $projection.AirportFrom = _AirportFrom.Airport
association [0..1] to ZXSZ_I_AIRPORT as _AirportTo
  on $projection.AirportTo = _AirportTo.Airport  
{
@ObjectModel.foreignKey.association: '_Airline'
    key spfli.carrid        as Airline, 
    key spfli.connid        as FlightConnection, 
    spfli.countryfr         as CountryFrom, 
    spfli.cityfrom          as CityFrom,
@ObjectModel.foreignKey.association: '_AirportFrom'
    spfli.airpfrom          as AirportFrom,
    spfli.countryto         as CountryTo,
    spfli.cityto            as CityTo, 
@ObjectModel.foreignKey.association: '_AirportTo'
    spfli.airpto            as AirportTo, 
    spfli.fltime            as FlightDurationInMinutes,
    spfli.deptime           as DepartureTime, 
    spfli.arrtime           as ArrivalTime,
@Semantics.quantity.unitOfMeasure: 'DistanceUnit'
@DefaultAggregation: #SUM
    spfli.distance          as Distance,
@Semantics.unitOfMeasure: true
    spfli.distid            as DistanceUnit,
    spfli.period            as ArrivalDateShiftInDays,
  /* Associations */
  _Airline, 
  _AirportFrom, 
  _AirportTo
}

ZXSZ_I_AIRPORT

@AbapCatalog.sqlViewName: 'ZXSZ_IAIRPORT'
@ClientDependent: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Airport View'
@Analytics.dataCategory: #DIMENSION
@Analytics.dataExtraction.enabled: true
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'Airport'

define view ZXSZ_I_AIRPORT as select from sairport {
    @ObjectModel.text.element:  [ 'AirportName' ] 
    key sairport.id as Airport, 
    @Semantics.text: true
    sairport.name as AirportName, 
    sairport.time_zone as AirportTimeZone
}

ZXSZ_I_AIRCRAFTTYPE

@AbapCatalog.sqlViewName: 'ZXSH_IAIRCRAFTT'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Aircraft Type'
@Analytics.dataCategory: #DIMENSION
@Analytics.dataExtraction.enabled: true
@VDM.viewType: #BASIC
@ObjectModel.representativeKey: 'AircraftType'

define view ZXSZ_I_AIRCRAFTTYPE as select from saplane {
    key saplane.planetype as AircraftType,
    @Semantics.text: true
    saplane.producer as AircraftManufacturer
}

Thank you so much for your kindly help. :)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 23, 2017 at 03:41 AM

    Hello Scott,

    This is weird, since I copy all your source code in our internal system and I can activate all CDS views successfully, even with the annotation @Analytics.dataCategory: #CUBE.

    Here below is the HANA version of my internal system:

    I guess this is a known issue already fixed by higher HANA version. As I am not really a CDS view expert, I invite my colleague Zhang, Sean to check this issue.

    @Sean,

    For your convenience, I have copied all Scott's view into AG3/001, you can find them in this package:

    Thank you very much for your help!

    Best regards,

    Jerry

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jerry,

      You gave me a very detail explanation, I really appreciate your effort.

      I guess it might be the problem of the system version, I will check it with our colleagues.

      Anyway, thank you so much for your kindly help. You really help so many people by your fantastic blog.

      Again, we are proud of you!!

      Cheers!

  • Mar 23, 2017 at 08:13 AM

    Hi Scott,

    If it's marked as Cube, then some info objects will be generated during the activation.

    If I understood you correctly, the error you mentioned is in the activation phase. since the error is related with class CL_RS_BASE. then it might be related an known issue with Netweaver version.

    I tried to create all your views in one system of S/4HANA 1511 with NW 750, SP6. there is no error.

    Best Regards,

    Sean

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sean,

      Really grateful to get your feedback regarding this topic. Your suggestion really helped, it brings me the direction how to solve this problem.

      I will check the system version with our colleague and try to fix it.

      Thank you so much and wish you have a nice day. :)

  • avatar image
    Former Member
    Mar 24, 2017 at 12:36 PM

    Hi Jerry, Sean,

    CDS cube is available as of NW release 740 SP8 but this is not officially released for productive usage.

    Your issues will be solved if you upgrade your NW to minimum 750 SP4. The corrections/enahncements/improvements done in this area cannot be shipped for NW Release lower than (<) 750 SP4.

    Kindly refer to SAP Note: 2361926 - Consulting:Analytics on ABAP CDS views.

    Best Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded