Application Development and Automation 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 only

ZIP and secure file

Former Member
0 Likes
717

HI,

I need to create program which send file to server ,

and i want to secure this file with zip and password to open .

there is a way to do that in abap ?

Regards

Chris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
665

Check the different methods in class CL_ABAP_ZIP. This will help you to zip the contents. I don't think password protection is possible. You can try executing a UNIX command to achieve password protection, using the FILTER option (for executing unix command) in ABAP program.

Thanks,

Vijay

Check the different methods in class CL_ABAP_ZIP. This will help you to zip the contents. I don't think password protection is possible. You can try executing a UNIX command to achieve password protection, using the FILTER option (for executing unix command) in ABAP program.

Thanks,

Vijay

4 REPLIES 4
Read only

Former Member
0 Likes
666

Check the different methods in class CL_ABAP_ZIP. This will help you to zip the contents. I don't think password protection is possible. You can try executing a UNIX command to achieve password protection, using the FILTER option (for executing unix command) in ABAP program.

Thanks,

Vijay

Read only

0 Likes
665

HI Vijay ,

thanks ,

do u know how to add the password it's very important for this problem

Regards

Chris

Read only

0 Likes
665

Hello Chris,

All you need to do is execute the UNIX command using the FILTER option in OPEN_DATASET.

I found out that the UNIX command for zip with password is zip -P <password> -r ZZZZ.zip ZZZZ.TXT. Not sure whether this is correct. You have to try it. But the important thing here is you should know who to execute the unix command from abap program.

1. Use Open Dataset with filter option.

2. Construct the UNIX command - concatenate and put into a string.

3. Execute the TRANSFER statment with the above string. (This is like executing the UNIX command)

4. Close the dataset.

You can give it a try. Not very sure whether it is going to work.

Thanks,

Vijay

Read only

0 Likes
665

if OPEN DATASET with FILTER 'zip...' doesn't work, you may create the file normally, and compress it with password into another file by calling a unix command (zip or whatever). To call any unix command, see forum or sap library (SXPG_* function modules and SM62 transaction)