Skip to Content

How to avoid the special char in sap bi 7.3

Hi all,

Now loading data form ECC system to DSO,but i wrote some formulas in transformation level but getting same errors.

avoid the errors please suggest me any code at transformation level?

ex- ÇÉÀÇÊÈÏÌÅÉÒÙÁÍÓÚÑÑÈÍÌÓÒÚÙÉÈÍÌÓÒÚÙ·.'#

"COMPANY X FOR # SALES".

instead of editing the PSA data provide the simple ABAP logic asap.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    Sep 18, 2013 at 07:07 AM

    Hi Shabnam & kalpana,

    please find the below code it will work, below code change the source field name which field you required. ex- RESULT = SOURCE_FIELDS-STUDENTEMAILID.

    i applied same code, it is working......



    DATA: l_d_length like sy-index.
    DATA: l_d_offset LIKE sy-index.

    DATA: CharAllowedUpper(60) TYPE C.
    DATA: CharAllowedLower(60) TYPE C.
    DATA: CharAllowedNumbr(60) TYPE C.
    DATA: CharAllowedSondr(60) TYPE C.
    DATA: CharAllowedAll(240) TYPE C.



    CharAllowedUpper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÜÖ'.
    CharAllowedLower = 'abcdefghijklmnopqrstuvwxyzäüöß'.
    CharAllowedNumbr = '0123456789'.

    CharAllowedSondr = '!"§$%&/()=?{[]}\u00B4`*+~;:_,.-><|@'''.

    CONCATENATE CharAllowedUpper CharAllowedLower CharAllowedNumbr
    CharAllowedSondr INTO CharAllowedAll.

    RESULT = SOURCE_FIELDS-STUDENTEMAILID.
    l_d_length = strlen( RESULT ).

    IF NOT RESULT CO CharAllowedAll.

    DO l_d_length TIMES.

    l_d_offset = sy-index - 1.



    IF NOT RESULT+l_d_offset(1) CO CharAllowedAll.

    RESULT+l_d_offset(1) = ''.
    CONDENSE RESULT NO-GAPS.

    ENDIF.

    ENDDO.

    endif.

    CONDENSE RESULT NO-GAPS.
    TRANSLATE RESULT TO UPPER CASE.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 17, 2013 at 11:50 AM

    Hi phani,

    lots of discussed thread and docs are available. by going thru you can solve it. pls always do the search and help yourself.

    Time being pls go thru below one.

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0cdc928-5e2d-2e10-e1bb-ec77bcb5cbfd?quicklink=index&overridelayout=true

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2013 at 11:55 AM

    Hi Kodanda

    You can write field, start/end routine to remove invalid character by below routine. Both code can be used to remove invalid characters through routine. Try in field routine anf execute it in test mode you can see invalid characters are removed.

    Sample code 1:

    DATA: L_USER_ALLOWED_CHAR TYPE RSALLOWEDCHAR,
    input(200) type c,
    output(200) type c,
    addchar type c,
    L_ALL_ALLOWED_CHAR(140) TYPE C,
    L_RESULT_STR_LEN TYPE I,
    L_STR_INCREMENT TYPE I.
    CONSTANTS C_SAP_ALLOWED_CHAR(58) TYPE C VALUE
    ' !"%&''()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.Input = SOURCE_FIELDS-BSTKD.

    IF L_ALL_ALLOWED_CHAR IS INITIAL.
    SELECT SINGLE * FROM RSALLOWEDCHAR
    INTO L_USER_ALLOWED_CHAR
    WHERE ALLOWKEY = 'S'.
    CONCATENATE C_SAP_ALLOWED_CHAR
    L_USER_ALLOWED_CHAR-ALLOWCHAR
    INTO L_ALL_ALLOWED_CHAR.
    ENDIF.

    TRANSLATE input TO UPPER CASE.
    L_RESULT_STR_LEN = STRLEN( input ).
    L_STR_INCREMENT = 0.
    WHILE L_STR_INCREMENT LE L_RESULT_STR_LEN.
    IF NOT input+L_STR_INCREMENT(1) CO L_ALL_ALLOWED_CHAR.
    input+L_STR_INCREMENT(1) = ''.
    else.
    addchar = input+L_STR_INCREMENT(1).
    CONCATENATE output addchar into output.

    ENDIF.
    ADD 1 TO L_STR_INCREMENT.
    ENDWHILE.* outputchar = input.

    Sample code 2

    RESULT = SOURCE_FIELDS-PABLA.
    TRANSLATE RESULT USING 'ĄAąaÓOóoĆCćcĘEęeŚSśsŻZİIÖOöo'.
    TRANSLATE RESULT TO UPPER CASE.
    CONDENSE RESULT.

    WHILE RESULT CN
    ' !"%&''()*ŹŠÔ,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabc'.
    RESULT+SY-FDPOS(1) = ' '.
    CONDENSE RESULT.
    ENDWHILE.


    IF RESULT(1) = '#'.
    RESULT(1) = ' '.
    CONDENSE RESULT.
    ENDIF.

    Regards

    Shabnam

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2013 at 11:56 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 18, 2013 at 09:38 AM

    Hi

    Not sure if I understood you correctly Do you want to allow those characters? Then just add them in Tx RSKC in BW and they will not throw an error with those characters.

    If you want to remove it you need an abap routine.

    hope that clarifies

    Martin

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Kodanda,

      Please once check in table RSALLOWEDCHAR whether those specials characters are present or not.

      Whenever you give special symbols in RSKC table , those will be added in the RSALLOWEDCHAR .

      Please once check it.

      I think RSALLOWEDCHAR should resolve ur issue....

  • Sep 18, 2013 at 11:47 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 26, 2013 at 09:50 AM

    Hi kodanda,

    Try this

    DATA: STR TYPE string.

    DATA: lv_data type string.

    DATA: nLength type i.

    DATA: cTemp type string.

    clear: lv_data,cTemp.

    if SOURCE_FIELDS-{source field} <> ''.

    lv_data = SOURCE_FIELDS-{source field}.

    translate lv_data to UPPER CASE.

    nLength = strlen( lv_data ).

    do nLength times.

    subtract 1 from nLength.

    if 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-' cs lv_data+nLength(1).

    concatenate lv_data+nLength(1) cTemp into cTemp.

    endif.

    enddo.

    RESULT = cTemp.

    else.

    RESULT = SOURCE_FIELDS-{source field}.

    endif.

    Use source field name instead of {source field}.

    'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-'

    only which are available within this, will be filled into the result, rest special characters will be restricted.

    you can mention which character you need in that.

    Regards

    Anish

    Add comment
    10|10000 characters needed characters exceeded