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

Encoding and decoding of tables data

Former Member
0 Likes
1,581

Hi,

I need to encode the values in the fields of the data base table and again i need to put the encoded data into that data base table back and i need to decode the data base table back.

Are there any fm's for this?

Please suggest me a approch of doing this.

Thanks in advance,

Radhika

5 REPLIES 5
Read only

franois_henrotte
Active Contributor
0 Likes
1,148

look at methods of class CL_HARD_WIRED_ENCRYPTOR

Read only

0 Likes
1,148

Hi Francois,

I checked the methods in the class CL_HARD_WIRED_ENCRYPTOR.

But, in my case the ecrypted and decrypted data lengths should be same,

bcoz after encrypted that data should fit into that particular field of the same table.

I did not found any method for this case in the above class.

Thanks,

Radhika

Read only

0 Likes
1,148

even tho thats possible, be aware that Encryptions where Encrypted String is of same length as unencrypted are not at slightest safe encryptions.

Read only

KiranJ
Active Participant
0 Likes
1,148

Hai ,

Use this Sample code.

DATA pwd TYPE string.

DATA encoded TYPE string.

pwd = ls_node1-pwd.

CONDENSE pwd.

CALL METHOD cl_http_utility=>if_http_utility~encode_base64

EXPORTING

unencoded = pwd

RECEIVING

encoded = encoded.

Read only

brad_bohn
Active Contributor
0 Likes
1,148

I hope you're not using that method for actual password encryption. Base64 encoding should only be used for data transmission. I think the poster has used the incorrect term, BUT Florian is absolutely right about the hard-wired encryptor method. A child could hack that.

@poster: if you need to encrypt data, then configure and use the SAP Security library. The help files will tell you how to do this.