Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Add Picture to a Module pool screen

Former Member
0 Kudos

Any anyone know how to load a picture,im module pool

I have already uploaded a BMP file in se78.

After that do anyone know how to upload the picture

in the Module pool screen.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ganesan,

If it is Script,

call logo like below :

/: INCLUDE Z_YOUR_LOGO OBJECT TEXT ID ST LANGUAGE E

or if it is ALV report :

REPORT Z_ALV .

TABLES: KNA1,VBAK.

DATA: ITAB TYPE TABLE OF VBAK,

CONTAINER TYPE SCRFNAME VALUE 'ALVCONTROL',

CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

GRID TYPE REF TO CL_GUI_ALV_GRID,

L_CONTAINER TYPE SCRFNAME VALUE 'LOGO',

I_PARENT TYPE REF TO CL_GUI_CONTAINER,

L_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE,

LT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER,

L_LOGO TYPE SDYDO_VALUE.

DATA: OK_CODE(4).

CALL SCREEN 1100.

&----


*& Module STATUS_1100 OUTPUT

&----


  • text

----


MODULE STATUS_1100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

CASE OK_CODE.

WHEN 'DISP'.

SELECT * FROM VBAK INTO TABLE ITAB WHERE KUNNR = KNA1-KUNNR.

IF CUST IS INITIAL.

CREATE OBJECT CUST EXPORTING CONTAINER_NAME = CONTAINER.

CREATE OBJECT GRID EXPORTING I_PARENT = CUST.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME

= 'VBAK' CHANGING IT_OUTTAB = ITAB.

ENDIF.

IF L_CUST IS INITIAL.

CREATE OBJECT L_CUST EXPORTING CONTAINER_NAME = L_CONTAINER.

CREATE OBJECT TREE EXPORTING I_PARENT = L_CUST.

PERFORM BUILD_COMMENT USING LT_LIST_COMMENTARY.

CALL METHOD TREE->CREATE_REPORT_HEADER EXPORTING IT_LIST_COMMENTARY =

LT_LIST_COMMENTARY I_LOGO = L_LOGO.

ENDIF.

ENDMODULE. " STATUS_1100 OUTPUT

FORM BUILD_COMMENT USING LT_LIST_COMMENTARY.

L_LOGO = 'ENJOYSAP_LOGO'.

ENDFORM.

6 REPLIES 6

Former Member
0 Kudos

Hi Ganesan,

If it is Script,

call logo like below :

/: INCLUDE Z_YOUR_LOGO OBJECT TEXT ID ST LANGUAGE E

or if it is ALV report :

REPORT Z_ALV .

TABLES: KNA1,VBAK.

DATA: ITAB TYPE TABLE OF VBAK,

CONTAINER TYPE SCRFNAME VALUE 'ALVCONTROL',

CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

GRID TYPE REF TO CL_GUI_ALV_GRID,

L_CONTAINER TYPE SCRFNAME VALUE 'LOGO',

I_PARENT TYPE REF TO CL_GUI_CONTAINER,

L_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

TREE TYPE REF TO CL_GUI_ALV_TREE_SIMPLE,

LT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER,

L_LOGO TYPE SDYDO_VALUE.

DATA: OK_CODE(4).

CALL SCREEN 1100.

&----


*& Module STATUS_1100 OUTPUT

&----


  • text

----


MODULE STATUS_1100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

CASE OK_CODE.

WHEN 'DISP'.

SELECT * FROM VBAK INTO TABLE ITAB WHERE KUNNR = KNA1-KUNNR.

IF CUST IS INITIAL.

CREATE OBJECT CUST EXPORTING CONTAINER_NAME = CONTAINER.

CREATE OBJECT GRID EXPORTING I_PARENT = CUST.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME

= 'VBAK' CHANGING IT_OUTTAB = ITAB.

ENDIF.

IF L_CUST IS INITIAL.

CREATE OBJECT L_CUST EXPORTING CONTAINER_NAME = L_CONTAINER.

CREATE OBJECT TREE EXPORTING I_PARENT = L_CUST.

PERFORM BUILD_COMMENT USING LT_LIST_COMMENTARY.

CALL METHOD TREE->CREATE_REPORT_HEADER EXPORTING IT_LIST_COMMENTARY =

LT_LIST_COMMENTARY I_LOGO = L_LOGO.

ENDIF.

ENDMODULE. " STATUS_1100 OUTPUT

FORM BUILD_COMMENT USING LT_LIST_COMMENTARY.

L_LOGO = 'ENJOYSAP_LOGO'.

ENDFORM.

0 Kudos

hi kannaiah

I am working on abap hr, I have uploaded employee photos so that the photo appears on the tcode pa30's screen when the employee no is entered. Now i need to display the same photo on a module pool screen. I know how to display any image on a module pool screen but my need is to display the photo according to the employee only and i wont be giving the hard coded name for the image as that would vary with the employee and these photos are already stored in the r/3 database.

Any idea.

thanks in advance

andreas_mann3
Active Contributor
0 Kudos

hi,

use picture control (see sample in se38 - reuse library

Message was edited by: Andreas Mann

Former Member
0 Kudos

ok. first create a container then place this picture in ur container.

For detail.

go through this program......

create object cust_container

exporting

container_name = 'MYCONTAINER1'

.

create object picture

exporting

parent = cust_container

.

clear url.

path = 'Zex'.

perform get_url using path.

CALL METHOD picture->set_display_mode

EXPORTING

display_mode = cl_gui_picture=>display_mode_fit

  • EXCEPTIONS

  • ERROR = 1

  • others = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD picture->load_picture_from_url

EXPORTING

url = url

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

form get_url using p_path.

DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.

DATA html_table LIKE w3html OCCURS 1.

DATA return_code LIKE w3param-ret_code.

DATA content_type LIKE w3param-cont_type.

DATA content_length LIKE w3param-cont_len.

DATA pic_data LIKE w3mime OCCURS 0.

DATA pic_size TYPE i.

REFRESH query_table.

query_table-name = '_OBJECT_ID'.

query_table-value = p_path.

APPEND query_table.

CALL FUNCTION 'WWW_GET_MIME_OBJECT'

TABLES

query_string = query_table

html = html_table

mime = pic_data

CHANGING

return_code = return_code

content_type = content_type

content_length = content_length

EXCEPTIONS

object_not_found = 1

parameter_not_found = 2

OTHERS = 3.

IF sy-subrc = 0.

pic_size = content_length.

ENDIF.

CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

type = 'image'

subtype = cndp_sap_tab_unknown

size = pic_size

lifetime = cndp_lifetime_transaction

TABLES

data = pic_data

CHANGING

url = url

EXCEPTIONS

OTHERS = 1.

endform. " get_url

Regards

Abhishek

0 Kudos

Hi Abhishek,

Can please send the declaration part of your program?

...Naddy

Former Member
0 Kudos

Hi,

se51->field attributes->icon name(select from list)

Regards

Amole