Skip to Content

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

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!
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Oct 18, 2016 at 07:46 PM

    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"
    	        }
    		},
    //				
    		}
    					
    		}
    });
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2016 at 08:58 AM

    Does not see anything wrong with the code.

    But there can be many reasons why your extension does not display.

    First I would suggest you to look into Network tab of Developer tools on the browser and ensure that the above component.js is actually loaded.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2016 at 12:28 PM

    Hi Krishna,

    I can see that my Component.js file is loaded. Do you have any other reason as to why or where can i see that the fragment is loaded or check what is wrong?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 18, 2016 at 06:56 PM

    Are you sure that the extension point is "extInformationS4" and not "extInformation"?

    https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps('F0402')

    Regards,

    Jamie

    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded