Does abap have any method to perform an inline cast for char types (or any similar types of different length)? Perhaps there is something similar to value
operator( for structures) that can be used for fields.
Concrete example (name
is of type tdobname
, which is char 70 and ebeln
is char 10) that leads to a dump due to type mismatch:
call function 'READ_TEXT'
exporting
id = lv_textid
language = sy-langu
name = ls_ekko-ebeln
object = 'EKKO'
tables
lines = lt_textlines
For now I added an line of conversion to a variable of destination type (which works), but I am hoping to skip that step.
data: lv_name type tdobname.
lv_name = ls_ekko-ebeln.
call function 'READ_TEXT'
exporting
...
name = lv_name
...
Use CONV operator for that:
DATA(lv_name) = CONV tdobname( ls_ekko-ebeln ).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With