cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori Leave Approval Extended App error

fenil_doshi
Participant
0 Kudos

Dear All,

I have extended the sap fiori standard project for Leave Approval using sap fiori toolkit , in that I have made the visible property of few fields as hidden in the component.js and after that am launching the same from the eclipse itself , in the app preview the master list is loaded and all the changes are reflected but the detail screen is not rendered and shows an error of invalid key predicate after assessing the error I found out that in my standard app the service which is called is appended with /detail/LeaveRequestCollection(SAP__Origin='LOCAL',RequestId='5A4949DA3B021ED4A593C9F58B1B18FE') but my custom app when it has appended as /detail/LeaveRequestCollection('5A4949DA3B021ED4A593C9F58B1B18FE')  and with error invalid key predicate please find the image for reference :

Also after that when I launch the standard app it also starts showing the same error as in my custom App with the same error and same request is also being called from my standard app which was working fine before launching the extended app, this behavior is really confusing and have almost lost a day with this error not sure about the root cause if anyone out there has faced similar issue and have resolved this then please share the solution as it would be really helpful.

Regards,

Fenil.

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

Please try the URL in GateWay Client or in Rest Client once.

If your URL is containing SAP__Origin your URL need to be as below :

/detail;mo/LeaveRequestCollection(SAP__Origin='LOCAL',RequestId='5A4949DA3B021ED4A593C9F58B1B18FE')

Also try,

/detail/LeaveRequestCollection(RequestId='5A4949DA3B021ED4A593C9F58B1B18FE')

Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

I tried both of them the multi origin parameters url doesn't come in standard applciation url itself and I tried the second url on the gateway client as well but there also it gives the same error. not sure what is the root cause for such a behavior in the extended application using Fiori Toolkit .

Have you faced such a issue before ?

Regards,

Fenil.

AshwinDutt
Active Contributor
0 Kudos

Hello Fenil,

Looks like you are not passing all the the properties which are set as Key in the GW Model.

Please check if there is any other properties set as key other than RequestId,If yes please pass all those as well as READ expects all the Keys to be passed in the URL.

Say you have Filed1 as Key as well then pass that also.

/detail/LeaveRequestCollection(RequestId='5A4949DA3B021ED4A593C9F58B1B18FE',Field1='Fenil')


Please check.


Regards,

Ashwin

fenil_doshi
Participant
0 Kudos

Hi Ashwin,

I haven't constructed any custom url in the project I have just extended the Fiori standard Leave Approval App with Fiori Toolkit 1.1.4 in Eclipse and I am just trying to hide few fields in the views and the same I have uploaded to the system also configuring the Launchpad for that particular App and I can access it as well from the launchpad when the app launches the master list is loaded but while loading the detail view with the url mentioned above it gives the error saying invalid key predicate but the standard application works fine from which I have extended the Leave Approval App so that url is being constructed in the standard itself where all the parameters are passed but in the extension project it gives an error saying invalid key predicate.

Regards,

Fenil.

Former Member
0 Kudos

Hi Fenil,

I can see this thread still un answered, we also faced this issue ,it seems its Multiple Origin Issue:

we have added ;mo at the end of service URL and it got resolved:

Regards,

Trilochan

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Fenil,

Did you comment anything in Component.js relating to SAP_Origin?

Check Chapter 9 in this document. That can give you an idea.

https://scn.sap.com/docs/DOC-54504

Regards

Krishna

fenil_doshi
Participant
0 Kudos

Hi Krishna,

No actually I haven't commented any code in the component.js in the extended fiori project for Leave Approval, please find the below code from the component.js file in my extended project below :

jQuery.sap.declare("hcm.mgr.approve.leaverequests.z_hcm_lr_apv_01.Component");

// use the load function for getting the optimized preload file if present

sap.ui.component.load({

    name: "hcm.mgr.approve.leaverequests", 

    url: jQuery.sap.getModulePath("hcm.mgr.approve.leaverequests.z_hcm_lr_apv_01") + "/../{hcm_lr_apv}" // provide parent project url

    // we use a URL relative to our own component; might be different if

    // extension app is deployed with customer namespace

});

hcm.mgr.approve.leaverequests.Component.extend("hcm.mgr.approve.leaverequests.z_hcm_lr_apv_01.Component", {

    metadata: {

        version : "1.0",

        config : {

            "sap.ca.i18Nconfigs": {

                "bundleName":"hcm.mgr.approve.leaverequests.z_hcm_lr_apv_01.i18n.i18n"

            },

           

            "sap.ca.serviceConfigs": [{

                name: "LEAVEAPPROVAL",

                serviceUrl: "/sap/opu/odata/GBHCM/LEAVEAPPROVAL/",

                isDefault: true

             }],

        },

       

        customizing: {

            "sap.ui.viewModifications": {

                "hcm.mgr.approve.leaverequests.view.S3": {

                    "Overlaps": {

                        "visible": false

                    },

                },

            },

        }           

    }

});

That's why I am confused like where is the issue exactly because I haven't constructed any url myself and is any ways same as the parent project.

Regards,

Fenil.