‎2011 Sep 08 8:22 AM
HI All,
I am trying to create data type time and I have error,
the value is ls_abap_field_desc-type = T
How can i overcome this issue,and what I doing wrong ?
CREATE DATA lv_field_type TYPE (ls_abap_field_desc-type) LENGTH ls_prop-length.Regards
Joy
‎2011 Sep 08 9:20 AM
Hello Joy,
You're getting this error because of the 'T' data type. You cannot use LENGTH addition with 'T' ABAP type, it can be used for C,N,P & X types only.
BR,
Suhas
‎2011 Sep 08 9:20 AM
Hello Joy,
You're getting this error because of the 'T' data type. You cannot use LENGTH addition with 'T' ABAP type, it can be used for C,N,P & X types only.
BR,
Suhas
‎2011 Sep 08 1:32 PM
HI Suhas,
Thanks,
Assume that i have <lv_field_type> that is type any and are getting every time different type ,and i want to use the STRLEN ,
how can analyze in order to prevent dump.
Best regards
Joy
‎2011 Sep 08 1:50 PM
Hello,
A small code snippet to help you out:
PARAMETERS: p_type TYPE typename OBLIGATORY,
p_len TYPE i DEFAULT 8.
DATA: go_typedescr TYPE REF TO cl_abap_typedescr,
gv_dref TYPE REF TO data.
* Get the type reference of the i/p type
go_typedescr = cl_abap_typedescr=>describe_by_name( p_type ).
CASE go_typedescr->type_kind.
WHEN
cl_abap_typedescr=>typekind_num OR "Numeric
cl_abap_typedescr=>typekind_packed OR "Packed
cl_abap_typedescr=>typekind_char OR "Character
cl_abap_typedescr=>typekind_hex. "Hex
CREATE DATA gv_dref TYPE (go_typedescr->type_kind) LENGTH p_len.
WHEN OTHERS.
CREATE DATA gv_dref TYPE (go_typedescr->type_kind).
ENDCASE.Hope this helps.
BR,
Suhas
‎2011 Sep 08 2:59 PM
HI Suhas,
Thanks you very much its help ,
I had another question assume i have field with name phone and i want to ask that if phone = phone1
this will work with abap true .
the phone is variable and can be any name the only difference is the number after it and i guess that
Regax will help like the following but i am not sure how to use it with varibale that can be phone address
e.g. if address = address99 etc
FIND REGEX '^([[:digit:]]+)$'Warm Regards
Joy