Configuring URL parameters in run configurations

1.1k views Asked by At

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

3

There are 3 answers

0
Renan Pacheco On BEST ANSWER

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

0
Joshua Schroijen On

I also found a quick-and-dirty way to run with URL parameters. Run configurations are saved in the .vscode/launch.json file. In that file, there's an args array associated with each run configuration with a mention of the index.html file of your project. You can manually append your desired URL parameters to it.

1
Jayashri Hedaoo On

There is a package.json which is created when you create any application. It contains the script to start. You can add your URL parameters here.