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

Publish Icon with DP_PUBLISH_WWW_URL

Hai,

I wanted to use SAP Icons in cl_gui_html_viewer.

I wanted to have the url of the sap Icons.

I know we can publish the Images in the web repository with <b>DP_publish_www_url</b>.

Do I have to pubish them or if they are readily available for use.

regards,

venkat

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 25, 2005 at 09:04 AM

    check out sample program in dynamic document

    <b>DD_ADD_PICTURE</b>

    for the same .

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks raja,

      I am not using Dynamic documents

      and wanted to use the pictures for displaying in the plane html in htmlviewer.

      I want a link some thing to include in <img src="...">

      So I am publishing the images in swww with dp_publish_www_url and using then in the src attribute of img tag.

      one other way is use load_mime_object in cl_gui_html_viewer to load the mime objects.

      regards,

      venkat

      regards,

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2005 at 02:49 PM

    Hi ,

    You can achive this by using load_data of html viewer.

    Steps to follow:

    1)First load mime LOAD_MIME_OBJECT

    2)build html

    3)read url

    4)show url

    Check the following code.

    *&---------------------------------------------------------------------*
    *&      Form  LOAD_HTML_VIEWER
    *&---------------------------------------------------------------------*
    FORM load_html_viewer.
      DATA : html_alignment TYPE i.
    *   CREATE HTML VIEWER
      CREATE OBJECT htmlviewer
        EXPORTING
           parent = custom_container
        EXCEPTIONS
          others         = 1.
      IF sy-subrc <> 0.
        MESSAGE i000(zmsg) WITH 'HTML Viewer Error'.
    
        EXIT.
      ENDIF.
    *   Alignment
      html_alignment = htmlviewer->align_at_left  +
                       htmlviewer->align_at_right +
                       htmlviewer->align_at_top   +
                       htmlviewer->align_at_bottom.
    
      CALL METHOD htmlviewer->set_alignment
        EXPORTING
          alignment = html_alignment
        EXCEPTIONS
          OTHERS    = 1.
      IF sy-subrc <> 0.
        MESSAGE i000(zmsg) WITH 'Control Alignment Error'.
        EXIT.
      ENDIF.
      PERFORM load_data_to_html.
    ENDFORM.                    " LOAD_HTML_VIEWER
    
    *&---------------------------------------------------------------------*
    *&      Form  LOAD_DATA_TO_HTML
    *&---------------------------------------------------------------------*
    FORM load_data_to_html.
      TYPES :t_html(130) TYPE c.
      DATA : l_url(80)        TYPE c,
             lt_html  TYPE STANDARD TABLE OF t_html,
             x_html LIKE LINE OF lt_html.
             
      CALL METHOD htmlviewer->LOAD_MIME_OBJECT
         EXPORTING
    ** here you can use your icon id
              OBJECT_ID  = 'HTMLCNTL_TESTHTM2_SAPLOGO'  
              OBJECT_URL = 'SAPLOGO.GIF'
         EXCEPTIONS
              OTHERS     = 1.
              
      x_html = '<html><h1>My Test Page<h1>'.
      APPEND x_html TO lt_html.
      x_html = '<br><img src="SAPLOGO.GIF"></html>'.
      APPEND x_html TO lt_html.
    
      CALL METHOD htmlviewer->load_data
       EXPORTING
    *     URL                  =
         TYPE                 = 'html'
         SUBTYPE              = 'html'
       IMPORTING
          assigned_url         = l_url
        CHANGING
          data_table           = lt_html
        EXCEPTIONS
          dp_invalid_parameter = 1
          dp_error_general     = 2
          cntl_error           = 3
          OTHERS               = 4 .
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    *  Display html data.
      CALL METHOD htmlviewer->show_data
        EXPORTING
          url                    =  l_url
        EXCEPTIONS
          cntl_error             = 1
          OTHERS                 = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    ENDFORM.                    " LOAD_DATA_TO_HTML

    Thanks,

    Venu.

    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.