Routine CALL FUNCTION 'ZFM_ELIMINATE_INVALID_CHARS' EXPORTING I_VALUE = SOURCE_FIELDS-SGTXT I_INFOOBJECT = '0POSTXT' IMPORTING O_VALUE = RESULT. Create New FM SE37 FUNCTION ZFM_ELIMINATE_INVALID_CHARS. *"---------------------------------------------------------------------*"*"Local Interface: *" IMPORTING *" REFERENCE(I_VALUE) *" REFERENCE(I_INFOOBJECT) *" EXPORTING *" REFERENCE(O_VALUE) *"---------------------------------------------------------------------DATA: length TYPE I, index TYPE I, current_char TYPE C, result(60) TYPE C, infoobject TYPE RSD_IOBJNM. CLEAR: result, infoobject. MOVE I_VALUE TO result. MOVE I_INFOOBJECT TO infoobject. * TRANSLATE result TO UPPER CASE. length = strlen( result ). index = -1. DO length TIMES. index = index + 1. current_char = result+index(1). CALL FUNCTION 'RSKC_CHAVL_OF_IOBJ_CHECK' EXPORTING I_CHAVL = current_char I_IOBJNM = infoobject * I_S_COB_PRO = * I_T_COB_PRO_CMP = EXCEPTIONS CHAVL_NOT_ALLOWED = 1. IF SY-SUBRC <> 0. MOVE ' ' TO result+index(1). ENDIF. ENDDO. MOVE result TO O_VALUE. ENDFUNCTION. *"---------------------------------------------------------------------- DATA: a TYPE c LENGTH 000050. DATA: l_len TYPE i, l_time TYPE i. MOVE source_fields-sgtxt TO a. TRANSLATE a TO UPPER CASE. l_len = strlen( a ). DO l_len TIMES. IF a+l_time(1) CN ',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890' . a+l_time(1) = '!'. ENDIF. l_time = l_time + 1. ENDDO. REPLACE ALL OCCURRENCES OF '!' IN a WITH space. CONDENSE a. result = a.