cancel
Showing results for 
Search instead for 
Did you mean: 

steps to upload foto in WDA (ABAP)

Former Member
0 Kudos

Gudday,

Can anyone provide the step-by-step procedure to upload foto in the WDA(ABAP)???

After it is uploaded i want to see the image in the output..can it be done???

How should the binding be done???

Awaiting your Reply.

Thanks,

Deepthi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

Have an input field in ur view and ask the user to give the name of the link where his photo is stored then

create an attribute in the context and bind the 'source' property of the 'image UI element' to this attribute.

Get the value in the inputfield and pass to this created attribute then the image will be displayed in ur output

Hope this helps U

Thanks and regards

Tamilselvan.K

Former Member
0 Kudos

Hi Deepthi,

Can you try this Link...

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7783. [original link is broken] [original link is broken] [original link is broken]

Hope it will help you..............

Reward points if useful....

Former Member
0 Kudos

Yes it is possile to upload as well as display the image in webdynpro view.

Step 1) import image in your component as MIME object

path: component->create-.mime obejct->import

Step 2) after importing you can see that image into your component as MIME object .Now insert a UI element image into your view layout .

Step 3) Go to the source property of IMAGE element and select F4 option , u will find a window is opening with some tabs(service pack SP 13 or more than that) .

Step 4) Select tab COMPONENT IMAGES and component name select your component .

Step 5) You will find the image which you have imported into this section just select the image and save it.

Run your application and u will find your image in output.

Pankaj Giri

Former Member
0 Kudos

Hi,

Thanks for your reply.

The application will be integrated in the portal and it should allow users to upload their photoes .....

sooo....thr mime repository i think this cant be done...

Any Other methods to do this???

Thanks,

Deepthi.

Former Member
0 Kudos

Martina,

check this WDA HRASR00_PROFILE_FOTO

reward points if helpful

Former Member
0 Kudos

Hi,

You can use the fileupload UI element and upload the file to the application server. Maintain the path of the application server where the file has been uploaded in shared memory or data base table. Then while displaying the image get the path of the application server and attach the image data to the response object.

Check the WDA component WDR_test_events ->FILEUPLOAD view to know about how to get data from the uploaded image file.

then to save the file in the application server you can use the below code:

After uploading to the application server save the file path and file name in a DB table. The field ls_filecontent will be of type xstring.

*  Upload file to the application server
  OPEN DATASET lv_filepath for OUTPUT IN BINARY MODE.
  CHECK sy-subrc eq 0.
  TRANSFER ls_file-filecontent to lv_filepath.
  CLOSE DATASET lv_filepath.

When the user requests for display of the image, get the path of the application server where it is saved from the database table and follow the below code:

* Read file from the application server
        OPEN DATASET ls_path-FILEPATH for INPUT IN BINARY MODE.
        if sy-subrc eq 0.
          READ DATASET ls_path-FILEPATH INTO lv_fcontent.
          CLOSE DATASET ls_path-FILEPATH.
        endif.

the variable lv_fcontent will be of type xstring.

then to attach this content to the response object:

cl_wd_runtime_services=>attach_file_to_response(
                i_filename      = lv_filename
                i_content       = lv_fcontent
                i_mime_type     = lv_mime_type
                i_in_new_window = lv_in_new_window
                i_inplace       = lv_inplace ).

Hope this helps...

Please let me know if you still need some help.

Best regards,

Ravi