Skip to Content

Fiori Elements : How to navigate to an object page in Edit mode ?

Hello,

All is in my title.

In my scenario, I have an Object page which describe the Sales order header and a list of Items.

When the user click on the action Create new Item (custom button) the application shows a popup to propose to the user a Wizard. At the end of the wizard, the application adds the item into the sale order, and then I do a navigation to the newly item.

But I want to navigate directly in edit mode.

How to handle it ?

Regards,

Joseph

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 13 at 06:52 AM

    Hi! Use Url parameter "preferredMode". Here is navigation example with draft:

    var oCrossAppNav = sap.ushell.Container.getService("CrossApplicationNavigation");
    
    oCrossAppNav.toExternal({
        target: {
            semanticObject: "MySemanticObj",
            action: "manage"
        },
        params: {
            MyObjectUUIDProp: "ffcb1ce2-9b04-449b-a851-012f2740ec61",
            MyObjectDraftUUIDProp: "00000000-0000-0000-0000-0000000000",
            preferredMode: "edit"
        }
    });
    
    
    Add comment
    10|10000 characters needed characters exceeded

    • Hello Efim Parshin,

      Your solution was the rigth one. It was difficult for me to understand what was your parameters but after debbuging and think I found the solution thanks to you.

      Here is the final code :

      var oCrossAppNav = sap.ushell.Container.getService("CrossApplicationNavigation");
      oCrossAppNav.toExternal({
      	target: {
      		semanticObject: "ZSD_DT",
      		action: "manage"
      	},
      	params: {
      		Vbeln: response.Vbeln,
      		preferredMode: "edit"
      	}
      });

      Thanks a lot.

      Regards,

      Joseph

  • Feb 22 at 05:16 AM

    Hi Joseph, That's the standard behaviour under the ABAP Programming Model for SAP Fiori.

    Have you checked for some hints in the configuring internal navigation doco... ?

    https://help.sap.com/viewer/468a97775123488ab3345a0c48cadd8f/1709%20001/en-US/2c65f07f44094012a511d6bd83f50f2d.html

    Rgds

    Jocelyn

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jocelyn,

      Here is the version which working fine with the sap.suite.ui.generic.template.extensionAPI.NavigationController

      manifest.json

       "crossNavigation": {
                  "inbounds": {},
                  "outbounds": {
                      "NavigationID": {
                          "semanticObject": "ZSD_DT",
                          "action": "manage"
                      }
                  }
              }

      Controller.js

      var oNavCtrl = this.extensionAPI.getNavigationController();
      oNavCtrl.navigateExternal("NavigationID", {
      Vbeln: response.Vbeln,
      preferredMode: "edit"
      });

      Regards,

      Joseph