cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Approve Purchase Order Fiori App - Fragment not getting loaded

former_member211078
Participant
0 Kudos
Hello SAP Community,

I have to extend the S4 view of Approve Purchase Order Fiori App. My requirement is to show a custom tab (line item level) from ME23N in Item details view S4 of the App. I have used the extension point - "extInformationS4" for inserting a fragment - extPOStockData.fragment.xml. The code of my component.js file is as follows:

//// Declaring a new module path
jQuery.sap.declare("zui.s2p.mm.purchorder.approve.Component");

sap.ui.component.load({
	name : "ui.s2p.mm.purchorder.approve",
	url : jQuery.sap.getModulePath("zui.s2p.mm.purchorder.approve")
			+ "/../MM_PO_APV"
});

ui.s2p.mm.purchorder.approve.Component.extend(
				"zui.s2p.mm.purchorder.approve.Component",{
					metadata : {
				version : "1.0",
				config : {"sap.ca.i18Nconfigs" : <br>              {"bundleName" : "zui.s2p.mm.purchorder.approve.i18n.i18n"	}}},


	customizing : {	"sap.ui.viewExtensions" : {
	"ui.s2p.mm.purchorder.approve.view.S4" : {						"extInformationS4" : {							className : "sap.ui.core.Fragment",
	fragmentName : "zui.s2p.mm.purchorder.approve.view.extPOStockData",			type : "XML"	}}},}
				});

However, the issue is that i don't think my fragment is being loaded because i am seeing the view of standard app only. Can anybody let me know what is that I am missing out here. Is my code ok. If yes then is there any way to identify the root cause of this issue. Also our SAP UI5 libraries version is 1.28. So do we need to update them or is there any other way out.

Waiting for help!
View Entire Topic
former_member211078
Participant
0 Kudos

Yes In code it is written to use extInformationS4 and not extInformation because it is duplicate in the app. Anyway i got the ans. It was a minor mistake in the code. Actually the customization is a part of metadata.

//// Declaring a new module path
jQuery.sap.declare("zui.s2p.mm.purchorder.approve.Component");
// use the load function for getting optimized preload file if present
sap.ui.component.load({
	name : "ui.s2p.mm.purchorder.approve",
	url : jQuery.sap.getModulePath("zui.s2p.mm.purchorder.approve")
			+ "/../MM_PO_APV"
// we use a url relative to our component; might be different if
// extension app is deployed with customer namespace
});
// // Declaration for including the new changes
this.ui.s2p.mm.purchorder.approve.Component
		.extend(
		"zui.s2p.mm.purchorder.approve.Component",
	{
	metadata : {
	 version : "1.0",
		config : {
			// "sap.ca.i18Nconfigs" : {
			// "bundleName" :
			// "zui.s2p.mm.purchorder.approve.i18n.i18n"
			// }
			},
					
// //Linking my fragment to the EnhancementPoint
		customizing : {
			"sap.ui.viewReplacements" : {
			"ui.s2p.mm.purchorder.approve.view.S4" : {
			"viewName" : "zui.s2p.mm.purchorder.approve.view.extPOStockData",
			"type" : "XML"
			}
              		},
//
	"sap.ui.viewReplacements" : {
		"ui.s2p.mm.purchorder.approve.view.S3" : {
        	"viewName" : "zui.s2p.mm.purchorder.approve.view.extPOHistory",
		"type" : "XML"
	        }
		},
//				
		}
					
		}
});