cancel
Showing results for 
Search instead for 
Did you mean: 

FIORI Object Page: RAISE_SHORTDUMP on CREATE operation

joaopedrok
Explorer
0 Kudos
710

Hello,

I'm new in the SAP development world and I need some help to understand an error that I got.

I created a FIORI List Report WITH ABAP, CDS, BOPF. It's a simple application where it has two views, with two tables: ZTABLE_XX1 (5 keys) and ZTABLE_XX2 (7 keys), and both share 5 key fields in common. You should be able to perform CRUD Operations on both of the views.

My Root Consumption View:

@AbapCatalog.sqlViewName: 'ZTABLE_XX1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'XXXXXXXXXXXXXXXXXXXXX'
@UI: { headerInfo: {typeName: 'XXXXXXXXXX', typeNamePlural: 'XXXXXXXX'}}
@Search.searchable: true
@ObjectModel.writeActivePersistence: 'ZTABLE_XX1'
@VDM.viewType: #CONSUMPTION
@ObjectModel.modelCategory: #BUSINESS_OBJECT
@ObjectModel.createEnabled:true
@ObjectModel.deleteEnabled:true
@ObjectModel.updateEnabled:true
@ObjectModel.compositionRoot: true
@ObjectModel.transactionalProcessingEnabled: true
@OData.publish: true
@Metadata.allowExtensions: true
define view ZCONSV_XX1_CV as select from ZTRV_XX1_TV
association [1..*] to ZCONSV_XX2_CV as _Spfli on $projection.key1 = _Spfli.key1
                                                and $projection.key2 = _Spfli.key2
                                                and $projection.key3 = _Spfli.key3
                                                and $projection.key4 = _Spfli.key4
                                                and $projection.key5 = _Spfli.key5
...
...
/*Associations*/
_Spfli

My "Child" Consumption View:

@AbapCatalog.sqlViewName: 'ZTABLE_XX2'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'XXXXXXXXXXXXXXXXXXXX'
@UI: { headerInfo: {typeName: 'XXXXXXXXXX', typeNamePlural: 'XXXXXXXXXX'}}
@Search.searchable: true
@ObjectModel.createEnabled:true
@ObjectModel.deleteEnabled:true
@ObjectModel.updateEnabled:true
@ObjectModel.writeActivePersistence: 'ZTABLE_XX2'
@VDM.viewType: #CONSUMPTION
@ObjectModel.compositionRoot: true
@ObjectModel.modelCategory: #BUSINESS_OBJECT
@ObjectModel.transactionalProcessingDelegated: true
@Metadata.allowExtensions: true
define view ZCONSV_XX2 as select from ZTRV_XX2_TV 
association [1..1] to ZCONSV_XX1_CV as _Sndac on $projection.key1 = _Sndac.key1
                                                and $projection.key2 = _Sndac.key2
                                                and $projection.key3 = _Sndac.key3
                                                and $projection.key4 = _Sndac.key4
                                                and $projection.key5 = _Sndac.key5

...
...
/*Associations*/ _Sndac

In my CDS view, There's an 1..* association beetween the Root Consumption View and it's Child View. In the List Report View (Root) I can CREATE, DELETE and UPDATE items without problems. The DELETE and UPDATE operations also work in the object page, but when I try to do a POST operation no error is displayed on the screen and it just shows "RAISE_SHORTDUMP" in the terminal.

Then I went into the ST22 transaction to see details, and it only said that my association "_Spfli" can only be used as Read Only. Since the error only appears when I try to do a CREATE operation, does It means that the backend is trying to use my association to create a record?

*I get the same error when I try to do the CREATE Operation running a project in BAS or in the Service Preview in Eclipse

I'm stuck in this error for some while now.

Can someone help me on this one?

Thanks in advance,

João

Accepted Solutions (1)

Accepted Solutions (1)

joaopedrok
Explorer
0 Kudos

Solved it by changing the association syntax between the views to

composition [0..*] of ZCONSV_XX2_CV as _Spfli (root view)
association to parent ZCONSV_XX1_CV as _Fath

I also had to implement a create method for my association in my BOPF class:

CLASS lhc_buffer DEFINITION INHERITING FROM cl_abap_behavior_handler.
...
METHODS cba_SPFLI FOR MODIFY IMPORTING entities_cba FOR CREATE rootBhv\_spfli. ... ENDCLASS. METHOD cba_SPFLI. "Insert business logic here ENDMETHOD.
After I made these changes, the CREATE operation in the child view is working as expected.

Answers (0)