Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

String templates

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>