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

Function FIEB_PASSWORD_ENCRYPT

Former Member
0 Likes
1,477

Hi,

I have a requirement wherein I have a fixed value such as SAP321 as the password. Now I have to encrypt that and store that in the table. For this purpose I am using the function module in the following manner.

DATA V_ENCRYPT TYPE FIEB_ENCRYPTED_PASSWD VALUE 'SAP123'.

data V_NEW_PASS type c.

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

EXPORTING

IM_DECRYPTED_PASSWORD = v_NEW_PASS

IMPORTING

EX_ENCRYPTED_PASSWORD = V_ENCRYPT.

and storing v_NEW_PASS into the table. But I am getting the dump saying

The field "V_NEW_PASS" specified here is a different

field type.

Please suggest the solution.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
780

Hi Ausutosh,

You are getting dump because you are not passing the correct data type and also not passing correct export and import parameter. the export parameter should have V_ENCRYPT instead of V_NEW_PASS.

First of all please declear your variable like this :

Data : V_ENCRYPT TYPE FIEB_DECRYPTED_PASSWD VALUE 'SAP123',

V_NEW_PASS TYPE FIEB_ENCRYPTED_PASSWD.

here you can also pass v_new_pass as 32 char.

then call function module :

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

EXPORTING

IM_DECRYPTED_PASSWORD = V_ENCRYPT

IMPORTING

EX_ENCRYPTED_PASSWORD = V_NEW_PASS.

it will work for you. you can go to se37 also to see the direct result. Please modified your code accordingly.

Regards,

Sourabh

2 REPLIES 2
Read only

Former Member
0 Likes
780

null

Edited by: Sourabh Batwara on Nov 25, 2009 12:36 PM

Edited by: Sourabh Batwara on Nov 25, 2009 12:37 PM

Read only

Former Member
0 Likes
781

Hi Ausutosh,

You are getting dump because you are not passing the correct data type and also not passing correct export and import parameter. the export parameter should have V_ENCRYPT instead of V_NEW_PASS.

First of all please declear your variable like this :

Data : V_ENCRYPT TYPE FIEB_DECRYPTED_PASSWD VALUE 'SAP123',

V_NEW_PASS TYPE FIEB_ENCRYPTED_PASSWD.

here you can also pass v_new_pass as 32 char.

then call function module :

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

EXPORTING

IM_DECRYPTED_PASSWORD = V_ENCRYPT

IMPORTING

EX_ENCRYPTED_PASSWORD = V_NEW_PASS.

it will work for you. you can go to se37 also to see the direct result. Please modified your code accordingly.

Regards,

Sourabh