on 03-17-2015 6:11 PM
We have written below abap code to handle invalid char ..
Still I am facing below error while activating DSO. present abap cod is not handling if invalid char are at end of text.
Sample text data from ECC:
KEYBACK DESC: KEYBACK 0S48803 S48K S48 48"" |
LINER, TOP COVER, PLATE,G20-32-BPC RUBBER## |
casques IRIS 2, de couleur VERTE. réf 010110### |
Value " CASQUES IRIS 2, DE COULEUR VERTE RF 05010110 " (HEX 20004300410053005100550045005300200049005200490053) of characteristic 0POSTXT contains an error at position 46
DATA : INT_VAR TYPE /BI0/OIPOSTXT.
DATA : str_var1(60) TYPE c.
DATA : var2 TYPE i.
DATA : var3 TYPE i.
DATA : var4 TYPE i.
DATA : str_var6(60) TYPE c.
DATA : length TYPE i.
MOVE SOURCE_FIELDS-SGTXT TO INT_VAR.
TRANSLATE int_var TO UPPER CASE .
length = STRLEN( int_var ).
DO length TIMES.
IF int_var CN
',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890' .
IF sy-fdpos IS INITIAL.
CLEAR str_var1.
ELSE.
str_var1 = int_var+0(sy-fdpos).
ENDIF.
var2 = STRLEN( int_var ).
var3 = sy-fdpos + 1.
var4 = var2 - var3.
IF var4 EQ 0.
str_var6 = int_var+sy-fdpos.
ELSE.
str_var6 = int_var+var3(var4).
ENDIF.
CONCATENATE str_var1 str_var6 INTO RESULT.
ELSE.
RESULT = int_var.
ENDIF.
int_var = RESULT.
ENDDO.
RESULT = int_var.
please let me know any additional settings required in BW system or modifications of abap code?
HI,
Recently I developed a Character String Cleansing Add-on. There is no need anymore to develop your own logic and maintain it in many Transformations, just use my Add-on with a comprehensive interface and it will solve any problems with invalid characters.
Please have a look at my blog .
Best regards,
Sander
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
below code is working fine
*DATA : INT_VAR TYPE /BI0/OIPOSTXT.
DATA : INT_VAR(50) TYPE c.
DATA : str_var1(60) TYPE c.
DATA : var2 TYPE i.
DATA : var3 TYPE i.
DATA : var4 TYPE i.
DATA : str_var6(60) TYPE c.
DATA : length TYPE i.
MOVE SOURCE_FIELDS-SGTXT TO INT_VAR.
TRANSLATE int_var TO UPPER CASE .
length = STRLEN( int_var ).
*DO length TIMES.
* IF int_var CN
WHILE int_var CN
',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890' .
IF sy-fdpos IS INITIAL.
CLEAR str_var1.
ELSE.
str_var1 = int_var+0(sy-fdpos).
ENDIF.
var2 = STRLEN( int_var ).
var3 = sy-fdpos + 1.
var4 = var2 - var3.
IF var4 EQ 0.
* str_var6 = int_var+sy-fdpos.
CLEAR str_var6.
ELSE.
str_var6 = int_var+var3(var4).
ENDIF.
CONCATENATE str_var1 str_var6 INTO RESULT.
* ELSE.
* RESULT = int_var.
* ENDIF.
int_var = RESULT.
ENDWHILE.
*ENDDO.
RESULT = int_var.
Hi,
add the below statement in the code.
CONDENSE RESULT NO-GAPS.
Thanks,
Phani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added
RESULT = int_var
CONDENSE RESULT NO-GAPS.
is it correct, still I am facing error.
Message no. BRAIN290
Characters that have a hexadecimal display between HEX00 and HEX1F are not
permitted in characteristic values. The character at position 45 is one of these
characters. The value is therefore not permitted.
Note that these characters cannot be displayed and are therefore displayed as
'#'. The actual character '#' has the hexadecimal display HEX23.
Check the origin of the characteristic value. If possible, change the
characteristic value in the source.
Incorrect source text in update routines and transfer routines can also cause
this problem.
even I used below code also at end of my present code, still same error.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
cr_lf
IN
result
WITH
' '
.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
horizontal_tab
IN
result
WITH
' '
.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
vertical_tab
IN
result
WITH
' '
.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
newline
IN
result
WITH
' '
.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
form_feed
IN
result
WITH
' '
.
REPLACE
ALL OCCURRENCES OF
cl_abap_char_utilities=>
backspace
IN
result
WITH
' '
.
Hi Suneel,
Try this:
DATA : INT_VAR TYPE /BI0/OIPOSTXT.
DATA : length TYPE i.
DATA : num type i.
MOVE SOURCE_FIELDS-SGTXT TO INT_VAR.
TRANSLATE int_var TO UPPER CASE .
num = 0.
length = STRLEN( int_var ).
DO length TIMES.
IF int_var+num(1) CN
',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890'.
int_var+num(1) = ''.
ENDIF.
num = num + 1.
ENDDO.
condense int_var NO-GAPS.
RESULT = int_var.
Just post here for any queries..
Regards,
Loed
Hi,
A modification on Loed's code could be using the standart RSKC_CHAVL_OF_IBOJ_CHECK function. In the do statement of Loed's code, you can code:
data: infoobject type RSD_IOBJNM,
l_d_index type sy_index,
l_d_char type c.
do length times.
l_d_index = sy_index.
l_d_char = INT_VAR+l_d_index.
call function 'RSKC_CHAVL_OF_IBOJ_CHECK'
Exporting
i_chavl = i_d_char
i_iobjname = infoobject
exceptions
chavl_not_allowed = 1.
if sy_subrc NE 0.
INT_VAR+l_d_index(1) = space.
endif.
This will always behave acording to the setting on accepted characters. When there is a character not accepted (with tcode RSKC), thiss code will change that character as space. If you require anything else you can change the "space" part of the code.
Hope it gives an idea
Regards
Yasemin...
Hi,
Below issue cause of HEXA decimal places at position 46. system does not undersatand the hexa decimal places.
we are also not find the HEXA decimal palces - some times it will give the sapce issue.
-Phani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume your last character is a space... I don't see anything in your logic to remove it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.