cancel
Showing results for 
Search instead for 
Did you mean: 

Use BOPF action in smart template

ceedee666
Active Contributor
0 Kudos

Hi all,

I'm currently trying to create a BO using a BOPF model based on a CDS view including an simple action. Based on this I'd like to create a Fiori application using the smart templates. The BO seems to be OK. I was able to test it using the BOPF test ui and execute the action.

Generation of the Fiori app using the smart template also works fine. However, when I try to execute the application nothing happens. I investigated in a little more detail and notices the following error message in the developer tools in Chrome:

Uncaught (in promise) Error: "TestFioriProgModel::sap.suite.ui.generic.template.ListReport.view.ListReport::Zcd_C_Salesorder--action::ERROR: Mandatory Value for Action not found" is not a valid ID.

The underlying error seems to be that the call to the service

/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations(TechnicalName='ZCD_C_SALESORDER_CDS_VAN',Version='0001')/$value/

already returns the error from the backend. The returned document contains the following values:

<Record Type="UI.DataFieldForAction">
    <PropertyValue Property="Label" String="Set lifecycle status to Paid"/>
    <PropertyValue Property="Action" String="ERROR: Mandatory Value for Action not found"/>
    <Annotation Term="UI.OperationGrouping" EnumMember="UI.OperationGroupingType/Isolated"/>
</Record>

Here is what my oData and object model annotations look like:

@OData.publish: true

@ObjectModel.semanticKey:  [ 'SalesOrderID' ]
@ObjectModel.representativeKey: 'SalesOrderID'
@ObjectModel.createEnabled: true
@ObjectModel.updateEnabled: true
@ObjectModel.deleteEnabled: true 
define view Zcd_C_Salesorder as select from Zcd_I_Salesorder 
    association [0..*] to Zcd_C_Salesorder_Item as _Item on $projection.SalesOrderID = _Item.SalesOrderID {
    @UI.lineItem.position: 10
    @UI.lineItem : [
        { type: #FOR_ACTION, position: 1, dataAction:'BOPF:SET_OVERALL_STATUS_TO_PAID', label: 'Set lifecycle status to Paid'  }
    ]
    @Search.defaultSearchElement: true
    @UI.identification: { position: 10, importance: #HIGH}
    @UI.selectionField: { position: 10}
    key Zcd_I_Salesorder.SalesOrderID, 

Does anyone have an idea what the root cause of this error is and how to solve it?

Thanks,

Christian

Accepted Solutions (1)

Accepted Solutions (1)

ClausB
Active Participant

Hello, everybody,

I had to deal with that problem, too.

It looks like the annotation model was damaged by the synchronization.

Note 2820290 fixed the problem

Claus

Answers (7)

Answers (7)

Former Member
0 Kudos

I've been struggling with the same error for some time, apparently there is a tutorial out there where the names didnt match. just delete that project, recreate it after changing and it should work

ceedee666
Active Contributor
0 Kudos

Hi all,

after not being able to solve the issues I tried to implement the scenario again using another backend system. This all worked like expected. The system I got the errors was an SAP NW ABAP Dev Edition (7.50 SP2). For the working version I used a SAP NW ABAP 7.50 SP4 system.

As a result I suspect that the reason for the error is the version of the backend system.

Hope this helps,

Christian

Former Member
0 Kudos

Hi.

I have same problem. The solution exists ?

thomasnelissen
Participant
0 Kudos

Hi Christian,

I had the same problem, make sure the name of the action in the BOPF object is exactly the same as the name in the CDS annotation. If the name in the annotation does not match the name of the action in the generated business object, strangely enough, the annotation file will not generate correctly.

In BOBX the action should look like this:

Hope this helps!
Thomas

ceedee666
Active Contributor
0 Kudos

Hi Thomas, Tilmann,

I checked both of your suggestions. Everything seems to be OK. The exporting type is "Node" and exporting multiplicity "1:1". Also the action name is the same as in the CDS annotation.

Any other ideas? Maybe I need to start to build a example from scratch instead of trying to follow an tutorial...

Christian

former_member190794
Active Participant
0 Kudos

Hello Christian,

could you please ensure that your BOPF action is configured to exporting type "node" and exporting multiplicity "1:1"? Does this solve your issue?

Best regards
Tilmann

cyclingfisch_
Active Contributor
0 Kudos

Hi Christian,

sorry for the late answer. There was no email notification 😉

Unfortunately I have no idea where to start. Maybe one of the BOPF Team members can give us a hint?

Btw: is there no possibility to mention another user within the answers?

Martin

cyclingfisch_
Active Contributor
0 Kudos

Hi Christian,

I suggest to set a break point in the framework method which called when an BOPF action is executed:

/BOBF/CL_FRW

/BOBF/IF_FRW_SERVICE_LAYER~DO_ACTION

If this does not help, you can also check if there is a BOPF exception raised. To check this set a break point in the constructor of the BOPF exception root class

/BOBF/CX_FRW

I hope this helps!

Cheers,

Martin

ceedee666
Active Contributor
0 Kudos

Hi Martin,

thanks for the reply. However, the BOPF action itself is OK. I can execute it using the BOPF test tools. No error occurs in this case.

What doesn't seem to work is the interpretation of the annotations when the catalogue service (/sap/opu/odata/IWFND/CATALOGSERVICE) is called. Any suggestions where to start to debug the interpretation of the annotations?

Christian