cancel
Showing results for 
Search instead for 
Did you mean: 

RAP Model trigger create action from controller in list report

Altarkawi
Participant

Hello experts,

I know that the navigation in rap model applications are standard behavior. but I'm trying to write an custom action in a RAP Model based application, is there anyway to trigger Create action? or maybe navigate to object. is there anything that could help?

all suggestions are welcomed.

Mohammed

Accepted Solutions (0)

Answers (3)

Answers (3)

sandeep_rs
Advisor
Advisor

Hi,

You should be able to do so by calling the createDocument method of the controllerextension (page)

Best Regards,

Sandeep

Altarkawi
Participant
0 Kudos

Hi sandeep.rs thank you for your answer, does it work with oData v2? i got an error like following:

Best regards

Mohammed

0 Kudos

If you want to create custom action(comparing to standard CRUD operations) in List Report/Object page, there are two ways:

1. Define action in behavior pool of root entity object.

action testaction;

static action testaction; 
(if you do not need context of object, which means, action is enabled without clicking on row)

Display it in list report or object page


//action visible in list report table
UI.lineitem{position: 10, label 'testactionlabel', type: #FORACTION, dataAction: 'testaction'}

//action visible in object page
UI.identification{position: 10, label 'testactionlabel', type: #FORACTION, dataAction: 'testaction'}


If you want some input parameters from user before invoking action, one way is to create abstract entity which appears as dialog.

https://blogs.sap.com/2021/01/18/abap-rap-enabling-custom-actions-with-a-dialog-with-additional-inpu...


2. On frontend side defined in manifest.json

There you will handle everything in extension controller.

https://sapui5.hana.ondemand.com/sdk/#/topic/7619517a92414e27b71f02094bd08d06.html

If you want to invoke abap rap action defined in behaviour pool in extension controller, then you can use ODATA V2 api for that:

https://sapui5.hana.ondemand.com/sdk/#/api/sap.suite.ui.generic.template.ListReport.extensionAPI.Ext...

Sidenote: If you want to trigger standard CRUD operations in ODATA V2, then you can use oModel.create, oModel.update and oModel.remove methods, but i´m not sure, if it will be handled by ABAP RAP runtime(not tested it yet).

Br,

sandeep_rs
Advisor
Advisor
0 Kudos

Hi Mohammed,

Sorry I should have checked first! I was talking about the fe V4 here. I am not aware if this is allowed in fe V2 - let's wait to hear from other colleagues then!

Best Regards,

Sandeep