Skip to Content
avatar image
Former Member

Module pool

Hi,

In dialog pool programming how to get jpeg image and display it..If any Function module what used for it????

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 21, 2007 at 06:10 AM

    Check the program in SE38 : demo_abap_objects_controls

    Regards

    Gopi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 21, 2007 at 06:56 AM

    Hi Jeya,

    You can use the below given code however before that create a custom control in your screen and name it CUSTOM_1.

    <b>In top include of the module pool program provide the classes definition.</b>

    • Classes *****************************************************

    class SCREEN_INIT definition create private.

    public section.

    class-methods INIT_SCREEN.

    methods CONSTRUCTOR.

    private section.

    data: CONTAINER1 type ref to CL_GUI_CUSTOM_CONTAINER,

    PICTURE type ref to CL_GUI_PICTURE.

    methods: FILL_PICTURE.

    endclass.

    class SCREEN_HANDLER definition.

    public section.

    methods: CONSTRUCTOR importing CONTAINER

    type ref to CL_GUI_CUSTOM_CONTAINER.

    private section.

    data: HTML_VIEWER type ref to CL_GUI_HTML_VIEWER,

    LIST_VIEWER type ref to CL_GUI_ALV_GRID.

    endclass.

    <b>Then in the main program below the TOP include give implementation of these classes ofcourse before the PBO include which is.</b>

    *Class implementations

    class SCREEN_INIT implementation.

    method INIT_SCREEN.

    data SCREEN type ref to SCREEN_INIT.

    create object SCREEN.

    endmethod.

    method CONSTRUCTOR.

    data: EVENTS type CNTL_SIMPLE_EVENTS,

    EVENT like line of EVENTS,

    EVENT_HANDLER type ref to SCREEN_HANDLER.

    create object: CONTAINER1 exporting CONTAINER_NAME = 'CUSTOM_1',

    PICTURE exporting PARENT = CONTAINER1.

    call method: ME->FILL_PICTURE.

    endmethod.

    method FILL_PICTURE.

    types PICT_LINE(256) type X.

    data PICT_TAB type table of PICT_LINE.

    data URL(255) type C.

    import PICT_TAB = PICT_TAB from database ABTREE(PI) id 'FLIGHTS'.

    call function 'DP_CREATE_URL'

    exporting

    TYPE = 'IMAGE'

    SUBTYPE = 'GIF'

    tables

    DATA = PICT_TAB

    changing

    URL = URL.

    call method PICTURE->LOAD_PICTURE_FROM_URL exporting URL = URL.

    call method PICTURE->SET_DISPLAY_MODE

    exporting DISPLAY_MODE = PICTURE->DISPLAY_MODE_FIT_CENTER.

    endmethod.

    endclass.

    class SCREEN_HANDLER implementation.

    method CONSTRUCTOR.

    create object: HTML_VIEWER exporting PARENT = CONTAINER,

    LIST_VIEWER exporting I_PARENT = CONTAINER.

    <b>and then make a call in your PBO module to the class method to show the logo on the screen.</b>

    module STATUS_0101 output.

    SET PF-STATUS 'LISTE'.

    • SET TITLEBAR 'xxx'.

    call method SCREEN_INIT=>INIT_SCREEN.

    endmodule. " STATUS_0101 OUTPUT

    Hope this helps. Revert for further clarifications if any.

    regards,

    Vikas

    <b>Always reward points to useful suggestions.</b>

    Message was edited by:

    Vikas Taneja

    Add comment
    10|10000 characters needed characters exceeded