cancel
Showing results for 
Search instead for 
Did you mean: 

How to create GUI Custom Container in WebDynpro Component

Former Member
0 Kudos

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.

Regards,

Hari.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Regards

Yatin

Former Member
0 Kudos

Hi,

I will try with IFRAME and let you know.

Actually I have already tried with the above code to get the images, but I was not able to create custom container here.

Pls see this thread:

Thanks & Regards,

Hari.

Former Member
0 Kudos

But IFrame is depecated now...is there any replacement for this.

I do not want to use EP.

Regards

Anuj

thomas_szcs
Active Contributor
0 Kudos

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,

Thomas

Former Member
0 Kudos

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.

Regards

Satrajit

Former Member
0 Kudos

Hi Satrajith,

Thanks a lot, but could you please tell me some solution for image upload display on WDA.

Thanks & Regards,

Hari.

Former Member
0 Kudos

Hi,

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

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71">WDP java Image Upload & DW-Load</a>

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),

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.

CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

type = 'image'

subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'

size = graphic_size

lifetime = cndp_lifetime_transaction "'T'

TABLES

data = graphic_table

CHANGING

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

EXPORTING

url = graphic_url

IMPORTING

RESULT = g_result.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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.

Regards,

RIch Heilman