on 01-08-2007 5:34 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.