Skip to Content
avatar image
Former Member

Self-refreshing BSP ?

Hi,

I am trying to write a BSP to use in my SAP Basis administration work. The page should include graphs with CPU data, a list of SAP workprocesses, last 10 lines of syslog etc..

I want the page to automatically refresh itself every X seconds. ( X should be a variable which can be changed on the page itself ).

Everything works OK when using a button to simulate the periodic update, but I have not got a clue as how to periodically generate this event with a timer.

Does anybody know ( or can think of ) a way to do this ?

With regards,

Fred van de Langenberg

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Jun 18, 2004 at 06:45 AM

    I have done this in the past with the following block of code:

    <htmlb:documentHead>

    <%

    data: refresh1 type string.

    data: url1 type string.

    url1 = runtime->get_url( ).

    concatenate `<META HTTP-EQUIV=Refresh CONTENT="10; URL=`

    url1

    ` ">`

    into refresh1.

    %>

    <%= refresh1 %>

    </htmlb:documentHead>

    This example has a hardcoded refresh rate of 10 seconds. However you could just as easily built the refresh time in to the statement dynamically as well.

    Add comment
    10|10000 characters needed characters exceeded

    • The meta tag is first interesting technique to use. However, we have seen cases where it does not work perfectly. Especially if you press ESC in the browser.

      Better way is to use a timer. Here an example in 5 lines.

      <%@page language="abap"%>
      <html><body><%=sy-uzeit%></body></html>
      <script>
        window.setTimeout("document.location.href+='';", 1000);
      </script>
      

      Especially if you are using frames, consider to have one frame only with the timer. Then look at: window.setInterval (my favourite call:).

      ++bcm

  • avatar image
    Former Member
    Jun 20, 2004 at 08:11 PM

    Tomas & Brian,

    Thanks for both your answers.

    Both options work OK.

    I will definitely check out the 'window' calls.

    Regards,

    Fred van de Langenberg

    Add comment
    10|10000 characters needed characters exceeded