on 09-13-2005 9:36 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was looking for a GUI standard ActiveX solution.
In a large SAP deployment using firewalls & VPN
calling a browser is not a feasible solution.
The effect I wish for is the type of Splash screen in Microsoft Office products & Java IDES like Eclipse, NetBeans etc. That is splash screen that is feasible using standard components with having to add 3rd party products or opening HTML browsers.
Regards
-jnc
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it working
2 JPG picture files with even some Bengali Fonts!
Thanks mainly to Thomas.
Create 2 MODAL screens 0806 and 2009
1 CUSTOM_1 shaped to hold JPG
and 1 CUSTOM_2 to hold TIMER
NO PAI only PBO
REPORT zpp_r012 LINE-SIZE 160
LINE-COUNT 72
MESSAGE-ID zpp01.
DATA: container1 TYPE REF TO cl_gui_custom_container,
container2 TYPE REF TO cl_gui_custom_container,
picture TYPE REF TO cl_gui_picture.
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.
----
CLASS lcl_event_handler DEFINITION
----
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION
----
CLASS lcl_event_handler IMPLEMENTATION
----
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_finished.
IF sy-dynnr = 2009.
LEAVE PROGRAM.
ELSE.
PERFORM f_excel_job.
ENDIF.
ENDMETHOD. "on_finished
ENDCLASS. "lcl_event_handler IMPLEMENTATION
DATA timer TYPE REF TO cl_gui_timer.
DATA event_handler TYPE REF TO lcl_event_handler.
DATA timeout TYPE i VALUE '3'.
&----
SELECTION-SCREEN DESIGN *
&----
SELECTION-SCREEN: BEGIN OF BLOCK b2sels WITH FRAME TITLE text-002.
PARAMETERS: pwerks LIKE mseg-werks OBLIGATORY, "THIS Plant
pbudat LIKE mkpf-budat OBLIGATORY. "THIS Date
SELECTION-SCREEN: END OF BLOCK b2sels.
&----
INITIALIZATION EVENT *
&----
INITIALIZATION.
&----
AT SELECTION-SCREEN EVENT *
&----
**Use this EVENT to validate SELECTION-SCREEN
AT SELECTION-SCREEN.
&----
START-OF-SELECTION EVENT *
&----
START-OF-SELECTION.
CALL SCREEN 0806 STARTING AT 30 4.
&----
*& Form f_excel_job
&----
FORM f_excel_job.
LOTS of Code
CALL SCREEN 2009 STARTING AT 30 4.
ENDFORM. "f_excel_job
&----
*& 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.
IF graphic_url IS NOT INITIAL.
CALL METHOD picture->clear_picture
EXCEPTIONS
error = 1.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = graphic_url
IMPORTING
RESULT = g_result.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = picture->display_mode_normal_center
EXCEPTIONS
error = 1.
CALL METHOD cl_gui_cfw=>update_view.
ENDIF.
ENDFORM. "getpicurl
----
MODULE zjncpbo OUTPUT screen 0806
----
MODULE zjncpbo OUTPUT.
MOVE 'NAMASTE.JPG' TO g_name.
CREATE OBJECT: container1 EXPORTING container_name = 'CUSTOM_1',
container2 EXPORTING container_name = 'CUSTOM_2',
picture EXPORTING parent = container1,
timer EXPORTING parent = container2.
SET HANDLER lcl_event_handler=>on_finished FOR timer.
Start Timer
timer->interval = timeout.
CALL METHOD timer->run.
PERFORM getpicurl.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PBO
----
MODULE zjncpbo2 OUTPUT screen 2009
----
MODULE zjncpbo2 OUTPUT.
MOVE 'THANKS.JPG' TO g_name.
CREATE OBJECT: container1 EXPORTING container_name = 'CUSTOM_1',
container2 EXPORTING container_name = 'CUSTOM_2',
picture EXPORTING parent = container1,
timer EXPORTING parent = container2.
SET HANDLER lcl_event_handler=>on_finished FOR timer.
Start Timer
timer->interval = timeout.
CALL METHOD timer->run.
PERFORM getpicurl.
CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PBO
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
Author Jayanta Narayan Choudhuri
Flat 302
395 Jodhpur Park
Kolkata 700 068
Email sss@cal.vsnl.net.in
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.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.