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

account number

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 08, 2007 at 06:09 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

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.