reyemsaibot

SAP BI Blog about SAP BW/4HANA, Analysis for Office and SAP HANA - by Tobias Meyer

SAP BW ABAP remove symbols

From time to time it happens that the source system delivers special characters and the Business Warehouse system can not handle it. So the
loading process may be crashed.

 

One solution is the following ABAP code:

 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
DATA:
  zeichen(1) TYPE c,
  muster(2) TYPE c,
  field TYPE c LENGTH 000060.
  field = SOURCE_FIELDS-YYSTREET.

DO.
  IF field CO ' !"%&()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜßabcdefg' && 'hijklmnopqrstuvwxyzäöü '.
    EXIT.
  ELSE.
    zeichen = field+sy-fdpos(1).
    muster+0(1) = zeichen.
    muster+1(1) = space.
    TRANSLATE field USING muster.
  ENDIF.

ENDDO.

RESULT = field.

author.


I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

Kommentare

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert