Code: Alles auswählen.
if picture is initial.
* create the custom container
CREATE OBJECT g_cc_200
EXPORTING container_name = '200_CC_001'.
CREATE OBJECT picture
EXPORTING parent = g_cc_200.
endif.
call method picture->load_picture_from_url
exporting
url = l_url.
call method picture->set_display_mode
exporting
display_mode = picture->display_mode_stretch.
Code: Alles auswählen.
CASE G_OK_CODE.
when 'BACK' or 'EXIT' or 'CANCEL'.
clear: picture, g_cc_200.
clear: prog, dyn1.
leave to screen 0.
endcase.
Code: Alles auswählen.
" Aufruf bei einem Event
clear: l_url.
case node_key.
when 'Lief'.
perform bild_zuweisen using 'PICTOR'.
when others.
perform bild_zuweisen using 'PICBSF'.
endcase.
...
FORM bild_zuweisen USING pic.
types t_line(256) type c.
data: l_pict_tab type table of t_line.
* Datenobjecte werden importiert
import pict_tab = l_pict_tab
from database abtree(pi) id pic.
call function 'DP_CREATE_URL'
EXPORTING
type = 'IMIGE'
subtype = 'GIF'
TABLES
data = l_pict_tab
CHANGING
url = l_url.
ENDFORM. " bild_zuweisen
Code: Alles auswählen.
Clear
Code: Alles auswählen.
free
Code: Alles auswählen.
PROCESS BEFORE OUTPUT.
MODULE status_0200.
MODULE create_controls.
PROCESS AFTER INPUT.
MODULE leave_program AT EXIT-COMMAND.
MODULE user_command_0200.
Code: Alles auswählen.
MODULE create_controls OUTPUT.
IF r_con IS INITIAL.
CREATE OBJECT r_con
EXPORTING
container_name = 'MY_CONTROL_AREA'.
ENDIF.
IF r_pic IS INITIAL.
CREATE OBJECT r_pic
EXPORTING
parent = r_con.
ENDIF.
IF gf_first = 'X'.
CALL METHOD cl_bds_document_set=>get_with_url
EXPORTING
classname = 'PICTURES'
classtype = 'OT'
object_key = '*UR*' "Nach diesem Key wird im Namen gesucht
CHANGING
uris = gt_url.
gf_first = ''.
ENDIF.
READ TABLE gt_url INTO gs_url INDEX gf_ind.
CALL METHOD r_pic->load_picture_from_url
EXPORTING
url = gs_url-uri.
ENDMODULE. " create_controls OUTPUT
Code: Alles auswählen.
MODULE user_command_0200 INPUT.
DATA: lf_lines TYPE i.
CASE gf_okcode.
WHEN 'VOR'.
PERFORM free_pic.
DESCRIBE TABLE gt_url LINES lf_lines.
gf_ind = gf_ind + 1.
IF gf_ind > lf_lines.
gf_ind = lf_lines.
ENDIF.
WHEN 'ZUR'.
PERFORM free_pic.
gf_ind = gf_ind - 1.
IF gf_ind < 1.
gf_ind = 1.
ENDIF.
ENDCASE.
ENDMODULE. " user_command_0200 INPUT
Code: Alles auswählen.
FORM free_pic.
CALL METHOD r_pic->free( ).
CLEAR r_pic.
ENDFORM. " free_pic