‎2009 Nov 25 6:41 AM
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.
‎2009 Nov 25 7:05 AM
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
‎2009 Nov 25 6:59 AM
null
Edited by: Sourabh Batwara on Nov 25, 2009 12:36 PM
Edited by: Sourabh Batwara on Nov 25, 2009 12:37 PM
‎2009 Nov 25 7:05 AM
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