‎2008 Dec 10 9:33 AM
Hi All,
when i execut the program uncomment the Function "CALL METHOD PICTURE_CONTROL_1->SET_POSITION" this error occurred "Statement no accessible"
REPORT ZIMAGES .
START OF DO NOT CHANGE***********************************
DATA: docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
html_table LIKE w3html OCCURS 1,
return_code LIKE w3param-ret_code,
content_type LIKE w3param-cont_type,
content_length LIKE w3param-cont_len,
pic_data LIKE w3mime OCCURS 0,
pic_size TYPE i.
END OF DO NOT CHANGE*************************************
DATA : sum(4) , num1(4) , num2(4).
PARAMETERS: p_dummy(4) DEFAULT '4' .
PARAMETERS: p_dummy1(4) DEFAULT '5' .
AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.
START-OF-SELECTION.
*&----
*& Form show_pic
*&----
FORM show_pic.
DATA: repid LIKE sy-repid. repid = sy-repid.
CREATE OBJECT picture_control_1 EXPORTING parent = docking. CHECK
sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 200
left = 100
top = 20
width = 400.
CHANGE POSITION AND SIZE ABOVE**************************
*IF url IS INITIAL.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
CHANGE IMAGE NAME BELOW UPLOADED IN SWO0*****************
query_table-value = 'BIKER'.
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = url.
endform. "show_pic
*CALL METHOD PICTURE_CONTROL_1->SET_POSITION
EXPORTING
HEIGHT = 60
LEFT = 100
TOP = 20
WIDTH = 200
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
others = 3
.
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
*
*IF URL IS INITIAL.
*REFRESH QUERY_TABLE.
*QUERY_TABLE-NAME = 'OBJECT-ID'.
*QUERY_TABLE-VALUE = 'ZAMITLOGO'.
*APPEND QUERY_TABLE.
‎2008 Dec 10 9:43 AM
the FORM ... ENDFORM has to stand at the end of the program. So you have to replace the method calls and the FORM routines
‎2008 Dec 10 9:35 AM
Hi
Comment AT SELECTION-SCREEN OUTPUT. event and give START-OF-SELECTION. before PERFORM show_pic.
means ur code shd be like this
AT SELECTION-SCREEN OUTPUT.
START-OF-SELECTION.
PERFORM show_pic.
Regards
‎2008 Dec 10 9:36 AM
Hi,
Give the method PICTURE_CONTROL_1->SET_POSITION after picture_control_1->set_display_mode.
Regards
‎2008 Dec 10 9:43 AM
the FORM ... ENDFORM has to stand at the end of the program. So you have to replace the method calls and the FORM routines
‎2008 Dec 10 9:47 AM
Hi,
There should not be any statement after the subroutine definitions Form .. Endform. Place the function call before the Form statement. Hope it helps.
Regards,
Aruna