Skip to Content
0
Sep 10, 2014 at 07:13 AM

String templates

371 Views

I just played around with the string tempülates now available in one of our updated systems. So i tried

type_descr = cl_abap_typedescr=>describe_by_data( s ).

CASE type_descr->type_kind.

WHEN cl_abap_typedescr=>typekind_time.
r = |{ s time = user }|.

Where s is an importing parameter of a method having type CLIKE

but i got the error "Format directive TIME cannot be used on the embedded expression".

Inserting a helping variable

ltime type t

and

ltime=s;

r = |{ ltime time = user }|.

solves this, but thats exactly what i want to avoid: a helping variable just for type casting

Is there no way to solve this without a helping variable?

Please don't give hints to use concatenate or write into, i know these and i know how to use this. My intention is to get experience with string templates.