Skip to Content
0

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

Apr 19 at 07:45 AM

51

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Amy King Apr 19 at 12:34 PM
0

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

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

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.

0
Former Member
Amy King

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

0

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

0
Former Member

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

0

Would calling function module IO_C_PHIO_GET_FILE_PROPERTIES work for your scenario?

0
Former Member
Amy King

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

0