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
* URL: http://www.geocities.com/ojnc
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
Tuesday, April 22, 2008
Splash Screen in ABAP using OO ABAP Interview Questions
Posted by Anonymous at 1:47 AM
Labels: ABAP Interview Questions
Subscribe to:
Post Comments (Atom)
Content
-
►
2009
(2)
- ► 09/06 - 09/13 (1)
- ► 03/01 - 03/08 (1)
-
▼
2008
(207)
- ► 11/23 - 11/30 (1)
-
▼
04/20 - 04/27
(70)
- The Other 50 ABAP Interview Faq's ABAP Interview Q...
- ABAP Certification Sample Questions for Abapers AB...
- Important ABAP FAQ's ABAP Interview Questions
- SAP ABAP Interview Questions And Answers ABAP Inte...
- ABAP Frequently Asked Question ABAP Interview Ques...
- Answers to some ABAP Interview Questions ABAP Inte...
- General - Number Range Generation ABAP Interview Q...
- Extract the smtp email address ABAP Interview Ques...
- How to Get the Version Value When I Print the PO A...
- Attach T-Codes to Area Menu ABAP Interview Questions
- What is the use of Authorization Checks? ABAP Inte...
- Difference Between BADI and User Exits ABAP Interv...
- BAPI Conventions ABAP Interview Questions
- BDC ABAP Interview Questions
- SAP BDC Interview Questions And Answers ABAP Inter...
- BDC & LSMW ABAP Interview Questions
- ABAP Clipboard Utilities for Beautiful Commented C...
- Using Fonts command in ABAP ABAP Interview Questions
- Using Different Color in ABAP ABAP Interview Quest...
- ABAP Questions Commonly Asked 1 ABAP Interview Que...
- Create Push Buttons in Application Tool Bar ABAP I...
- A demo program to create subscreen in your ABAP Pr...
- Display Active Exits in a ABAP System ABAP Intervi...
- Displaying Graphics using an ABAP Program ABAP Int...
- Doubt in Unicode Enabling ABAP Interview Questions
- Example Code For Drill Down Report ABAP Interview ...
- SAP ABAP FAQ (Technical) ABAP Interview Questions
- Faq Miscellaneous ABAP Interview Questions
- Field exits (SMOD/CMOD) Questions and Answers ABAP...
- Inserting Website Links in ABAP ABAP Interview Que...
- Blocking Searchhelp and Create New Searchhelp ABAP...
- Attach a Search Help to the Screen Field ABAP Inte...
- Splash Screen in ABAP ABAP Interview Questions
- SY-UCOMM and OK_CODE in Dialog Program ABAP Interv...
- Change the Input Fields Dynamically in a Screen AB...
- A Sample Hide & Get Cursor in Interactive Programm...
- Scrolling in Table Control ABAP Interview Questions
- Common used of Dialog Screen for Display, Change, ...
- Internal Tables ABAP Interview Questions
- ABAP Interview Questions 1
- Interview Question on BAPI, RFC, ABAP Objects, Tab...
- Making a Java Editor in ABAP and compiling it ABAP...
- Will ABAP be Obsolete? Will JAVA Replace ABAP? ABA...
- Learning ABAP or SAP Application ABAP Interview Qu...
- List Box in ABAP Report ABAP Interview Questions
- List Of User Exit Related to VL01N ABAP Interview ...
- LOGICAL DATABASE ABAP Interview Questions
- Recursion with Loop Checking in SAP ABAP Interview...
- Maintaining Translations for Work item texts and A...
- MODULARIZATION Technique 2. ABAP Interview Questions
- Q. What is a function module? ABAP Interview Quest...
- What are ABAP Objects? ABAP Interview Questions
- Splash Screen in ABAP using OO ABAP Interview Ques...
- Passing data from one ABAP program to another ABAP...
- Performance tuning ABAP Interview Questions
- Performance Tuning ABAP Interview Questions
- Real Time questions ABAP Interview Questions
- How to find out Total No of Pages of a Report Outp...
- General - Reporting Tree in ABAP Interview Questions
- REPORTS ABAP Interview Questions
- Sample Test Questions on ABAP Programming
- ABAP Frequently Asked Question 45
- ABAP Frequently Asked Question locks
- ABAP Frequently Asked Question BDC
- ABAP Frequently Asked Question RFC
- SAP ABAP Interview Questions And Answers 1
- SAP ABAP Interview Questions And Answers free ABAP...
- Sap Scripts & Smart forms
- Different Types of Selection Screens
- SQL Tool for ABAP Yes4SQL -- Both Native & Open SQL
- ► 04/13 - 04/20 (51)
- ► 03/16 - 03/23 (44)
- ► 02/24 - 03/02 (9)
- ► 02/17 - 02/24 (32)
No comments:
Post a Comment