on 06-04-2010 8:21 AM
Hi
this programme functioned, but it deleted only the first characteristic forbidden and I want deleted all characteristic forbidden.
I do not know how to calculate the length of the word and make a loop to delete all characteristic forbidden.
*******************************************************************************
DATA : INT_VAR TYPE /BIC/OIMATER.
DATA : VAR2 TYPE I.
DATA : VAR3 TYPE I.
DATA : STR_VAR1(20) TYPE C.
DATA : VAR4 TYPE I.
DATA : STR_VAR6(20) TYPE C.
clear INT_VAR.
clear VAR2.
clear VAR3.
clear STR_VAR1.
clear VAR4.
clear STR_VAR6.
MOVE SOURCE_FIELDS-/BIC/MATER TO INT_VAR.
TRANSLATE INT_VAR TO UPPER CASE .
IF INT_VAR CN
',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890'.
VAR2 = STRLEN( INT_VAR ).
VAR3 = SY-FDPOS + 1.
VAR4 = VAR2 - VAR3.
STR_VAR6 = INT_VAR+VAR3(VAR4).
CONCATENATE STR_VAR1 STR_VAR6 INTO RESULT.
ELSE.
RESULT = INT_VAR.
ENDIF.
*******************************************************************************
best regard
francoise
try this...(adapt according to the chars you need to replace)
data:
w_str type string value '!@#$%^&*()asfdfagfh'.
w_count type i,
w_len type i,
w_off type i.
w_len = strlen( w_str ).
do w_len times.
w_char = w_str+w_off(1).
if w_char CA '!@#$%^&*()_+{}[]?/><'.
replace w_char with space into w_str.
endif.
add 1 to w_off.
condense w_str no-gaps.
enddo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try using
REPLACE
ALL OCCURRENCES OF ' -' IN w_var WITH ''.
condense w_var no-gaps.
-Vikram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I know about the SCP_REPLACE_STRANGE_CHARS function module.. but it replaced by "L"
francoise
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.