1

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

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
Joshua Schroijen
  • 376
  • 6
  • 23

3 Answers3

0

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

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

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.

Joshua Schroijen
  • 376
  • 6
  • 23
0

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.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 08 '22 at 08:59