cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP routine to remove special character doesn't work in BW Production

0 Kudos
448

Hi All,

we encounter this very strange issue in SAP BW7.50 SP 9, the below abap routine works only in dev and qas but doesn't work in production. The DSO activation has failed today due to this error :Value ' JAB AKAUNTAN NG MALAYSIA' (hex. 'A0004A0041004200200041004B00410055004E00540041004E') of characteristic 0DOC_HD_TXT contains invalid characters. I simulate the same issue in dev and qas, the below logic was able to remove the space but not in production. RSKC has been maintained in all system as ALL_CAPITALS []`{}@#ÁÉ\ÇÚ()-.!®%$""™+,“”/’<ÇÖ !|^~'X*½¾¼'×1234567890º*²:. Is there anywhere i can check in BW setting or SM59 that cause this error to happen only in production?

DATA LV_DESC TYPE /BI0/OIDOC_HD_TXT.

DATA: L_LEN TYPE I,
L_TIME TYPE I,
L_LSTREPL TYPE I.

DATA: L_CHK TYPE C.

MOVE SOURCE_FIELDS-BKTXT TO LV_DESC.
TRANSLATE LV_DESC TO UPPER CASE.
CONDENSE LV_DESC. " remove leading space

L_LEN = STRLEN( LV_DESC ).
L_CHK = 'N'.
L_LSTREPL = -999.

DO L_LEN TIMES.

IF ( L_TIME - L_LSTREPL EQ 1 ).
L_CHK = 'Y'.
ELSE.
L_CHK = 'N'.
ENDIF.

IF L_TIME = 0 OR L_CHK EQ 'Y'.
" First char is ! or # - disallowed
IF LV_DESC+L_TIME(1) = '!' OR LV_DESC+L_TIME(1) = '#'.
LV_DESC+L_TIME(1) = ' '.
L_LSTREPL = L_TIME.
ENDIF.

ELSE.
IF LV_DESC+L_TIME(1) CN
'!"%&''()*+,-./\:;<=>?$^|@{}[]~`#_0123456789ABCDEFGHIJKLMNOPQRSTUVWXY' &
'Zabcdefghijklmnopqrstuvwxyz'
.
LV_DESC+L_TIME(1) = ' '.
ENDIF.
ENDIF.

L_TIME = L_TIME + 1.

ENDDO.

CONDENSE LV_DESC.
RESULT = LV_DESC.

*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "compute_0DOC_HD_TXT

Rgds,

Ester

Accepted Solutions (0)

Answers (3)

Answers (3)

VijayetaSharma
Active Contributor

Hello esterj,

Seems like you are eliminating special characters with your code, instead try allowing selective characters and eliminating rest.

Check out below blog, going over similar scenarios with sample code-

Invalid Character Removal In BW – Different Scenarios

If you find above info helpful, consider up-voting (arrows on left) and accepting (accept button at the bottom) the answer.

Thanks,

Vijayeta

VijayetaSharma
Active Contributor
0 Kudos

Did you get a cahnce to go through the soln mentioned above?

Thanks.

abdullahqureshi
Contributor
0 Kudos

Hello esterj,

Put the Lowercase Letter ticked in your InfoObject setting. I think this will also handle the space issue.


Thanks,

Abdullah

sgassem
Participant
0 Kudos

First, make sure you have ALL_CAPITAL_PLUS_HEX in RSKC.

Also you can benefit using FM 'SCP_REPLACE_STRANGE_CHARS'.