Quantcast
Channel: SCN : Unanswered Discussions - SAP for Mobile
Viewing all articles
Browse latest Browse all 5512

How to get User Menus using the UI2 Services?

$
0
0

Hi

I am trying to get the User Menus using NetWeaver UI Services, however it doesnot return the correct entries. The services are activated in SICF, I can get the User Details but not able to get the Menus

Here is the code,

              var user = sap.ui2.shell.getUser();

              user.load(

                       {

//                       depthAtRoot: 1,

//                       nodeId: " ",

//                       depthAtNode: 1

                       },

                       function() {                            

                             //set user data in the json model

                 Alert(user.getFullName());  // this works

             }, 

                       function(sErrorMessage) {

                             /* failure handler: e.g. display load error */             

               alert(sErrorMessage);

             } 

             );

             

              //Get the Menus

              var menus = user.getMenu().getEntries();

              var length = menus.length;

        alert("length::"+length); //Length returned is Zero

 

What could be wrong here?

Regards


Viewing all articles
Browse latest Browse all 5512

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>