cancel
Showing results for 
Search instead for 
Did you mean: 

CL_GUI_FRONTEND_SERVICES Functions for Web Dynpros

TimoScharmann
Participant
0 Kudos

Hi folks,

I want to check a file, which should be uploaded using FileUpload. This file shall exist on the local client and doesn't exceed a predefined size limit. CL_GUI_FRONTEND_SERVICES provides methods FILE_GET_SIZE and FILE_EXIST. As this class is only for SAP GUI my question is, if there is something near it for WebDynpros?

Thanks for answers!

Accepted Solutions (1)

Accepted Solutions (1)

former_member205703
Participant
0 Kudos

Hi Timo,

In webdynpro the contents of the file is treated as xstring data and this is how you can find the size of the file.

data: content type xstring.
data size type i.

wd_context->get_attribute( exporting name = 'FILECONTENT'  importing value = content ).
size = xstrlen( content ).

Regards

Amol

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are correct that CL_GUI_FRONTEND_SERVICES is only for usage in the SAPGUI - as are any class with the naming CL_GUI*. They require the Control Framework of the SAPGUI.

What you describe is not really possible in Web Dynpro - not because of a limitation in WD - but because of browser controls. Remember that your application doesn't appear any more trusted to the browser than most anything else on the Internet. Even using security zones in the browser doesn't really open up full access to the desktop machine the way a thick client like the SAPGUI does. I'm afraid that currently uploading the complete file and counting the number of bytes (as described) is your ownly records. In the upcomming NetWeaver Enhancement Package 1 we do have two new ACF - Java Applet based UI elements that perform some of the functions of CL_GUI_FRONTEND_SERVICES. They are acfUpDownload (for mass uploads/downloads and "background" ones) and the acfExecute - (arbritery execution of applicaitons on the desktop client). These UI elements get around the browser limitations because they are Signed Java Applets yet still have a security control mechanism (via a Whitelist Configuration XML file) to keep people from using them in a detrimental nature. They still might not get you exactly what you want (file size query), but they are a step in the correct directly for replicating the most common functionalities of CL_GUI_FRONTEND_SERVICES.

TimoScharmann
Participant
0 Kudos

Thanks Amol! This works fine!

Thomas, thanks again for the info!

Former Member
0 Kudos

Is there any like class available so that i can use the same functionality in ABAP web dynpro???

--

Regards

Vinay Bedre

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Is there any like class available so that i can use the same functionality in ABAP web dynpro???

>

> --

> Regards

> Vinay Bedre

Did you read the explanation that has been posted already? I went into considerable detail explaining the reasons for the technical limiations (IE we are running in a browser) and the alternatives that are provided (the ACF UI elements). I don't know what more details I could provide.