Skip to Content
0
Former Member
Feb 21, 2008 at 11:43 AM

regarding Credit card encryption

47 Views

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