Tip

Displaying logos on screen

You can display logo(s) on your screen using the custom control function. A custom control is an area on the screen, created using the screen painter. Custom controls are used to embed controls. Container controls are instances of special global classes from the SAP Control Framework. The global class for custom controls is called CL_GUI_CUSTOM_CONTAINER. To link a custom control to a container control, pass the custom control name to the CONTAINER_NAME parameter of the container control constructor when you instantiate it. The following is a sample program to demonstrate the logo display using the custom control. This program was written in SAP4.6C. Design a screen with the custom control, by name PICTURE_CONTAINER. It has the following flow logic:

PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.

The GUI status SCREEN100 has the functions BACK, EXIT, and CANCEL (all with type E).


REPORT ZKAVITHA_TEST .

**********************************************************
* Author  : Kavitha Koleti                               *
* Date    : 27-Oct-2002                                  *
* Purpose : This program displays the logo on the screen *
**********************************************************

* Type declarations.....................
TYPES pict_line(256) TYPE c.

* data declarations......................
DATA :init,
      container TYPE REF TO cl_gui_custom_container,
      editor    TYPE REF TO cl_gui_textedit,
      picture   TYPE REF TO cl_gui_picture,
      pict_tab TYPE TABLE OF pict_line,
      url(255) TYPE c.

CALL SCREEN 100.

* Dialog modules......................................
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SCREEN100'.
  IF init is initial.
    init = 'X'.

    CREATE OBJECT:
           container  EXPORTING container_name = 'PICTURE_CONTAINER',
           picture    EXPORTING parent = container.
  ENDIF.

  IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'ENJOY'.
  CALL FUNCTION 'DP_CREATE_URL'
       EXPORTING
            type    = 'IMAGE'
            subtype = 'GIF'
       TABLES
            data    = pict_tab
       CHANGING
            url     = url.

  CALL METHOD picture->load_picture_from_url

    Requires Free Membership to View

EXPORTING url = url. CALL METHOD picture->set_display_mode EXPORTING display_mode = picture->display_mode_fit_center. ENDMODULE. MODULE cancel INPUT. LEAVE TO SCREEN 0. ENDMODULE.

This was first published in November 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.