Skip to Content
author's profile photo Former Member
Former Member

regarding Credit card encryption

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 11:46 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 12:57 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.