cancel
Showing results for 
Search instead for 
Did you mean: 

Saving File to a Applicatoin Server(AL11)

former_member197475
Active Contributor
0 Kudos

Hi Experts,

I tried the below code for uploading a file into the Application server(AL11) by using the statement OPEN DATASET.

* Saving it in SAP App Directory

   CONSTANTS path_name TYPE LOCALFILE VALUE 'usr/sap/tmp/'.

   CONCATENATE path_name

               ls_n_upload-FILE_NAME

               INTO l_fname.

   OPEN DATASET l_fname FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.

   TRANSFER ls_n_upload-FILE_CONTENTS to l_fname.

   CLOSE DATASET l_fname.


But am getting the error as


The application has to stop due to an error

Error message:File "usr/sap/tmp/E:\Pillar Program Criteria.pdf" is not open.Please contact system administrator for help.

I tried to analyze the error in so many ways. But couldn't. So my doubt is, whether this OPEN DATASET statement supports Web Dynpro ABAP, as it is trying to call the GUI.

Please clear this experts and let me know whether can i make the application to work perfectly.

BR,

RAM.

Accepted Solutions (1)

Accepted Solutions (1)

former_member201275
Active Contributor
0 Kudos

I think the error is in your filename i.e.  "usr/sap/tmp/E:\Pillar Program Criteria.pdf" I doubt very much that  "usr/sap/tmp/E:\Pillar Program Criteria.pdf" should be there.

former_member197475
Active Contributor
0 Kudos

Hi Glen,

Yes exactly you are right. That was an error in File name. But I need one more thing.

Can I save a ZIP file into the Applicatoin Server. Is it possible Glen???

BR,

RAM.

former_member201275
Active Contributor
0 Kudos

Yes, this is possible as I have done this before.

former_member197475
Active Contributor
0 Kudos

Glen,

Glad to hear from you

I tried to pass the data as string/xstring format. But I could  not able to get the ZIP file data in the server location.

Can you please give some info as how to post the ZIP data into the Application Server.

BR,

RAM.

former_member201275
Active Contributor
0 Kudos

phew, been a while since i done this, maybe you can google and find some code. i found this, maybe you can try something along these lines: http://wiki.scn.sap.com/wiki/display/Snippets/How+to+zip++files+in+Application+server+using+CL_ABAP_...

hope this helps, have nice day further.

former_member197475
Active Contributor
0 Kudos

Hello Glen,

Have already checked this wiki and some other stuffs. But nothing helps me still yet

Also FM GUI_DOWNLOAD, as said in the WIKI will not support Web Dynpro ABAP. That is why I could not keep my step further.

BR,

RAM.

Answers (0)