Search code examples
sapui5sap-web-idesap-business-application-studio

Configuring URL parameters in run configurations


My team is migrating to SAP BAS from SAP Web IDE. But when making run configurations I could not find how to configure something important to us: where to configure URL parameters like we could in the Web IDE.

I've consulted several pieces of SAP documentation such as this guide, but came away empty handed. The UI5 CLI also doesn't seem to offer anything interesting in this regard.

Does anyone know whether configuring URL parameters in run configurations is still possible, if necessary in the raw corresponding .env files?

Thank you in advance,

Joshua


Solution

  • I don`t know if you found yet how to do this but in any case, the solution that i found was to modify the Index.HTML file called and put a little piece of Script code

    <!DOCTYPE html>
    <html>
    
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>EXTRATOCLIENTE</title>
        <script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
            data-sap-ui-theme="sap_belize" data-sap-ui-resourceroots='{"br.com.araguaia.EXTRATOCLIENTE": "./"}'
            data-sap-ui-compatVersion="edge" data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
            data-sap-ui-async="true" data-sap-ui-frameOptions="trusted">
            </script>
    
        <script>
            var oStartupParameters = jQuery.sap.getUriParameters().mParams;
            var oComponent = sap.ui.getCore().createComponent({
                name: "br.com.araguaia.EXTRATOCLIENTE",
                settings: {
                    componentData: { startupParameters: oStartupParameters }
                }
            });
            new sap.ui.core.ComponentContainer({
                component: oComponent
            }).placeAt("content");
    
        </script>
    </head>
    <body class="sapUiBody" id="content">
    </body>
    
    </html>
    

    After that you can put some parameter on the url like this : index.html?Kunnr='123'&Kkber='ACRA'

    Renan Pacheco