Skip to Content
author's profile photo Former Member
Former Member

how to call browser in custom control

Hi experts,

Please help. I need to call internet explorer in custom control.please give the complete step.

thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 19, 2008 at 11:47 AM

    Hello Abhishek

    I assume sample report ZUS_SDN_SAP_PDF_VIEWER_DEMO fulfills your requirement.

    REPORT ZUS_SDN_SAP_PDF_VIEWER_DEMO .
    *&---------------------------------------------------------------------*
    *& Thread: how to call browser in custom control
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1173671"></a>
    *&---------------------------------------------------------------------*
    
      data: my_pdf_viewer     type ref to cl_gui_pdfviewer,
            my_main_container type ref to cl_gui_custom_container,
            entry1(100) type c,
            entry2(100) type c.
    
      data: okcode type sy-ucomm.
    
      include pdf_demo_event_receiver.
    
      data: l_event_receiver type ref to lcl_pdf_demo_event_receiver.
    
      start-of-selection.
    
      set screen 100.
    
    
    *&---------------------------------------------------------------------*
    *&      Module  pbo_0100  OUTPUT
    *&---------------------------------------------------------------------*
    module pbo_0100 output.
    
      set pf-status 'STATUS100'.
      set titlebar  'TITLE100'.
    
      " ----------------------------------------
      " running down the pbo for the first time,
      " create the controls and their containers
      if my_main_container is initial.
        create object my_main_container
          exporting
            container_name = 'CUSTOM_CNTL'
          exceptions
            cntl_error     = 1
            others         = 2.
        if sy-subrc <> 0.
          exit.
        else.
    
        " -----------------------------------
        " create PDF Viewer object
        create object my_pdf_viewer
          exporting
            parent              = my_main_container
          exceptions
            cntl_error          = 1
            cntl_system_error   = 2
            others              = 3.
          if sy-subrc <> 0.
            "could not create PDF Viewer
          endif.
        endif.
    
        data: view_buttons_active type char01.
        if my_pdf_viewer->acrobat_vs_reader = ''.
          view_buttons_active = 'X'.
        endif.
    
        " -----------------------------------
        " create SAP toolbar for PDF Viewer
        call method my_pdf_viewer->create_toolbar
          exporting
            tool_buttons      = 'X'
            view_buttons      = view_buttons_active
          exceptions
            cntl_error        = 1
            cntl_system_error = 2
            others            = 3.
        if sy-subrc <> 0.
          "could not create toolbar
        endif.
    
        create object l_event_receiver.
        set handler l_event_receiver->on_document_saved for my_pdf_viewer.
        set handler l_event_receiver->on_viewing_finished for
     my_pdf_viewer.
    
        if not my_pdf_viewer->html_viewer is initial.
          call method my_pdf_viewer->open_document
            exporting
              "url = 'http://p34198/iissamples/default/ReadMe.pdf'.
              url = 'https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907'
    **          url = 'file:///C:	emp	mpGridDoc.pdf'.
          .
        endif.
    
      endif.
    
    endmodule.                 " pbo_0100  OUTPUT
    
    *&---------------------------------------------------------------------*
    *&      Module  pai_0100  INPUT
    *&---------------------------------------------------------------------*
    module pai_0100 input.
      case okcode.
        when 'EXIT'.
          leave program.
        when 'LOADURL'.
          call method my_pdf_viewer->open_document
            exporting
              url = 'http://p34198/myweb/Devfaq.pdf'.
        when 'EVENT'.
          entry1 = l_event_receiver->entry_field1.
          entry2 = l_event_receiver->entry_field2.
      endcase.
    endmodule.                 " pai_0100  INPUT
    

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 12:59 PM

    Hi Abhishek,

    Also look into the below sample program.... its using cl_gui_html_viewer.....

    DATA: go_container       TYPE REF TO cl_gui_custom_container,
          go_html_control    TYPE REF TO cl_gui_html_viewer.
    
    START-OF-SELECTION.
    
      CALL SCREEN 100.
    
    *---------------------------------------------------------------------*
    *       MODULE PBO OUTPUT                                             *
    *---------------------------------------------------------------------*
    MODULE pbo OUTPUT.
      SET PF-STATUS 'BASIC'.
      PERFORM create_objects.
    ENDMODULE.                    "pbo OUTPUT
    *---------------------------------------------------------------------*
    *       MODULE PAI INPUT                                              *
    *---------------------------------------------------------------------*
    MODULE pai INPUT.
      LEAVE PROGRAM.
    ENDMODULE.                    "pai INPUT
    
    
    
    *----------------------------------------------------------------------*
    FORM create_objects .
      IF go_container IS INITIAL.
        CREATE OBJECT go_container
          EXPORTING
            container_name = 'CUSTOM'.
    
        CREATE OBJECT go_html_control
          EXPORTING
            parent = go_container.
    
        CALL METHOD go_html_control->show_url
          EXPORTING
            url = '<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1173671"></a>'.
      ENDIF.
    ENDFORM.                    " create_objects

    Cheers,

    Jose.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.