2009 Feb 25 1:33 PM
Hi,
Please give me a solution for how to insert employee photo like jpeg in screen painter or tab strip control
thanks,
suresh
2009 Feb 25 1:43 PM
2009 Feb 25 1:51 PM
2009 Feb 25 1:51 PM
Hi,
Follow these step.
1. save that photo into bmp or tiff format.
2. Upload it into se78.
3. create a custome container with name 'PICTURE_CONTAINER'
&----
*& Report ZRU_DISPLAY
*&
&----
*&
*&
&----
REPORT ZRU_DISPLAY.
call screen 700.
&----
*& Module STATUS_0700 OUTPUT
&----
text
----
MODULE STATUS_0700 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
DATA: W_LINES TYPE I.
TYPES PICT_LINE(256) TYPE C.
DATA :
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.
DATA: GRAPHIC_URL(255). DATA: BEGIN OF GRAPHIC_TABLE OCCURS 0,
LINE(255) TYPE X,
END OF GRAPHIC_TABLE.
DATA: L_GRAPHIC_CONV TYPE I.
DATA: L_GRAPHIC_OFFS TYPE I.
DATA: GRAPHIC_SIZE TYPE I.
DATA: L_GRAPHIC_XSTR TYPE XSTRING.
. CALL METHOD CL_GUI_CFW=>FLUSH. CREATE OBJECT:
CONTAINER EXPORTING CONTAINER_NAME = 'PICTURE_CONTAINER',
PICTURE EXPORTING PARENT = CONTAINER. CALL METHOD CL_SSF_XSF_UTILITIES=>GET_BDS_GRAPHIC_AS_BMP
EXPORTING
P_OBJECT = 'GRAPHICS'
P_NAME = 'ABHITECH'
P_ID = 'BMAP'
P_BTYPE = 'BCOL'
RECEIVING
P_BMP = L_GRAPHIC_XSTR
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 2
others = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. GRAPHIC_SIZE = XSTRLEN( L_GRAPHIC_XSTR ).
L_GRAPHIC_CONV = GRAPHIC_SIZE.
L_GRAPHIC_OFFS = 0. WHILE L_GRAPHIC_CONV > 255.
GRAPHIC_TABLE-LINE = L_GRAPHIC_XSTR+L_GRAPHIC_OFFS(255).
APPEND GRAPHIC_TABLE.
L_GRAPHIC_OFFS = L_GRAPHIC_OFFS + 255.
L_GRAPHIC_CONV = L_GRAPHIC_CONV - 255.
ENDWHILE.
GRAPHIC_TABLE-LINE = L_GRAPHIC_XSTR+L_GRAPHIC_OFFS(L_GRAPHIC_CONV). APPEND GRAPHIC_TABLE. CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
TYPE = 'IMAGE'
SUBTYPE = 'X-UNKNOWN'
SIZE = GRAPHIC_SIZE
LIFETIME = 'T'
TABLES
DATA = GRAPHIC_TABLE
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.
ENDMODULE. " STATUS_0700 OUTPUT
This will solve ur requirement.