Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CL_GUI_HTML_VIEWER

Former Member
0 Likes
2,246

hi,

I'm using a container and class interface CL_GUI_HTML_VIEWER to display documents (Text, Word...)

I just want to display them and don't want the user to be able to change the document.

I try to do it with method set_enable form class CL_GUI_HTML_VIEWER, but then i can't use the scrool bar.....

any idea??

thanks,

joseph

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,376

In my system, I display a text file in the viewer. It does not allow me to change the document at all.



report zrich_0002.

data:  url(2048).

parameters: p_check type c.

start-of-selection.

at selection-screen output.

  data: dockingleft type ref to cl_gui_docking_container,
        html_control type ref to cl_gui_html_viewer,
        repid type syrepid.

  repid = sy-repid.


  check dockingleft is initial.

  create object dockingleft
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = dockingleft->dock_at_left
                        extension = 1000.

  create object html_control
     exporting
          parent    = dockingleft.

  url = '\serverfolderfile.txt'.

  call method html_control->show_url
        exporting
             url = url
        exceptions
             cnht_error_parameter = 1
             others = 2.


Regards,

Rich Heilman

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,377

In my system, I display a text file in the viewer. It does not allow me to change the document at all.



report zrich_0002.

data:  url(2048).

parameters: p_check type c.

start-of-selection.

at selection-screen output.

  data: dockingleft type ref to cl_gui_docking_container,
        html_control type ref to cl_gui_html_viewer,
        repid type syrepid.

  repid = sy-repid.


  check dockingleft is initial.

  create object dockingleft
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = dockingleft->dock_at_left
                        extension = 1000.

  create object html_control
     exporting
          parent    = dockingleft.

  url = '\serverfolderfile.txt'.

  call method html_control->show_url
        exporting
             url = url
        exceptions
             cnht_error_parameter = 1
             others = 2.


Regards,

Rich Heilman

Read only

0 Likes
1,376

Hi Rich,

In my system too, text file is not allowed to changes.

But this is not the for Word document.

Read only

0 Likes
1,376

So it allows you to edit the word document. Does it let you save it or anything. If not, then how cares if they modify it, it would be saved anyway. Right?

Regard,

Rich Heilman

Read only

0 Likes
1,376

I can save the document even if I don't see the WORD toolbar (by pressing CTRL+S).

I just don't want the user to be able to save anything.

Read only

0 Likes
1,376

Maybe I shoud use method REG_EVENT_LEFT_CLICK_RUN_MODE and disable the "LEFT CLICK"?