on 12-29-2006 6:48 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.