Skip to Content
author's profile photo Former Member
Former Member

Splash screen ABAP (Was 6.20) SAPGui 6.20

I love splash screens. A small pop-up window with a picture should come for say 5 to 10 seconds and disappear by a timer task.

Giving such timer splash screens at START or END makes the application attractive. I do it in VB PB & Java.

How to do Slash screen in ABAP SAP GUI 6.20 WAS 6.20?

Should be thrown up as a "floating" popup.

Regards & Hopeful

-jnc

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Sep 13, 2005 at 09:16 AM

    just store a html page (it can be a BSP application also) which will have the splash and also the javascript timer to close it after sometime.

    during START and END call this url using FM call_browser.

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2005 at 07:32 PM

    Thanks Thomas. This will give almost the effect I seek.

    It will not match the MS Office splash screens in effect,

    floating, centred in the monitor, without titlebar & control menu.

    Possibly we can't get a perfect popup splash screen

    in SAP GUI. As the screen will be in the SAPGUI container.

    But at least I can have a picture come in for 5 seconds & disppear!

    Regards & Thanks

    -jnc

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      With good tips from Thomas Jung

      I made 2 function modules to suit my whims.

      SAP being a serious Businesss Software you cannot have too many JPGs floating around! One or two is fun.

      In Function group uou need two screens 0806 & 2009 which are essentially blank.

      I put 2 title Bars - 0806 "SAP - JOB in Progress"; 2009 - "SAP - JOB OVER!!"

      Code listing for function: ZJNC_START_SPLASH

      Description: Show Splash at Start

      -


      FUNCTION zjnc_start_splash.

      *"----


      ""Local interface:

      *" IMPORTING

      *" REFERENCE(IMAGEFILE) TYPE C DEFAULT 'THANKS.JPG'

      *" REFERENCE(WIDTH) TYPE I DEFAULT 415

      *" REFERENCE(HEIGHT) TYPE I DEFAULT 274

      *" REFERENCE(TIMEOUT) TYPE I DEFAULT 3

      *" REFERENCE(CALLBACK) TYPE C

      *"----


      • Global data declarations

      MOVE imagefile TO g_name.

      MOVE width TO picwidth.

      MOVE height TO picheight.

      MOVE timeout TO pictimeout.

      MOVE callback TO piccallback.

      TRANSLATE piccallback TO UPPER CASE.

      PERFORM getpicurl.

      CALL SCREEN 0806.

      ENDFUNCTION.

      Code listing for function: ZJNC_END_SPLASH

      Description: Show Splash at End

      -


      FUNCTION ZJNC_END_SPLASH.

      *"----


      ""Local interface:

      *" IMPORTING

      *" REFERENCE(IMAGEFILE) TYPE C DEFAULT 'THANKS.JPG'

      *" REFERENCE(WIDTH) TYPE I DEFAULT 415

      *" REFERENCE(HEIGHT) TYPE I DEFAULT 274

      *" REFERENCE(TIMEOUT) TYPE I DEFAULT 3

      *"----


      • Global data declarations

      MOVE imagefile TO g_name.

      MOVE width TO picwidth.

      MOVE height TO picheight.

      MOVE timeout TO pictimeout.

      PERFORM getpicurl.

      CALL SCREEN 2009.

      ENDFUNCTION.

      Code listing for: LZUTILTOP

      • TOP level Include of Function Group ZUTIL

      FUNCTION-POOL zutil. "MESSAGE-ID ..

      TYPE-POOLS: abap.

      DATA: graphic_url(255),

      g_result TYPE i,

      g_linesz TYPE i,

      g_filesz TYPE i,

      g_name(100).

      TYPES: t_graphic_line(256) TYPE x.

      DATA: graphic_line TYPE t_graphic_line,

      graphic_table TYPE TABLE OF t_graphic_line.

      DATA: picwidth TYPE i,

      picheight TYPE i,

      pictimeout TYPE i,

      piccallback(60) TYPE c,

      first TYPE boolean.

      ----


      • CLASS ZCL_ES_SPLASH_SCREEN DEFINITION

      ----


      CLASS zcl_es_splash_screen DEFINITION.

      PUBLIC SECTION.

      EVENTS on_close.

      METHODS constructor

      IMPORTING

      !i_num_secs TYPE i DEFAULT 5

      !i_url TYPE c

      !i_width TYPE i

      !i_height TYPE i.

      PROTECTED SECTION.

      METHODS handle_end_of_timer

      FOR EVENT finished OF cl_gui_timer.

      PRIVATE SECTION.

      DATA container TYPE REF TO cl_gui_dialogbox_container.

      DATA image TYPE REF TO cl_gui_picture.

      DATA timer TYPE REF TO cl_gui_timer.

      ENDCLASS. "ZCL_ES_SPLASH_SCREEN DEFINITION

      ----


      • CLASS ZCL_ES_SPLASH_SCREEN IMPLEMENTATION

      ----


      CLASS zcl_es_splash_screen IMPLEMENTATION.

      METHOD constructor.

      DATA: image_width TYPE i,

      image_height TYPE i.

      COMPUTE image_width = i_width + 30.

      COMPUTE image_height = i_height + 50.

      CREATE OBJECT container

      EXPORTING

      width = 10

      height = 10

      top = 10

      left = 10

      name = 'DialogSplash'.

      CALL METHOD container->set_caption

      EXPORTING

      caption = g_name.

      CREATE OBJECT image

      EXPORTING

      parent = container.

      CALL METHOD image->load_picture_from_url

      EXPORTING

      url = i_url.

      image->set_display_mode( image->display_mode_normal_center ).

      cl_gui_cfw=>flush( ).

      container->set_metric( EXPORTING metric = image->metric_pixel ).

      DATA: myleft TYPE i,

      mytop TYPE i.

      COMPUTE myleft = ( 800 - image_width ) / 2.

      COMPUTE mytop = ( 600 - image_height ) / 2.

      IF myleft < 0.

      MOVE 0 TO myleft.

      ENDIF.

      IF mytop < 0.

      MOVE 0 TO mytop.

      ENDIF.

      container->set_position(

      EXPORTING

      height = image_height

      left = myleft

      top = mytop

      width = image_width ).

      cl_gui_cfw=>update_view( ).

      CREATE OBJECT timer.

      timer->interval = i_num_secs.

      SET HANDLER me->handle_end_of_timer FOR timer.

      timer->run( ).

      cl_gui_cfw=>flush( ).

      ENDMETHOD. "constructor

      METHOD handle_end_of_timer.

      • I wanted NAMASTE to remain until JOB was complete.

      • IF container IS NOT INITIAL.

      • container->free( ).

      • CLEAR container.

      • FREE container.

      • ENDIF.

      *

      • IF timer IS NOT INITIAL.

      • timer->free( ).

      • CLEAR timer.

      • FREE timer.

      • ENDIF.

      *

      • cl_gui_cfw=>flush( ).

      RAISE EVENT on_close.

      ENDMETHOD. "handle_end_of_timer

      ENDCLASS. "ZCL_ES_SPLASH_SCREEN IMPLEMENTATION

      ----


      • CLASS lcl_event_handler DEFINITION

      ----


      CLASS lcl_event_handler DEFINITION.

      PUBLIC SECTION.

      CLASS-METHODS: on_close FOR EVENT on_close OF zcl_es_splash_screen.

      ENDCLASS. "lcl_event_handler DEFINITION

      ----


      • CLASS lcl_event_handler IMPLEMENTATION

      ----


      CLASS lcl_event_handler IMPLEMENTATION.

      METHOD on_close.

      IF sy-dynnr = 2009.

      LEAVE PROGRAM.

      ELSE.

      MOVE abap_false TO first.

      PERFORM (piccallback) IN PROGRAM (sy-cprog).

      ENDIF.

      ENDMETHOD. "on_close

      ENDCLASS. "lcl_event_handler IMPLEMENTATION

      DATA: splash TYPE REF TO zcl_es_splash_screen.

      &----


      *& Module STATUS_0806 OUTPUT

      &----


      MODULE status_0806 OUTPUT.

      IF first IS INITIAL.

      first = abap_true.

      SET TITLEBAR 'TITLE0806'.

      CREATE OBJECT splash

      EXPORTING

      i_num_secs = pictimeout

      i_url = graphic_url

      i_width = picwidth

      i_height = picheight.

      SET HANDLER lcl_event_handler=>on_close FOR splash.

      ENDIF.

      ENDMODULE. " STATUS_0806 OUTPUT

      &----


      *& Module STATUS_2009 OUTPUT

      &----


      MODULE status_2009 OUTPUT.

      IF first IS INITIAL.

      first = abap_true.

      SET TITLEBAR 'TITLE2009'.

      CREATE OBJECT splash

      EXPORTING

      i_num_secs = pictimeout

      i_url = graphic_url

      i_width = picwidth

      i_height = picheight.

      SET HANDLER lcl_event_handler=>on_close FOR splash.

      ENDIF.

      ENDMODULE. " STATUS_2009 OUTPUT

      &----


      *& Form getpicurl

      &----


      FORM getpicurl.

      OPEN DATASET g_name FOR INPUT IN BINARY MODE.

      REFRESH graphic_table.

      CLEAR g_filesz.

      DO.

      CLEAR graphic_line.

      READ DATASET g_name INTO graphic_line ACTUAL LENGTH g_linesz.

      ADD g_linesz TO g_filesz.

      APPEND graphic_line TO graphic_table.

      IF sy-subrc <> 0.

      EXIT.

      ENDIF.

      ENDDO.

      CLOSE DATASET g_name.

      CLEAR graphic_url.

      CALL FUNCTION 'DP_CREATE_URL'

      EXPORTING

      type = 'IMAGE'

      subtype = 'GIF'

      TABLES

      data = graphic_table

      CHANGING

      url = graphic_url

      EXCEPTIONS

      dp_invalid_parameter = 1

      dp_error_put_table = 2

      dp_error_general = 3

      OTHERS = 4.

      IF sy-subrc <> 0.

      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

      EXIT.

      ENDIF.

      ENDFORM. "getpicurl

      -


      Extracted by Direct Download Enterprise version 1.2 - E.G.Mellodew. 1998-2004 UK.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.