‎2011 Aug 10 12:06 PM
Hi,
Is there any class/method to directly open the file from application server?
Means---at my selection screen I have application server path, file name and the type of the file...when I execute the program it should directly open the .doc/.txt/.msg file that is saved in the application server.
Thanks.
‎2011 Aug 10 12:17 PM
‎2011 Aug 10 12:20 PM
Hi,
I think you have to download the file to the users pc first and then open it.
Best regards,
Oliver
‎2011 Aug 10 12:28 PM
No...my requirement is to open directly once I execute...not to download and open
‎2011 Aug 10 12:31 PM
‎2011 Aug 10 12:34 PM
Oliver...my file is in application server...from ther it should pick and open..I have the application server path, file name and type of the file...
‎2011 Aug 10 12:41 PM
Yeah, but you don't want to only show the text in it in a SAP window, do you?
If yes, use OPEN DATASET.
But I think what you want is to open the file on the clients computer (eg. a .doc file with MS Word).
And this is only possible if Word has access to this file. And usually you don't have direct access to the application servers file folder.
Therefore the file has to be downloaded to the users computer first. (into C:\Temp\ for example). And only then it is possible to open it.
What's the problem with this? The user doesn't even notice the download. It happens in Background.
Best regards,
Oliver
‎2011 Aug 10 12:45 PM
I agree.Bcz the functionality is kind of attachment open in any transactions.So they want to direct open.
‎2011 Aug 10 12:55 PM
Then you have to explain them that this IS direct open. This is the way every program does it...PDFs on the internet, mail attachments in Outlook, ...
I'm not sure if CG3Y helps you. You should use methods of CL_GUI_FRONTEND_SERVICES to get the file to the pc and start them.
Alternative would be not to store the files on the application server, but on a file server where everybody has access.
‎2011 Aug 10 12:46 PM
‎2011 Aug 10 12:50 PM
Hi chandra,
It will give the list of files. I want to open the file that I have provided the name at selection screen..
Thanks.
‎2011 Aug 10 12:54 PM
Forget CG3Y. It's old and has severe limitations....like 256 byte file transfer....use GUI_DOWNLOAD and GUI_UPLOAD instead of CG3*, if using FM....GUI services class if in OO.
So far as opening the file, after you have it open, you can't do anything with the data until you get it into SAP. This is somewhat similar to Open SQL SELECT, which copies the data from db to db buffers, to SAP buffers (if the data is not already buffered), into your structure or internal table before you can do anything with that data.
Edited by: DaveL on Aug 10, 2011 1:55 PM
‎2011 Aug 10 12:57 PM
Ok, suppose I have got the data into one internal table. And the table has the file name with file type. Is there any way to open the file from the internal table data?
here it shoulf be dynamic, i.e the format can be anything (txt,xls,msg,xml,etc)
‎2011 Aug 10 2:40 PM
I think you are looking for OLE. I think there are lots of threads in the forum if you search for "OLE".
Rob