Application Development 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: 

regarding Credit card encryption

Former Member
0 Kudos

Hi ,

I have a requirement where i m encrypting credit card number using Function module CCARD_ENVELOPE

So in this function module the exporting parameter I am able

to get HASHVALUE but i m unable to get data in TBIN(It contains encrypted data).

Below i m providing my code.

<code>

&----


*& Report Z_TEST_CREDIT_CARD

*&

&----


*&

*&

&----


REPORT Z_TEST_CREDIT_CARD.

TABLES FPLTC.

DATA : SECURE_CCARD_BIN TYPE CCARDEC_S_BIN,

SECURE_CCARD_ACTIVE TYPE XFELD,

XFPLTC TYPE TABLE OF FPLTC,

WA_FPLTC TYPE FPLTC,

ccnum like FPLTC-CCNUM.

SELECT-OPTIONS: S_FPLNR FOR FPLTC-FPLNR.

*

SELECT * FROM FPLTC INTO TABLE XFPLTC

WHERE FPLNR IN S_FPLNR AND

( CCARD_GUID EQ SPACE OR

CCARD_GUID IS NULL ).

*

LOOP AT XFPLTC INTO WA_FPLTC.

CALL FUNCTION 'CCARD_ENVELOPE'

EXPORTING

IM_CCNUM = WA_FPLTC-CCNUM

IMPORTING

EX_CCARD_BIN = SECURE_CCARD_BIN

EXCEPTIONS

ENVELOPE_FAILED = 1

OTHERS = 2.

WRITE:/ SECURE_CCARD_BIN-HASH_VALUE.

CALL FUNCTION 'CCARD_DEVELOPE'

EXPORTING

IM_CCARD_BIN = SECURE_CCARD_BIN

IMPORTING

EX_CCNUM = ccnum

EXCEPTIONS

DEVELOPE_FAILED = 1

OTHERS = 2.

IF SY-SUBRC = 0.

WRITE:/ ccnum.

ENDIF.

endloop.

</code>

regards,

satish

3 REPLIES 3

Former Member
0 Kudos

Check this way...

LOOP AT XFPLTC INTO WA_FPLTC.

CALL FUNCTION 'CCARD_ENVELOPE'

EXPORTING

IM_CCNUM = WA_FPLTC-CCNUM

IMPORTING

EX_CCARD_BIN = SECURE_CCARD_BIN

EXCEPTIONS

ENVELOPE_FAILED = 1

OTHERS = 2.

WRITE:/ SECURE_CCARD_BIN-HASH_VALUE.

CALL FUNCTION 'CCARD_DEVELOPE'

EXPORTING

IM_CCARD_BIN = SECURE_CCARD_BIN-HASH_VALUE

IMPORTING

EX_CCNUM = ccnum

EXCEPTIONS

DEVELOPE_FAILED = 1

OTHERS = 2.

IF SY-SUBRC = 0.

WRITE:/ ccnum.

ENDIF.

endloop.

0 Kudos

Hi Ramesh,

I have tried the code but as its a structure so ,

in the exporting parameter w cant pass only the hash value field.

Its going to dump. Can you give me any solution.

Thanks,

satish

Former Member
0 Kudos

i am unable to find the FM in my system... Please check or else try in debugging mode what exactly is happening.