cancel
Showing results for 
Search instead for 
Did you mean: 

How to read file properties such as filename, file size from webdynpro application?

Former Member
0 Kudos

How to read file properties such as filename, file size from webdynpro application? What class or method can we use to get the properties?

I'm trying to read the file properties such as filename, size when the document is accessed via web dynpro application. Through SAP GUI I'm able to get file properties, but from webdynpro how can I get these properties?

Do we have any class that can be reused or any possible way?

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Akshay,

Take a look at the UI elements FileUpload and FileDownload. Filename is a property of those UI elements. You can determine the file size via

 bytes = xstrlen( file_data ).

Cheers,

Amy

Former Member
0 Kudos

Hi Amy,

Thanks for the answer, but I don't think this will work in my case. I'm having a different scenario. In the SAP GUI we use "CL_GUI_FRONTEND_SERVICES" class, do we have any alternative which provides similar kind of services for the webdynpro?

I have an application like an inbox, where an HR can access or reject the ticket. so this has both GUI and web dynpro supported. I just have to read additional properties of file that has been added to the ticket. so when calling from GUI it works, but for web dynpro we cannot use the class that I've mentioned above. I'm looking for another class which provides similar kind of services which support web dynpro application. I cannot use file upload or file download UI elements.

Regards,

Akshay.

amy_king
Active Contributor
0 Kudos

Hi Akshay,

Are you describing a file previously added to the ticket which the user then opens from web dynpro? How is that file stored? How are you making the file available to the user on the web dynpro screen?

Cheers.

Former Member
0 Kudos

Hi Amy,

Yes, a file previously added to the ticket will be available to download for the user in webdynpro. but along with that when a user selects a ticket, I want the file path or filename and file size kind of properties of the document that has been attached to the ticket. Is it possible to read such file properties? Does SAP allow to read the file properties in webdynpro just like it allows SAP GUI?

Thanks

Akshay

amy_king
Active Contributor
0 Kudos

Hi Akshay,

When you store the file data, maybe you can also store the details you need, e.g., file size, then you can read these details and display them as needed.

Cheers,
Amy

Former Member
0 Kudos

Hi Amy,

Yes, this would be a good option. But this would result in additional storage of each and every detail of the file. Is there any other alternative to get the properties in the runtime? that would be more helpful.

Thanks,

Akshay

amy_king
Active Contributor
0 Kudos

Would calling function module IO_C_PHIO_GET_FILE_PROPERTIES work for your scenario?

Former Member
0 Kudos

I tried this function module and this is not working in my scenario...