Skip to Content
0

How to navigate from one entityset to another in SAP Web IDE ?

Dec 13, 2017 at 04:15 AM

152

avatar image

This is the SO report and when i click on any particular SO id, it should navigate to corresponding SO items. where should we implement the code for this in web ide.

Thanks.




so.png (21.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Akshaya Parthasarathy Dec 19, 2017 at 07:02 AM
0

Hi Amrit,

First Define targets and routes in manifest.json for View1 and View2.To do this go to manifest descriptor editor and add targets and routes for both the views.

For View1 , create a pattern that will carry your so to view2.

save changes in manifest descriptor editor and code will automatically be generated in code editor.

Get the so number from View 1.

onSelect of the listItem(list I presume?), get the soNumber

in View1, write the below code

onSelect:function(event){
var soNumber=event.getSource().getSelectedKey();
this.getRouter().navTo("View2",{
soNum:soNumber
},true);
}

in View2 routeMatched event, bind the view with the corresponding SONum

var soNum= oEvent.getParameter("arguments").soNum;
this.getModel().metadataLoaded().then( function() {
 var sObjectPath = this.getModel().createKey("SomeEntitySet", {
SoNum:soNum
   }); 
});  
this._bindView("/" + sObjectPath);
}.bind(this));

Note: Here SoNum points to the property in oData(case-sensitive)

_bindView : function (sObjectPath) {
this.getView().bindElement({ path : sObjectPath});
}

manifest.png (18.3 kB)
Share
10 |10000 characters needed characters left characters exceeded
Irfan Gokak Dec 14, 2017 at 07:12 AM
0

Hi,

Want to navigate from one View another view right? Is that what you want?

Show 4 Share
10 |10000 characters needed characters left characters exceeded

yeah want to navigate from one view to another but based on corresponding so id. In the backend gateway client, we do association right...so want to move from principal entity set to dependent entity set.

0

Share your manifest.json file please

0
{
	"_version": "1.7.0",
	"sap.app": {
		"id": "SO",
		"type": "application",
		"i18n": "i18n/i18n.properties",
		"applicationVersion": {
			"version": "1.0.0"
		},
		"title": "{{appTitle}}",
		"description": "{{appDescription}}",
		"sourceTemplate": {
			"id": "servicecatalog.connectivityComponent",
			"version": "0.0.0"
		},
		"dataSources": {
			"ZSALESORDER1_SRV_01": {
				"uri": "/sap/opu/odata/sap/ZSALESORDER1_SRV_01/",
				"type": "OData",
				"settings": {
					"odataVersion": "2.0",
					"localUri": "localService/metadata.xml"
				}
			}
		}
	},
	"sap.ui": {
		"technology": "UI5",
		"icons": {
			"icon": "",
			"favIcon": "",
			"phone": "",
			"phone@2": "",
			"tablet": "",
			"tablet@2": ""
		},
		"deviceTypes": {
			"desktop": true,
			"tablet": true,
			"phone": true
		},
		"supportedThemes": [
			"sap_hcb",
			"sap_belize"
		]
	},
	"sap.ui5": {
		"rootView": {
			"viewName": "SO.view.SOHeader",
			"type": "XML"
		},
		"dependencies": {
			"minUI5Version": "1.30.0",
			"libs": {
				"sap.ui.core": {},
				"sap.m": {},
				"sap.ui.layout": {},
				"sap.ushell": {},
				"sap.collaboration": {},
				"sap.ui.comp": {},
				"sap.uxap": {}
			}
		},
		"contentDensities": {
			"compact": true,
			"cozy": true
		},
		"models": {
			"i18n": {
				"type": "sap.ui.model.resource.ResourceModel",
				"settings": {
					"bundleName": "SO.i18n.i18n"
				}
			},
			"": {
				"type": "sap.ui.model.odata.v2.ODataModel",
				"settings": {
					"defaultOperationMode": "Server",
					"defaultBindingMode": "OneTime",
					"defaultCountMode": "Request"
				},
				"dataSource": "ZSALESORDER1_SRV_01",
				"preload": true
			}
		},
		"resources": {
			"css": [
				{
					"uri": "css/style.css"
				}
			]
		}
	},
	"sap.platform.hcp": {
		"uri": "webapp",
		"_version": "1.1.0"
	}
}

0

Hi,

Check this Answer

0
Tejas Chouhan Dec 19, 2017 at 09:13 AM
0

Please make sure, association and navigation is handled in odata service. Below entityset needs to be implemented.

GET_EXPANDED_ENTITYSET

Regards,
Tejas

Share
10 |10000 characters needed characters left characters exceeded