ABAP – Removing the last character from a string

data: var1 type string,

      str_len type i. 
var1 = 'abc1234f'.

str_len = STRLEN( var1 ).  //” str_len = 8.”

str_len = str_len – 1.       // “str_len = 8 – 1 =7.”

var1 = var1+0(str_len).  // “var1 = abc1234″  . ” f ”  is removed.

 

Explanation:

var1+0(str_len) means var1 starting location 0, number of character is str_len.

1,e; Characters from 0 to 7.

So the string is abc1234.

0 Comments

Leave A Reply