04-07-2006 10:14 AM
Loaded a pictur onto the server using SE78. Now, how do I bring that picture onto a container. Used picture control and the method load from url. What should be the path?
04-07-2006 10:18 AM
Hi Anie,
Is it mandatory that you should load a picture onto the server using SE78?Or you just uploaded the picture?
If uploading of the picture is not mandatory and if you want to load a picture from your system itself,
then the method is like this.
Call the method LOAD_FROM_URL of class CL_GUI_PICTURE
where the path is 'file://your path'.
For eg: path = 'file://C:\SP\pic.jpg'.
This will work.
Regards,
SP.
04-07-2006 10:32 AM
Hello,
Have a look at the program <b>sap_picture_demo.</b>
Regards,
Naimesh.
Reward points, if it is useful..!
04-07-2006 10:33 AM
Hi Anie,
To place the pic on container, you need to upload
the pic to web repository , to do that go to
<b>SMW0</b> and store it in a Binary data for WEb rfc
applications radio button.
Then do the below :
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.
* create the custom container
CREATE OBJECT CONTAINER
EXPORTING CONTAINER_NAME = 'INTELLI'.
* create the picture control
CREATE OBJECT PICTURE
EXPORTING PARENT = CONTAINER.
REFRESH QUERY_TABLE.
QUERY_TABLE-NAME = '_OBJECT_ID'.
QUERY_TABLE-VALUE = 'LOGO'.
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.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
* load picture
CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL
EXPORTING URL = URL.
INIT = 'X'.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
Hope this will help you.
Thanks&Regards,
Srilatha.
Please reward points if it is helpful.
Message was edited by: Srilatha T
04-07-2006 10:37 AM
Hi,
check these examples..
<b>sap_picture_demo
sap_picture_demo_icon
RSDEMO_PICTURE_CONTROL</b>
Regards
vijay
04-07-2006 10:51 AM
Go to transaction SE78.
Follow the path given below (on the left windows box) :-
SAPSCRIPT GRAPHICS --> STORED ON DOCUMENT SERVER --> GRAPHICS --> BMAP
Enter the name of the graphics file on the right side and Go to the menu GRAPHIC --> IMPORT
The program is RSTXLDMC, the logo needs to be save in .TIF format.
Use transaction SE78 to inmport graphics to SAP.
In the form painter, you can either include directly to the form using menu Edit->Graphic->Create or using the INCLUDE statement in a window.
To use an INCLUDE stanment, goto into the woindow script editor and use menu Include->Graphic. The include can look like this for a bitmap:
/: BITMAP MYLOGO OBJECT GRAPHICS ID BMAP TYPE BMON
regards
vinod