cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom action button on object page using extensions

ramesh_putta
Participant
0 Kudos

Hello,

I have developed an app using restful abap( V2,managed) which has a list report(orders) and object page(line items as table) . My requirement is to give user an option to upload the line items from an excel.

I am using the following notes to achieve this

https://blogs.sap.com/2022/01/27/excel-upload-using-rap-part-2/

but while trying to create 'Excel Upload' button on the table tool bar of the object page(line items table) , I am having issues.

I was able to create the button on the initial list report(orders), but unable to create it on the table tool bar of the object page. Please let me know what am i missing.

This is how my code looks in BAS

View Entire Topic
j_pavan_kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ramesh,

Please refer the below UI5 documentation for enabling actions in object page.

Enabling Actions Added Using Extension Points - Documentation - Demo Kit - SAPUI5 SDK

"sap.ui5": {
   "extends": {
      "extensions": {
         "sap.ui.controllerExtensions": {
            "sap.suite.ui.generic.template.ObjectPage.view.Details#my_app::sap.suite.ui.generic.template.ObjectPage.view.Details:: <entity set>":  {
               "controllerName": "my_app.ext.controller.DetailsExtension",
               "sap.ui.generic.app": {
                  "<entity set>": {
                     "EntitySet": "<entity set>",
                     "Header": {
                        "Actions": {
                           "<Action 1>": {
                              "id": "<id>",
                              "text": "<button text>",
                              "press": "<handler function>",
                              "applicablePath": "<entity type property>"
                           }
                        }
                     },
                     "Sections": {
                        "<entity type association>::com.sap.vocabularies.UI.v1.LineItem": {
                        "id": "<SmartTable Facet ID>",
                           "Actions": {
                              "<Action 2>": {
                                 "id": "<id>",
                                 "text": "<button text>",
                                 "press": "<handler function>",
                                 "requiresSelection": true,
                                 "applicablePath": "<entity type property>"
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
}
Thanks,Pavan
ramesh_putta
Participant
0 Kudos

Hi Pavan,

The only difference I see is that I do not have "Sections" part in my code. Does that add the button to the table tool bar in the object page ?

Currently the button is being added to the object page of the line items. But I wanted to have it on the table tool bar of the line items.

Vijay_Kuppusamy
Newcomer
0 Kudos

Hi Ramesh,

Do you find any solution for the creation of custom action button in toolbar for the object page?

 

avinash12
Explorer
0 Kudos
It doesn't work, what do we should give on smart table facet id, is it a item table id..?