<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Javascript function expressions support in BSP in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551299#M117663</link>
    <description>&lt;P&gt;Bump! &lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 11:26:12 GMT</pubDate>
    <dc:creator>Astashonok</dc:creator>
    <dc:date>2018-01-10T11:26:12Z</dc:date>
    <item>
      <title>Javascript function expressions support in BSP</title>
      <link>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaq-p/551296</link>
      <description>&lt;P&gt;Does BSP engine support &lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function"&gt;Javascript expressions&lt;/A&gt;? Smth like this&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;var x = function x(){/*Scope code here*/}()&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I see that it doesn't rendered properly on my CRM 7.02 system. They are simply not supported or I write them wrong?&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;For example, I add them like this to the head tag:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;%@page language="abap"%&amp;gt;
&amp;lt;%@extension name="htmlb" prefix="htmlb"%&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;script language="Javascript"&amp;gt;
var tableToExcel = (function() {
  var uri = 'data:application/vnd.ms-excel;base64,'
    , template = '&amp;lt;html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;&amp;lt;x:ExcelWorkbook&amp;gt;&amp;lt;x:ExcelWorksheets&amp;gt;&amp;lt;x:ExcelWorksheet&amp;gt;&amp;lt;x:Name&amp;gt;{worksheet}&amp;lt;/x:Name&amp;gt;&amp;lt;x:WorksheetOptions&amp;gt;&amp;lt;x:DisplayGridlines/&amp;gt;&amp;lt;/x:WorksheetOptions&amp;gt;&amp;lt;/x:ExcelWorksheet&amp;gt;&amp;lt;/x:ExcelWorksheets&amp;gt;&amp;lt;/x:ExcelWorkbook&amp;gt;&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;table&amp;gt;{table}&amp;lt;/table&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;'
    , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
    , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
  return function(table, name) {
    if (!table.nodeType) table = document.getElementById(table)
    var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
    window.location.href = uri + base64(format(template, ctx))
  }
})()
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&amp;lt;xhtmlb:toolbarItem placement="RIGHT" &amp;gt;
       &amp;lt;xhtmlb:pager id     = "pager"
      &amp;lt;/xhtmlb:toolbarItem&amp;gt;
     &amp;lt;/xhtmlb:toolbar&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Nov 2017 07:24:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaq-p/551296</guid>
      <dc:creator>Astashonok</dc:creator>
      <dc:date>2017-11-03T07:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function expressions support in BSP</title>
      <link>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551297#M117661</link>
      <description>&lt;P&gt;Hi Pavel,&lt;/P&gt;
  &lt;P&gt;Where did you add above code, and what kind of error did you get? How does it not rendered properly.&lt;BR /&gt;Can you please upload a screenshot or give more detail.&lt;/P&gt;
  &lt;P&gt;Best Regards,&lt;/P&gt;
  &lt;P&gt;Bruce&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 08:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551297#M117661</guid>
      <dc:creator>bruce_li</dc:creator>
      <dc:date>2017-11-03T08:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function expressions support in BSP</title>
      <link>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551298#M117662</link>
      <description>&lt;P&gt;Added the code snippet. I don't receive any explicit error, the function just don't work. If I bind them to onclick event, nothing is happened. After I rebind classic JS functions, all starts to work.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 15:07:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551298#M117662</guid>
      <dc:creator>Astashonok</dc:creator>
      <dc:date>2017-11-09T15:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript function expressions support in BSP</title>
      <link>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551299#M117663</link>
      <description>&lt;P&gt;Bump! &lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 11:26:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/javascript-function-expressions-support-in-bsp/qaa-p/551299#M117663</guid>
      <dc:creator>Astashonok</dc:creator>
      <dc:date>2018-01-10T11:26:12Z</dc:date>
    </item>
  </channel>
</rss>

