‎2006 Nov 30 11:14 AM
Hello,
i ve the following req :
i ve some pushbuttons on the container.thru 1 button i need to navigate
to an intranet web page.i tried with cl_gui_html_viewer, but i couldnt get
the right o/p.can anybody help me on how to use the method SHOW_URL.
thanks
Swaminathan.
‎2006 Dec 11 4:36 AM
hi kinshuk,
is it possible to show the URL in explorer instead of SAP screen?
i mean, my requirement is when i press the pushbutton it shud open the
concerned url in IE.
Thanks & Regards,
Swami.
‎2006 Nov 30 11:17 AM
check out transaction DWDM - it has got sample programs which is easy to follow.
Regards
Raja
‎2006 Nov 30 11:22 AM
You can try this method
DATA : URL TYPE STRING.
URL = 'http://sdn.sap.com/'.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = URL
EXCEPTIONS
OTHERS = 1.
Regards,
Anish Thomas
‎2006 Dec 01 7:03 AM
Hi Swaminathan,
Check the following example:
Create a screen 100 having a control area 'HTML' copy paste the following code
REPORT ZHTML_CONTROL .
data: CONTENT type standard table of char255,
url(256) type c.
DATA: HTML_CONTROL TYPE ref to cl_gui_html_viewer,
my_container type ref to cl_gui_custom_container,
ui_flag type i.
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
CREATE OBJECT MY_CONTAINER
EXPORTING
CONTAINER_NAME = 'HTML'
EXCEPTIONS
OTHERS = 1.
ui_flag = CL_GUI_HTML_VIEWER=>UIFLAG_NO3DBORDER +
CL_GUI_HTML_VIEWER=>UIFLAG_NOIEMENU.
create object html_control
EXPORTING
PARENT = my_container
SAPHTMLP = 'X'
UIFLAG = ui_flag
lifetime = CL_GUI_HTML_VIEWER=>LIFETIME_DYNPRO.
url = 'http://help.sap.com'.
CALL METHOD html_control->load_data
EXPORTING
URL = url
* TYPE = 'text'
* SUBTYPE = 'html'
* SIZE = 0
IMPORTING
ASSIGNED_URL = url
CHANGING
data_table = content
* EXCEPTIONS
* DP_INVALID_PARAMETER = 1
* DP_ERROR_GENERAL = 2
* CNTL_ERROR = 3
* others = 4
.
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 html_control->show_url
EXPORTING
url = url
* FRAME =
* IN_PLACE = ' X'
* EXCEPTIONS
* CNTL_ERROR = 1
* CNHT_ERROR_NOT_ALLOWED = 2
* CNHT_ERROR_PARAMETER = 3
* DP_ERROR_GENERAL = 4
* others = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endmodule. " STATUS_0100 OUTPUT
Hope this helps.
Regards,
kinshuk
‎2006 Dec 04 6:08 AM
hello kinshuk,
thank u very much. your help is invaluable.
i will be very thankful if u describe briefly about the
code.
Thanks & Regards,
Swaminathan.
‎2006 Dec 04 6:42 AM
Hi Swaminathan,
For html view control you have to follow the following steps.
describing the above example.
steps:
1. data declaration
data: CONTENT type standard table of char255,
url(256) type c.
DATA: HTML_CONTROL TYPE ref to cl_gui_html_viewer,
my_container type ref to cl_gui_custom_container,
ui_flag type i.
2. create a screen and on the screen create a control area and name it .
eg. here : screen 100 and control area name 'HTML'
3. on the PBO of the screen,
a. create container object
CREATE OBJECT MY_CONTAINER
EXPORTING
CONTAINER_NAME = 'HTML'
EXCEPTIONS
OTHERS = 1.
b. set the ui flag for web browser (check docu)
ui_flag = CL_GUI_HTML_VIEWER=>UIFLAG_NO3DBORDER +
CL_GUI_HTML_VIEWER=>UIFLAG_NOIEMENU.
c. create html control object
create object html_control
EXPORTING
PARENT = my_container
SAPHTMLP = 'X'
UIFLAG = ui_flag
lifetime = CL_GUI_HTML_VIEWER=>LIFETIME_DYNPRO.d. set the url
url = 'http://help.sap.com'.e. load data on to the html control
CALL METHOD html_control->load_data
EXPORTING
URL = url
* TYPE = 'text'
* SUBTYPE = 'html'
* SIZE = 0
IMPORTING
ASSIGNED_URL = url
CHANGING
data_table = content
* EXCEPTIONS
* DP_INVALID_PARAMETER = 1
* DP_ERROR_GENERAL = 2
* CNTL_ERROR = 3
* others = 4
.e. Finally show the URL on the control screen
CALL METHOD html_control->show_url
EXPORTING
url = url
* FRAME =
* IN_PLACE = ' X'
* EXCEPTIONS
* CNTL_ERROR = 1
* CNHT_ERROR_NOT_ALLOWED = 2
* CNHT_ERROR_PARAMETER = 3
* DP_ERROR_GENERAL = 4
* others = 5
.
hope this helps.
Regards,
Kinshuk
‎2006 Dec 11 4:36 AM
hi kinshuk,
is it possible to show the URL in explorer instead of SAP screen?
i mean, my requirement is when i press the pushbutton it shud open the
concerned url in IE.
Thanks & Regards,
Swami.
‎2006 Dec 11 4:45 AM
for that use FM
CALL_BROWSER
Regards
Raja
Reward helpful answers with points.
‎2006 Dec 11 5:18 AM