Insertar logo en Dynpro

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • oieraz
    Member
    • nov
    • 54

    #1

    Insertar logo en Dynpro

    ¿Es posible insertar imágenes, logos, etc en una dynpro?

    Si es posible os agradecería que me explicarais como.

    Muchas gracias.
  • oieraz
    Member
    • nov
    • 54

    #2
    Al hilo de lo anterior, como se podría hacer lo mismo en un report normal, un selection-screen???

    Comentario

    • javiercar
      Junior Member
      • oct
      • 18

      #3
      Originalmente publicado por oieraz
      ¿Es posible insertar imágenes, logos, etc en una dynpro?

      Si es posible os agradecería que me explicarais como.

      Muchas gracias.

      Hola lo acabo de probar y si se puede, deberias hacer lo siguiente:

      Declarar en el TOP lo siguiente:

      CONSTANTS: CNTL_TRUE TYPE I VALUE 1,
      CNTL_FALSE type i value 0.
      data:
      h_picture type ref to cl_gui_picture,
      h_pic_container type ref to cl_gui_custom_container.
      * h_tree type ref to cl_gui_list_tree,
      * h_docking type ref to cl_gui_docking_container,
      * h_application type ref to lcl_application.

      data: graphic_url(255),
      graphic_refresh(1),
      g_result like cntl_true.

      data: begin of graphic_table occurs 0,
      line(255) type x,
      end of graphic_table.

      data: graphic_size type i.


      Luego en el PBO :

      DATA: l_graphic_xstr TYPE xstring,
      l_graphic_conv TYPE i,
      l_graphic_offs TYPE i.

      CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
      EXPORTING
      p_object = 'GRAPHICS'
      p_name = 'ENJOY' "Nombre de la imagen subida en sap SE78
      p_id = 'BMAP'
      p_btype = 'BCOL' "(BMON = Blanco y negro, BCOL = si es a color)
      RECEIVING
      p_bmp = l_graphic_xstr
      EXCEPTIONS
      not_found = 1
      OTHERS = 2.

      * IF sy-subrc = 1.
      * MESSAGE e287 WITH g_stxbitmaps-tdname.
      * ELSEIF sy-subrc <> 0.
      * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      * EXIT.
      * ENDIF.

      graphic_size = XSTRLEN( l_graphic_xstr ).
      CHECK graphic_size > 0.

      l_graphic_conv = graphic_size.
      l_graphic_offs = 0.

      WHILE l_graphic_conv > 255.
      graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
      APPEND graphic_table.
      l_graphic_offs = l_graphic_offs + 255.
      l_graphic_conv = l_graphic_conv - 255.
      ENDWHILE.

      graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
      APPEND graphic_table.

      CALL FUNCTION 'DP_CREATE_URL'
      EXPORTING
      type = 'image' "#EC NOTEXT
      subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'
      size = graphic_size
      lifetime = cndp_lifetime_transaction "'T'
      TABLES
      data = graphic_table
      CHANGING
      url = graphic_url
      EXCEPTIONS
      * dp_invalid_parameter = 1
      * dp_error_put_table = 2
      * dp_error_general = 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.
      EXIT.
      ENDIF.

      CREATE OBJECT h_pic_container
      EXPORTING container_name = 'CUST_CONTROL'.
      CREATE OBJECT h_picture EXPORTING parent = h_pic_container.

      CALL METHOD h_picture->load_picture_from_url
      EXPORTING
      url = graphic_url
      IMPORTING
      RESULT = g_result.


      NOTA: en la dynpro create un Control Custom. en este ejemplo yo la llame CUST_CONTROL.


      Te dejo este link que es de donde yo saque la informacion
      http://www.sapdevelopment.co.uk/graphics/add_image.htm


      Saludos!
      Cardozo Javier Hernan
      @r-Tech Consulting S.R.L.
      jcardozo@artech-consulting.com
      Ciudad de Buenos Aires
      Argentina
      www.artech-consulting.com

      Comentario

      • oieraz
        Member
        • nov
        • 54

        #4
        Muchas gracias por tu ayuda, me ha servido de mucho.

        Comentario

        Trabajando...