05-14-2020 8:12 AM
I just have this simple line
gwa_list-key = sy-tabix. (the index here were set to last character hence i need to delete leading space)
SHIFT gwa_list-key LEFT DELETING LEADING space.
is it possible to do this in a one liner? i have tried doing CAST but returned - Unexpected operator "CAST".
gwa_list-key = cast #( sy-tabix )
05-14-2020 8:52 AM
Converting to a string should to the trick as your result field is a string/character typed field.
gwa_list-key = conv string( sy-tabix ).
05-14-2020 8:50 AM
Hi
You can use as below
gwa_list-key = sy-tabix.
key2 = conv int2( gwa_list-key ).
This will give result as you expect.
05-14-2020 8:52 AM
Converting to a string should to the trick as your result field is a string/character typed field.
gwa_list-key = conv string( sy-tabix ).
05-15-2020 5:59 PM
05-15-2020 2:13 PM
thank you! i had the incorrect syntax
conv num2( var ) do the trick
05-15-2020 5:58 PM
Moreover, the ABAP documentation uses the term "cast" to cast the type of a variable without changing its value, while the term "conversion" is used to transfer the value of a variable to another variable of a different type by using a conversion.
Hopefully, it's not possible to cast ANY variable to CHAR, for instance internal tables and reference variables cannot be cast.