Use GUI_DOWNLOAD to save the file as amtapg.zip to your local machine.
Create an instance of the zip class: create object zip . Download amtapg zip
If you are working within SAP, you can use the CL_ABAP_GZIP or CL_ABAP_ZIP classes to compress your text content before downloading. Use GUI_DOWNLOAD to save the file as amtapg
Add your text file content: zip->add( name = 'amtapg.txt', content = your_content ) . Download amtapg zip
For web applications, the ZipArchive class is the standard way to bundle text files into a zip for user download.
You can find more detailed examples on the SAP Community forums .