cancel
Showing results for 
Search instead for 
Did you mean: 

Upload image into ztable from web dynpro

Former Member
0 Kudos

Hi experts,

I need to upload image i.e. .jpg file from PC to web dynpro application. and this file data should store in the ztable so that this can be retrieve later whenever needed. I tried using xstring option and then xstring to binary and bin but i guess this is not correct. it says file is not in .pdf format. I am in a mess now. I tried searching on SDN but all are having with se78 MIME. But i dont want to use this.

Kindly help me out in the same.

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Please refer the below document in which I have explained the steps required to achieve your requirement.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

Was working on this and got succeeded in the same. Thanks for understanding the exact requirement. But now next step is now I want to download each file individually.

Like I have collected all the files, and for each record there are 3-4 files so now i wan to create new application and whenever i run this application and enter particular record, I should be able to see those 3-4 files of that record and also should be able to view and download these files suppose in .pdf format.

Thanks.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Glad that you are able to solve your issue. To download the documents, please follow the document(s) which i suggested in my earlier post.

Regards,

Rama

Former Member
0 Kudos

Thanks for your reply,

do you mean earlier post means your reply to my question?

If yes, then my requirement is little different, here few users are uploading the data, and its another user who is downloading all the data of those user, who have uploaded their data in Ztable.

Thanks for prompt help.

Gowtham
Contributor
0 Kudos

Hi,

In the Ztable that you are using to capture the image , create one more field named User ID and capture the user's ID who is uploading the image.

Then when you are writing the code to fetch the Image data add one more line 'where query' and filter the content of the login user.

Hope this will solve your issue.

- Gowtham

Former Member
0 Kudos

Hi Gowtham,

Thanks for your reply , I will do the same thing I already have this field captured. but my issue is how to get the data which is stored in the table for these .pdf files , this data is in RAWSTRING format. so i want to download these files again back to .pdf format.

Thanks for your reply.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Hope you have already capturing the attachment type/mime type into ztable as described in the below document.

To download the content from table into required format,Use the fileDownload ui element and bind the content to RAWSTRING AND content type to type of attachment from table.

Attach files with save, retrieve and delete functionality in Web Dynpro ABAP - Part 1

In the above document, I have explained you the process of storing attachments into table where content and type also stored.

Please go the the complete document to understand better.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Thank you Rama,

Thanks for your reply, but i think there is some gap between our understanding.

i will explain the scenario in brief,

Suppose person A is uploading some files form his machine,

person B is uploading some files form his machine,

and person C is doing the same thing from his machine,

and there is one person D who will download all the files of A B and C from his machine which are saved in Z table in RAWSTRING format.

I guess in your document the there is a same person who is uploading and downloading these files.

also I guess Mr. Rohith Brungi was having the same requirement who has commented in your document

So as per my understanding we need to create two programs one which u have mentioned and other to download i.e. to convert this RAWSTRING data to .pdf file.

Thanks for help

Gowtham
Contributor
0 Kudos

Hi,

Requesting to you use File Download or Interactive form UI element to download the files , Take the rawstring data from table and bind it with any of the above mentioned UI element , in the case of multiple files you can use File download element inside table.

When the user clicks the file it will be automatically downloaded into their system.

- Gowtham

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Thanks for the clear explanation of your requirement.

But, you are more thinking on how to convert RAWSTRING data into pdf.

I would think the below explanation would give you a way ahead in the solution.

Step1: Uploading files

Whenever users A,B,C uploads files into Ztable, you are going to save the content into  FILE_DATA and file type into FILE_TYPE fields as below.

Now, you may add user name into table to show user details of who uploaded files to the user D.

Step2: Downloading files

When user D wants to download files, then you need to create a separate report which fetches all the files from Ztable and show in a table in WD.

The table should have the file download ui element and bind the properties DATA and MIME_TYPE as shown in document - part 2.

Please change the logic of fetching files in method WDDOINIT( ) as below

  SELECT *

    INTO TABLE lt_data

    FROM ytr_attach_files.


    WHERE uname = sy-uname.

Now, all the files will be fetched from table and shown to user D.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Thanks Rama,

I am very happy , i got solution to my problem, you understood the problem correctly and given the exact solution. I had already created a another WD application and the changes before to the type file download but forgot to mapped the File name MMIE type and Text properties. After your hint I done these changes and now I am getting my desired output.

Thanks a lottttt.

Former Member
0 Kudos

Thanks Gowtham for your reply.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Its glad to hear that your issue is resolved .. Please close the ticket by marking correct answers.

Regards,

Rama

Former Member
0 Kudos

just need one more help, if i want to upload multiple files then how to achieve that, as here I can only upload single file at a time.