‎2005 Sep 22 3:36 PM
hi folks,
I am reading a field value from a table into a variable that goes like '345-7890123<b>-</b>' there is this '-' after the number and need to remove it.
How can I use 'trim' here?
Thanks
Vinu
‎2005 Sep 22 3:39 PM
‎2005 Sep 22 3:38 PM
‎2005 Sep 22 3:39 PM
‎2005 Sep 22 3:46 PM
‎2005 Sep 22 3:56 PM
Hi
DATA: dir(40) VALUE '345-7890123-1'.
DO.
REPLACE '-' WITH space INTO dir.
IF sy-subrc <> 0. EXIT. ENDIF.
ENDDO.
CONDENSE dir no-gaps.
WRITE dir.
Max
‎2005 Sep 22 4:03 PM
‎2005 Sep 22 4:55 PM
TRANSLATE variable USING '- '.
CONDENSE variable NO-GAPS.
Do you want to remove all the '-' or just the last one? If it is just the last one, then
v_len = STRLEN( variable ).
v_len = v_len -1.
variable = variable(v_len).