Skip to Content
avatar image
Former Member

How to create GUI Custom Container in WebDynpro Component

Dear experts,

Could any one kindly let me know how to create GUI custom container in WebDynpro. When I am trying in WD Componet sy-subrc is failing but the same thing if I try in SE38 sy-subrc is success.

Now I can explain clearly what & where this requirement comes in my application is I need to upload the images from local PC to WDA and trying to get the data from Upload UI element in XSTRING format and after reading this data am applying in CALL FUNCTION 'DP_CREATE_URL' to get the URL.

Here I am trying to display the image in two ways:

• Method1: Set the attribute of Image UI element dynamically with newly created URL value, it’s displaying a small icon on image but not showing actual image.

• Method2: Create custom container, picture, by using classes CL_GUI_CUSTOM_CONTAINER, CL_GUI_PICTURE and call method LOAD_PICTURE_FROM_URL to connect to newly created URL. But create GUI custom container is not working in WebDynpro, the same method is working fine in SE38.

Can anybody suggest me the right way, if my approach is not correct here.



Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Aug 24, 2007 at 12:38 AM

    The reason that it is not working is because the gui container is dependent on the the SAPgui, so since web Dynpro application runs in the browser, the SAPgui is not present, therefore gui controls will not work.


    RIch Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 24, 2007 at 03:11 AM

    Hi Hari,

    GUI_CONTAINER is the property of SAP_GUI. So SAP_GUI is require to run a application which contains GUI_CONTAINER. When You are running an WDP Application then its runs on Browser. But your browser does not contain SAP_GUI, so it is not reflecting in your browser.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      In WDP , graoics section , there is one element called graphics container. You can use that element to upload and display your image.

      For WDP JAVA you can visit this URL

      WDP" target="_blank">">WDP java Image Upload & DW-Load

      I am sending some code , hope it will help you

      graphic_table is the table with field XSTRING and contains the Image uploaded in XSTRING format

      DATA:h_picture TYPE REF TO cl_gui_picture,

      h_pic_container TYPE REF TO cl_gui_custom_container.

      DATA: graphic_url(255),


      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.



      type = 'image'

      subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'

      size = graphic_size

      lifetime = cndp_lifetime_transaction "'T'


      data = graphic_table


      url = graphic_url.

      CREATE OBJECT h_pic_container

      EXPORTING container_name = 'LOGO'.

      CREATE OBJECT h_picture EXPORTING parent = h_pic_container.

      CALL METHOD h_picture->load_picture_from_url


      url = graphic_url


      RESULT = g_result.

  • avatar image
    Former Member
    Aug 27, 2007 at 11:18 AM

    Hi Hari,

    You use the GUI control IFRAME and pass your created Image URL to this control.

    You image would be displyed in this IFRAME Control.



    Add comment
    10|10000 characters needed characters exceeded

    • Hello Anuj,

      There's no replacement. Nonetheless, SAP won't delete it in a support package and it's also part of 7.10. The reason why the iframe is deprecated is that people started running whole web application inside of it expecting that it behaves just like in the portal. For small, stateless, readOnly content, it's still ok to use an iframe.

      Best regards,