Hi,
in the Launchpad there is the option to set default values:

Here for example I set the "Sales Organization (Verkaufsorg.)" to "1600":

According to the blog Applying User Defaults in SAP S/4HANA I hoped this would work out of the boxed in a generated RAP (ABAP RESTful Application Programming Model) based Fiori Elements application.
And in the Fiori Elements List Report it indeed does work out of the box:

But when you "Create" a new object (from the List Action), the field stays empty

Does somebody know if there is an annotation or something which can be set to also get the Default Value set in the Object Page?
Thanks
Amadeus
Request clarification before answering.
Hi amadeusgrabmayer.
You can extension your fiori element project in font-end.
sap.ui.controller("yourProjectNameSpace.ext.controller.ObjectPageExt", {
onInit: function() {
var oNavController = this.getOwnerComponent().getAppComponent().getNavigationController();
this.extensionAPI.attachPageDataLoaded(this._setCreateDefaultValue.bind(this, oNavController));
},
_setCreateDefaultValue: function() {
var bCreateMode = this.getOwnerComponent().getModel("ui").getProperty("/createMode");
if (bCreateMode) {
var sPath = this.getView().getBindingContext().getPath();
var oInfoModel = this.getView().getBindingContext().getModel();
oInfoModel.setProperty(sPath + "/SalesOrganization", "1600"); //replace field 'SalesOrganization'
}
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 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.