04-12-2007 4:50 AM
Hi everyone,
I want to display picture in program. Based on demo program SAP_PICTURE_DEMO , i know that we can use function 'WWW_GET_MIME_OBJECT' and function 'DP_CREATE_URL' to achieve the picture displaying in program.
However, the picture got from function 'WWW_GET_MIME_OBJECT' stored in Web Repository. it is not linked with the picture stored in SE78.
How could I use the picture stored in SE78 for picture displaying in report?
Thanks in advance~
04-12-2007 4:54 AM
hi boris
You can do file operations with the presentation layer using function modules "GUI_DOWNLOAD" and "GUI_UPLOAD" or instantiating "CL_GUI_FRONTEND_SERVICES" to utilize relevant methods.
You can store your pictures in the web repository (transaction code SMW0) and for reaching them during the program execution, you need a link to be generated by use of 'WWW_GET_MIME_OBJECT' and 'DP_CREATE_URL'.
To store your files at the application layer, you can inspect the statements "OPEN DATASET", "CLOSE DATASET".
<u><i><b>
entite procedure</b></i></u>
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
navjot
reward if helpfull
Message was edited by:
navjot sharma
04-12-2007 4:54 AM
hi boris
You can do file operations with the presentation layer using function modules "GUI_DOWNLOAD" and "GUI_UPLOAD" or instantiating "CL_GUI_FRONTEND_SERVICES" to utilize relevant methods.
You can store your pictures in the web repository (transaction code SMW0) and for reaching them during the program execution, you need a link to be generated by use of 'WWW_GET_MIME_OBJECT' and 'DP_CREATE_URL'.
To store your files at the application layer, you can inspect the statements "OPEN DATASET", "CLOSE DATASET".
<u><i><b>
entite procedure</b></i></u>
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
navjot
reward if helpfull
Message was edited by:
navjot sharma
04-12-2007 5:00 AM
Hi Navjot,
Besides using GUI_DOWNLOAD,GUI_UPLOAD or pictures stored in web repository, can we use the picture in se78?
Since I have uploaded thousands of pictures via se78, I wanna know how to use pictures in se78 to generate a URL link by DP_CREATE_URL.
04-12-2007 5:05 AM
I means i have uploaded pictures via se78
SAPscript graphic
->stored as text
->Standard text
->ST
04-12-2007 5:03 AM
Boris,
check this once.
RE: how to upload an image to be shown in Dynpro
Posted By Adithya Kambampati On Friday, March 04, 2005 at 8:01 AM
Hi all,
Steps for uploading Logo/picture :-:
1. Goto the transaction OAER
2. Enter the class name as 'PICTURES'
3. Enter the class type as 'OT'
4. Enter the object key as the name of the logo you wish to give
5. Execute
6. Then in the new screen select Standard doc. types in bottom window
Click on the Screen icon
Now, it will ask for the file path where you have to upload the logo
7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
I think this may be useful for u.
****************************************************************************************************************************************************************************************
Hi
This is a simple version of program rsdemo_picture_control that has only the
minimal necessary parts.
After you have uploaded your picture using transaction SMW0 (and not using
transaction OAER which is used
for a different purpose!), you can look at this program to understand what to
do.
Make sure that you create all the necessary objects like the PF-STATUS, the
custom container etc.
Boaz
REPORT rsdemo_picture_control .
DATA container TYPE REF TO cl_gui_custom_container.
DATA picture TYPE REF TO cl_gui_picture.
DATA ok_code TYPE sy-ucomm.
SET SCREEN 100.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'xxx'.
IF container is initial.
CREATE OBJECT container
EXPORTING container_name = 'CUSTOM_CONTAINER'.
CREATE OBJECT picture
EXPORTING parent = container.
DATA url(255).
CLEAR url.
PERFORM load_pic_from_db CHANGING url.
CALL METHOD picture->load_picture_from_url
EXPORTING url = url.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Form LOAD_PIC_FROM_DB
&----
text
----
*
----
FORM load_pic_from_db CHANGING url.
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'.
you put the object name here
query_table-value = 'JEG_PICTURE'.
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. " LOAD_PIC_FROM_DB
Don't forget to reward if useful....
04-12-2007 5:10 AM
Hi ,
We can't you use <b>OAER</b> t-code for uplaoding the logo to report?
Regards,
Kumar.