Skip to Content
0

Use BOPF action in smart template

Dec 08, 2016 at 03:43 PM

691

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Christian Drumm
Jan 25, 2017 at 12:30 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Martin Fischer
Dec 09, 2016 at 08:50 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Martin Fischer
Dec 14, 2016 at 12:34 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Tilmann David Kopp
Dec 27, 2016 at 01:36 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Thomas Nelissen Jan 04, 2017 at 03:24 PM
0

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


screen.jpg (133.3 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Alexander Vasilevich Tsvetkov Jan 16, 2017 at 01:08 AM
0

Hi.

I have same problem. The solution exists ?

Share
10 |10000 characters needed characters left characters exceeded
Jonis de Klerk Feb 17, 2017 at 03:34 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded