‎2007 Oct 01 2:06 PM
hi,
i have used this below code for uploading graphic image...in that it is getting URL.but from that URL it has to fetch and load the image in GRAPHIC window of SAP.i am unable to do that.
REPORT ZPRINT10.
tables : zemployee.
type-pools : CNDP.
data : begin of itab_emp occurs 0,
empid like zemployee-empid,
empname like zemployee-empname,
empaddress like zemployee-empaddress,
city like zemployee-city,
detid like zemployee-detid,
entrytime like sy-uzeit,
exittime like sy-uzeit,
end of itab_emp.
DATA return TYPE i.
DATA url TYPE cndp_url .
DATA picture_control_1 TYPE REF TO cl_gui_picture.
DATA container_1 TYPE REF TO cl_gui_custom_container.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_eid like zemployee-empid.
parameters : p_ename like zemployee-empname.
parameters : p_etime like itab_emp-entrytime.
parameters : p_time like itab_emp-exittime.
selection-screen : end of block blk1.
selection-screen begin of block b2.
parameters : path type rfpdo-rfbifile .
selection-screen end of block b2.
select empid empname empaddress city detid from zemployee into corresponding fields of table itab_emp where empid = p_eid
and empname = p_ename.
if sy-subrc = 0.
loop at itab_emp.
write 😕 itab_emp-empid,
10 itab_emp-empname,
25 itab_emp-empaddress,
40 itab_emp-city,
50 itab_emp-detid,
55 itab_emp-entrytime.
endloop.
endif.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'FILE'
IMPORTING
file_name = path.
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
OBJID = 'ZANURADHA'
LIFETIME = cndp_lifetime_transaction
IMPORTING
URL = url
EXCEPTIONS
OTHERS = 1.
concatenate 'file://' path into url.
CALL METHOD PICTURE_CONTROL_1->LOAD_PICTURE_FROM_URL
EXPORTING
url = url.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZSCRIPT7 '.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
CALL FUNCTION 'CLOSE_FORM'.
‎2007 Oct 01 2:08 PM
Hi,
The load picture method is for report/dialog program.
FOr script you need to pass the IMAGE NAME & not the URL into the GRAPHIC WINDOW of script.
Best regards,
Prashant
‎2007 Oct 01 2:08 PM
Hi,
The load picture method is for report/dialog program.
FOr script you need to pass the IMAGE NAME & not the URL into the GRAPHIC WINDOW of script.
Best regards,
Prashant
‎2007 Oct 01 2:26 PM
Hi Vinutha,
Go to Tcode se78 upload your image under bmap folder double click on tht and click on import button and upload your image either in black and white or color bitmap which is saved as .tiff or jpeg on your desktop.Now go to the window in your script form (se71) where you want to insert your image .Window -> Text elements ->Go to Insert in the menu ->Graphics and enter the name of your grahic mention in SE78.An don't forget to add the window (logo) name in your print program.
Reward Points If helpful.
Regards,
Harini.S