cancel
Showing results for 
Search instead for 
Did you mean: 

BSP Application - Problem Passing value from "Event Handler" (ABAP) to "Layout" (HTML).

0 Kudos

I created a BSP that has HTML code that builds an HTML link and includes the users SAP global user Id as part of the link. I have done this by creating a "Page Attribute" with the following values:

Attribute USERNAME TYPE UNAME.

The "Event Handler" code is as follows:

USERNAME = SY-UNAME.

The Layout Code(HTML) is as follows:

_________________________________

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
var str1= "?name=" ;
var str3= "zzzz";
var str2 = "<%= username %>";
var url="http://google.com/";
var newurl=url+str1+str2+str3;
window.location.href(newurl);
</script>
</p> -->
</body>
</html>

________________________________________

The return value of str2 is not the value of the page attribute username. What is being returned is the literal "

"<%= username %>"

The full link being returned looks like this:

https://www.google.com/?name=%3C%=%20username%20%%3Ezzzz&gws_rd=ssl

I expect to see the literal user name which should be 'JSMITH', the SAP users name coming from the page attribute that is updated in the event handler.

Is the following syntax not correct????

var str2 = "<%= username %>";

Accepted Solutions (0)

Answers (0)