Which Netweaver version do I need for BASE CORRESPONDING?

Viewed 126

I have the following piece of code.

REPORT zzz.

CLASS lcl_main DEFINITION FINAL CREATE PRIVATE.
  PUBLIC SECTION.
    CLASS-METHODS:
      main.
ENDCLASS.

CLASS lcl_main IMPLEMENTATION.
  METHOD main.
    DATA:
      lt_t100 TYPE t000_t,
      ls_t000_template TYPE t000.
    
    lt_t100 = VALUE #( BASE ( CORRESPONDING #( ls_t000_template ) ) cccategory = 'P' ).
    lt_t100 = VALUE #( BASE lt_t100
      ( VALUE #( BASE ( CORRESPONDING #( ls_t000_template ) ) cccategory = 'E' ) )
    ).
  ENDMETHOD.
ENDCLASS.

In the editor it looks like it should be compilable, because everything is highlighted in a right way.

Coding in the editor

Even though this does not compile. My assumption here is that I do not have high enough a version of the SAP Netweaver.

Compilation errors

Which version at least do I need to make this code compile?

2 Answers

Thanks to Philipp's comment I realised that I was doing it completely wrong.

Here is the right syntax that compiles flawlessly.

REPORT zzz.

CLASS lcl_main DEFINITION FINAL CREATE PRIVATE.
  PUBLIC SECTION.
    CLASS-METHODS:
      main.
ENDCLASS.

CLASS lcl_main IMPLEMENTATION.
  METHOD main.
    DATA:
      lt_t100 TYPE t000_t,
      ls_t000_template TYPE t000.

    lt_t100 = VALUE #( ( VALUE #( BASE CORRESPONDING #( ls_t000_template ) cccategory = 'P' ) ) ).
    lt_t100 = VALUE #( BASE lt_t100
      ( VALUE #( BASE CORRESPONDING #( ls_t000_template ) cccategory = 'E' ) )
      ( VALUE #( BASE CORRESPONDING #( ls_t000_template ) cccategory = 'C' ) )
      ( VALUE #( BASE CORRESPONDING #( ls_t000_template ) cccategory = 'D' ) )
      ( VALUE #( BASE CORRESPONDING #( ls_t000_template ) cccategory = 'S' ) )
    ).
  ENDMETHOD.
ENDCLASS.
Related