cancel
Showing results for 
Search instead for 
Did you mean: 

account number

Former Member
0 Kudos

Hi,

I have one account number for every account number this length should be checked.for this i wrote

fldlen = strln(account number).

next i want this account number format like 'XXXXXXX1234'.

I.E.after length checking if that account number is 10 digits then first 6 digits as X's and remaining 4 digits as number.

Can any one give me the idea.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

fldlen = strlen(accountnumber).

IF fldlen = 10.

CONCATENATE 'XXXXXX' accountnumber+6(4) INTO accountnumber.

ELSE.

ENDIF.

Hope this helps you.

Reward points if this solves ur problem.

Former Member
0 Kudos

fldlen is not exactly 10 digits.it can be 11 digits,any number of digits between 1 to 18.

Former Member
0 Kudos

Hi,

Please let me know if the length is equla to 10 then you have to make first six digits as X, right? If so teh above logic will work.

Otherwise let me know exactly what you want.

If it is 18 then how it should get dispalyed?

Former Member
0 Kudos

I think u have to write a logic for this.

It goes some thing like this

1. Find the field length

2. then once u found the field lenght, u have to loop that many times and each time concatenate an 'X' to a varible.

3. Once the loop is completed concatenate this varible with no u want.

Try in this way.

Regards

Former Member
0 Kudos

see I have a filed account number.

every time i need to check length of that field and i want that account number to be display as last digits of that account number as numbers as it is.and remaining all digits as X's.

Former Member
0 Kudos

see I have a filed account number.

every time i need to check length of that field and i want that account number to be display as last 4 digits of that account number as numbers as it is.and remaining all digits as X's.

Former Member
0 Kudos
data : account_no(16) type c.
data : cross(16) type c.
data : howmany type i.
account_no = '1234567890'.

howmany = strlen( account_no ) - 4.
cross = 'xxxxxxxxxxxxxxxx'.


OVERLAY account_no WITH cross(howmany) only account_no.

write: account_no.
Former Member
0 Kudos

Hi,

Try this code this will solve ur problem

REPORT yjjtest MESSAGE-ID zm.

DATA: v_len(2) TYPE n,
      V_number(20) TYPE c,
      V_number1(20) TYPE c,
      V_number2(20) TYPE c,
      v_numc(2) TYPE n.
PARAMETER p_numb(20) TYPE C.

v_len = strlen( p_numb ).
v_numc = v_len - 4.

CLEAR v_number.
DO v_numc TIMES.
CONCATENATE 'X' v_number1 INTO v_number.
v_number1 = v_number.
ENDDO.

v_number2 = p_numb+v_numc(4).

CONCATENATE v_number1 v_number2 INTO v_number.
write:/ v_number.