Skip to Content
-1

Alternative for "CL_ABAP_ELEMDESCR=>GET_DECFLOAT34( )"?

I am working with datatype DF34_RAW AND DF34_DEC which is supported by n75 box, but it is not supported by g00 box. I have a code to get object type for DF34_RAW AND DF34_DEC like:


DATA: LT_DATA_TRANS TYPE REF TO DATA,
DY_LINE_TRANS TYPE REF TO DATA,
STR_TYPE_TRANS TYPE REF TO CL_ABAP_STRUCTDESCR,
TAB_TYPE_TRANS TYPE REF TO CL_ABAP_TABLEDESCR,
LO_DESCR_TRANS TYPE REF TO CL_ABAP_ELEMDESCR,
LT_COMP_TRANS TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE,
LA_COMP_TRANS LIKE LINE OF LT_COMP_TRANS.

FIELD-SYMBOLS: <DYN_TAB_TRANS> TYPE STANDARD TABLE,
<DYN_LINE_TRANS> TYPE ANY,
<DYN_FIELD_TRANS> TYPE ANY.

LO_DESCR_RESULT = CL_ABAP_ELEMDESCR=>GET_DECFLOAT34( ).

LA_COMP_RESULT-NAME = 'ANY_NAME'.
LA_COMP_RESULT-TYPE = LO_DESCR_RESULT. " should not be null
APPEND LA_COMP_RESULT TO LT_COMP_RESULT.

STR_TYPE_RESULT = CL_ABAP_STRUCTDESCR=>CREATE( P_COMPONENTS = LT_COMP_RESULT P_STRICT = ABAP_FALSE ).

* create dynamic table type
TAB_TYPE_RESULT = CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE = STR_TYPE_RESULT
P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
P_UNIQUE = ABAP_FALSE ).
* create dynamic internal table
CREATE DATA LT_DATA_RESULT TYPE HANDLE TAB_TYPE_RESULT.
ASSIGN LT_DATA_RESULT->* TO <DYN_TAB_RESULT>.

* create dynamic line type for iterating over the internal table
CREATE DATA DY_LINE_RESULT LIKE LINE OF <DYN_TAB_RESULT>.
ASSIGN DY_LINE_RESULT->* TO <DYN_LINE_RESULT>.

This is working fine for n75 but i want to use same code for g00 box, but in g00 box it is doesn't allow

LO_DESCR_RESULT = CL_ABAP_ELEMDESCR=>GET_DECFLOAT34( ).

Because the method GET_DECFLOAT34( ) is not present in class CL_ABAP_ELEMDESCR for g00 box.

Is there any other method or way that can give object for DF16_RAW nd DF34_DEC type. Or is there any other way to create dynamic table with data type DF16_RAW nd DF34_DEC?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jun 12, 2018 at 05:25 AM

    Hello Ompal

    decfloat16 and decfloat34 are introduced in ABAP since Release 7.0, EhP2.

    You can not get them on the system lower then Release 7.0, EhP2.

    So if you want them you have to upgrade g00 to higher release.


    Regards

    Tom

    Add comment
    10|10000 characters needed characters exceeded

    • I got the solution

      WHEN '8'. LO_DESCR_RESULT ?= CL_ABAP_ELEMDESCR=>DESCRIBE_BY_NAME( 'INT8' ).
      WHEN 'A'. LO_DESCR_RESULT ?= CL_ABAP_ELEMDESCR=>DESCRIBE_BY_NAME( 'DECFLOAT16' ).
      WHEN 'R'. LO_DESCR_RESULT ?= CL_ABAP_ELEMDESCR=>DESCRIBE_BY_NAME( 'DECFLOAT16' ).
      WHEN 'E'. LO_DESCR_RESULT ?= CL_ABAP_ELEMDESCR=>DESCRIBE_BY_NAME( 'DECFLOAT34' ).
      WHEN 'W'. LO_DESCR_RESULT ?= CL_ABAP_ELEMDESCR=>DESCRIBE_BY_NAME( 'DECFLOAT34' ).

      Now i can compile my code on any of system.

      Thank's buddy