cancel
Showing results for 
Search instead for 
Did you mean: 

account number

Former Member
0 Kudos

Hi,

I have one issue like onr field account number(zbnkn) of 18 charecters.I want that account number as if account number is 8 charecters for one vendor then that should be printed like 1234XXXX.If that acount number is 9 digits then 12345XXXX.

so every time I have to calculate length of that account number and last 4 digits should be printed as 4 X's.

Can any one help me out in this.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

data: account like kna1-kunnr.

data: account1 like account.

data: n type i.

account = 'PRABHU'.

n = strlen( account ).

n = n - 3.

account1 = account.

account1+n(3) = 'XXX'.

<b>Then Close this Thread</b>

Regards

prabhu

Message was edited by:

Prabhu Peram

Former Member
0 Kudos

Hi Prabu,

I did same but it is giving dump as

unable to print 110099B as a number.

account number value is 110099B.

n is of type what?

Former Member
0 Kudos
try this if it can help u 


REPORT ychatest LINE-SIZE 350.

DATA : BEGIN OF itab OCCURS 0,
         account(8),
       END OF itab.

DATA : len TYPE i,
       len1 TYPE i.

itab-account = '1234'.
APPEND itab.
CLEAR itab.

LOOP AT itab.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = itab-account
    IMPORTING
      output = itab-account.
  len = STRLEN( itab-account ).
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
      input  = itab-account
    IMPORTING
      output = itab-account.
  len1 = STRLEN( itab-account ).
  len1 = len - len1.
  DO len1 TIMES.
    CONCATENATE itab-account 'X' INTO itab-account.
  ENDDO.
  MODIFY itab TRANSPORTING account.
  WRITE / itab-account.
  CLEAR itab.
ENDLOOP.

Please post the solution so that we will be able to know that

Message was edited by:

Chandrasekhar Jagarlamudi

Former Member
0 Kudos

Thanks.

I got it.