on 11-26-2019 7:10 AM
Dear community,
we use travel management Fiori Apps at an SAP ERP system to create travel requests and travel expenses. We need to add custom functionality (customer fields, adaption of UI texts, …) to Fiori app “My Travel and Expenses” version 2 (F0584A).
Therefore I tried to extend the app “My Travel and Expenses” at Web IDE by creating an Extension project, but I get the error message "Extending Smart applications is currently not supported".
I checked the extensibility note 2775801 “My Travel and Expenses (Version 2) - Extensibility concept” https://launchpad.support.sap.com/#/notes/2775801. There stands:
...
OData definition and UI
The SAP Fiori app “My Travel and Expenses (Version 2)” was developed using smart controls.
Smart controls are based on OData annotations which are already part of metadata models.
(GW service: TRV_MTE_SRV)
Depending on your preferences and expertise, 2 options are available to enhance OData annotations:
This will allow customers to add/remove fields, sections and actions to/from smart tables and object pages.
…
Frontend controller extension:
"Travel and Expenses (Version 2)" supports the extension of a base controller by merging the delivered standard controller with a custom controller.
An extension must be added to the app descriptor file in section “sap.ui5.extends.extensions” in file conf/ListPage.manifest.json or conf/DetailPage.manifest.json.
Please note that you can find an example of a controller extension in "Travel and Expenses (Version 2)" app.
Frontend view extension:
"Travel and Expenses (Version 2)" app supports view extensions by using extension points to insert, replace or modify custom content (views or fragments).
An extension must be added to app descriptor file in section “sap.ui5.extends.extensions”.
Please note that you can find an example of a view extension in “Travel and Expenses (Version 2)” app.
...
.
I’m an ABAP developer and unfortunately I have only basic knowledge in area of Fiori App development.
Can anybody give me some information or tips, how I can extend an app using smart controls?
How customer app must be built to be able to use the described extension possibilities?
Or how I can extend the … ANNOTATION_HELPER classes at backend –> means what do I need to do to add additional fields?
Many thanks
Tina
Hi,
my problem has solved in the meantime, as SAP changed the travel apps so that they can be extend at Web IDE now.
regrads Tina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tina,
I can not also fix this issue.
I wanted to add some fields in the detail page.
I have tried to change CL_TRV_MTE_ANNOTATION_HELPER classes -> DEFINE_TRV_EXPENSE_ANNOTATIONS methods, but can not see any changes at metadata.
Also I have wanted to see standard annotations in sap web ide project but can not see them when I selected TRV_MTE_SRV.
What do I need to do to add additional fields?
Regards Huseyin.
Hi Tina,
We are also having the same kind of requirement to add new fields under Details part in My Travel Request(V2) Fiori app.
Version is 1909 . We have done as followed...
1. Enhance the include ..MTR_S_TRAVEL_REQUEST_INCL of struc: MTR_S_TRAVEL_REQUEST with Append structure.
2. Then we have added those fields in MPC _EXT of the project TRV_MTR . In CL_TRV_MTR_MPC_ext -> Extension class, added the properties in MPC EXT by enhancing the code...
To apply the changes into UI level we have used CL_TRV_MTR_ANNOTATION_HELPER.(For testing purpose, added one field only)
But when we reload the App, this newly added field has been not reflected on the screen, . We followed this process since we are unable to import the application into WEB IDe.
Ref.Note: SAP Note
Kindly guide us...
Thanks,
Lakshman.
Hello Lakshman,
I'm not really familiar with adding customer fields at classes MTR_MPC_EXT / CL_TRV_MTR_ANNOTATION_HELPER.
But: did You refreshed all relevant buffers? This is needed as You changed the OData definition at backend system.
I hope buffer refresh will helps - is the field now shown?
Kind regards
Tina
Hi Tina,
Actually screen fields are now able to see after adding the annotations it took almost 20 to 24 hrs to load the screen fields.
Can you please help us on this below points...
Could you please guide us on these points, it would be great help for us...
Thanks,
Hi, I have the same problem with the app F0673A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Tina,
Thank you for your response.
I have added a field from CL_TRV_MTE_ANNOTATION_HELPER classes -> DEFINE_TRV_EXPENSE_ANNOTATIONS methods. I can see to the annotation file.
However, Is there any way to get my new custom field data without extending OData service (TRV_MTE_SRV). I added field to the structure (MTE_S_TRAVEL_EXPENSE).
Because I have got some string problems when extending OData service, as the link below.
https://answers.sap.com/questions/13217782/extension-standard-odata-service-annotation-string.html
How did you get data for your custom field from OData service ?
Thank you for your helps,
Kind regards Huseyin
Hello Huseyin,
I don't change class CL_TRV_MTE_ANNOTATION_HELPER to add a new field. I extended the database table / relevant structures and added the field by extending the OData service.
I had no problem to add the field via annotations, I don't know this string error. Sorry, but I can't help here.
My ZZ Field:
Kind regards
Tina
Thanks Tina,
for some reason I tried generate the annotation.xml via "Import" -> "Annotation File" and it did say that there was no annotation.xml to be found for ODatat Service TRV_MTE_SRV.
But after creating the folder "annotations" in the "webapp" folder the file gets generated via "new" -> "Annotation File"... Happy it works now!
User | Count |
---|---|
86 | |
9 | |
6 | |
6 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.