Saturday, November 22, 2014

Replace/Remove Specified Characters From String

DATA legal_chars TYPE string
      VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.,-*_!?'.
DATA lv_char_value(255)" give max length

lv_char_value gv_string.
CHECK NOT lv_char_value CO legal_chars ).

lv_length strlengv_string ).

DO lv_length TIMES.
  lv_i sy-index 1.
  IF NOT lv_char_value+lv_i(1CO legal_chars.
    "We get the illegal char , do what you want
    lv_char_value+lv_i(1' '.
  ENDIF.
ENDDO.

CLEAR gv_string.
gv_string lv_char_value.

8 comments:

  1. After reading this post I got an idea about on this note.Really something grate in this article ,Thanks for sharing this. We are providing SAP courses training online. After reading this slightly am changed my way of introduction about my training to people. To know more Visit Us SAP PM Online Training Course

    ReplyDelete
  2. Nice Article.This information useful to Learners. We are providing Best SAP ABAP Online Training. for more Visit SAP ABAP Online Training

    ReplyDelete
  3. We provide sap abap technical course, call us to know more about us and join with us.
    Call them at 8122241286 in chennai.
    www.thecreatingexperts.com

    ReplyDelete
  4. I have been a blogger too but you post much technical details. Thank you for sharing your knowledge. The creating experts was my first trainer in SAP ABAP got in depth learning from them

    http://thecreatingexperts.com/sap-abap-training-in-chennai/


    contact +91-08122241286

    ReplyDelete
  5. SAP ABAP training is provided in CHENNAI.

    THE CREATING EXPERTS is one of the leading trainer in SAP who provides real time training

    http://thecreatingexperts.com/sap-abap-training-in-chennai/

    contact 8122241286

    ReplyDelete