on 06-19-2008 7:04 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.