Skip to Content
0
Former Member
Nov 27, 2011 at 07:56 AM

Printing image problem.

68 Views

Hi to all.

I am new in abap programming.

I would like to ask what could be the reason in my program for not printing the image. I do not know where's my mistake is, please help. Thanks..

I got this program from internet and it's pretty displaying the image ( I uploaded the image in SE78), then I created the program below and run it, but when I happened to click the print button, it wasn't giving me anything or no action at all.

REPORT ZPICTURE04.

START-OF-SELECTION.

SET PF-STATUS 'ADJTEMP'.

CALL SCREEN 9000.

module status_9000 output.

SET PF-STATUS 'ADJTEMP'.

data: w_lines type i.

types pict_line(256) type c.

data : ok_code type c,

exit 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 = 'XLPE'

p_id = 'BMAP'

p_btype = 'BCOL'

receiving

p_bmp = l_graphic_xstr

.

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.

case sy-ucomm.

when 'EXIT'.

leave program.

WHEN '%PRI'.

NEW-PAGE PRINT ON

DESTINATION 'LP01'

IMMEDIATELY 'X'

KEEP IN SPOOL 'X'

NO DIALOG.

NEW-PAGE PRINT OFF.

endcase.

endmodule. " STATUS_9000 OUTPUT

my pf-status " SET PF-STATUS 'ADJTEMP", I set it from the / menu / extras / adjust template then List status.

Is there anything I missed for not printing it? Thanks a lot to all.

Edited by: chard_vill on Nov 27, 2011 8:59 AM