cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPUI5 Smart Variant Management vs Flexibility Service

Former Member
0 Likes
8,591

Hello Experts,

I am having trouble with Smart Variant Management control.

I've made a demo of smart variant management in Web-IDE. But it fails when Save the variant. From the debug tool, I see it requests /sap/bc/lrep/actions/getcsrftoken/ and then fails with 404 error. As documentation says, that is part of SAPUI5 Flexibility Service. So my question is, how can I make smart variant management work?

Thanks in advance!

Ray

--------

p.s.

I've tried "Run as Web Application" and "Run as SAP Fiori Launchpad Sandbox", and got the same 404 error of request /sap/bc/lrep/actions/getcsrftoken/.

Accepted Solutions (0)

Answers (5)

Answers (5)

If you wish to locally - be it Web IDE or any other tool - work with your variant management tool, you have to enable a Fake Connector that catches your request and stores it locally.

In your html file - that loads your ui libraries and starts the app itself - add the following to the data-sap-ui-libs property: sap.ui.fl

Afterwards when the ui5 core is initialized, add the following lines

sap.ui.getCore().attachInit(function() {
  ...
  sap.ui.require(["sap/ui/fl/FakeLrepConnectorLocalStorage" 
    ], function (FakeLrepConnectorLocalStorage) { 
      FakeLrepConnectorLocalStorage.enableFakeConnector( 
        null, 
        "tl.ibp.manage.demand.lifecycle", // the ID of your project or namespace
        "1.0.0" // can be anything
      );
  });
  ...

When these two missing entries were added to the HTML file, the framework didn't tried to call out anymore to the sap/bc/lrep/actions/getcsrftoken/ service but handled it all by itself.

Hope this helps to anyone who is like me who were googling for a proper solution for a while now and run out of any ideas so started to just google the service call's name

former_member613932
Discoverer

And after hours of "deploy, test if it worked, fail, change something, deploy again" cycle, you sir, are my savior!

ertugrul
Participant
0 Likes

Hi mihaly.ducz,

It helped me thank you so much.

vipul_soni89
Discoverer
0 Likes
Thank You it works in my application
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert

Hi Arunava, Your problem is not a SAPUI5 problem it is a SAP Cloud Platform Web IDE issue.

Given that you are using the sandpit, the Smart Variant still needs to be saved somewhere. So the sandpit is unlikely to permit you to do this as it is not connected to a particular Fiori frontend server.

You need to deploy your app to a SAPUI5 ABAP Repository or a SAP Cloud Platform Portal Service based on the Fiori Launchpad content type and then try from there.

Rgds

Jocelyn

Lee3
Active Participant
0 Likes

Hi Jocelyn,

I have the same problem when our application is deployed as HTML5 application on the cloud platform. Isn't it possible to run it as a HTML5 application on the cloud platform?

gr

Vo.

WRoeckelein
Active Participant

Hi jocelyn.dart ,

IMHO deploying to SAP Cloud Platform Portal Service does only help with the NEO variant of this service and not the CF variant, or has flexibility support also been introduced to the CF Cloud Platform Portal Service?

Thanks,

Wolfgang

Joseph_BERTHE1
Active Contributor
0 Likes

Helo,

Have you tried in SICF transaction to activate the service : /sap/bc/lrep

Regards,

Joseph

Former Member
0 Likes

/sap/bc/lrep/actions/getcsrftoken/ was giving 404 error in webide cloud and portal.

First check the gateway and go to /iwfnd/gw_client there check same request is success 204.

Now the problem is not with your code, the url /sap/bc/lrep/actions/getcsrftoken/ is blocked in cloud connector configuration. Contact cloud connector team and ask them to whitelist this node.

Former Member
0 Likes

Hello,

Have you got any solution to this? We are facing same issue from WebIDE.

Thanks in advance,

Arunava