Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Read Zip file from AL11 directory (Application Server) and send it via email ?

KWTSTEEL
Explorer
0 Kudos

Dear Gurus,

Can anybody help me to read zip file from my AL11 directory (Application server) in my ABAP program and post-reading I need to send it via email.

12 REPLIES 12

FredericGirod
Active Contributor
0 Kudos

You could find a lot of documentation about how to read a file in the server, how to send email using Oo ..

please try first to search

KWTSTEEL
Explorer
0 Kudos

Dear Frederic,

thank you for your prompt response.

I did try to search a lot and at last, finally posted because I could not find a single blog or thread which will help me to understand how to read a zip file from AL11 directory. Also I am not worried about sending mail logic I have already written it.

Regards,

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area: "Before answering You should only submit an answer when you are proposing a solution to the poster's problem"

Sandra_Rossi
Active Contributor

You searched and you didn't find open dataset dset read dataset dset into xstring close dataset dset?

KWTSTEEL
Explorer
0 Kudos

Please try to understand that I am asking regarding zip file, I am not talking about text file or pdf file or excel file. there are lot of opendataset codes but nothing regarding zip file

What is a zip file if not a binary file?
You have hundreds of threads on the topic and hundreds of threads on how to send them via email.

ZIP is not a magical format, it's like any other non-text file.

0 Kudos

It does not matter what type of file is it if you read it in "BINARY MODE".

-- Tomas --

0 Kudos

do you mean that you want to read the content of zip file, or what we call unzip it? maybe CL_ABAP_ZIP is what you looking for, but how to read the content of zipped file is difference thing based on what file zipped. if you don't have to care about file content, just read the zip into xstring and send it.

0 Kudos

Hi Simson,

have you got solution for this?

I want read .GZ file from AL11. Searched a lot but not able to find any solid solution. Please let me know if you have resolved this problem.

Thanks

Sandra_Rossi
Active Contributor
0 Kudos

Use this code, handle errors, and that's done...

data: dset    type string,
      xstring type xstring.

dset = '/tmp/file'.
open dataset dset for input in binary mode.
read dataset dset into xstring.
close dataset dset.