‎2016 Aug 16 12:18 PM
Hi,
I'm note sure if I found here a bug or if I have a made a mistake:
I have a table with object references and want to check if a specific version is "dirty" (changed).
(I know that the table is a standard table, but in my case there won't be enough entries in this table to cause a performance problem)
With 7.50 the "Object Component Selector After Table Expressions" was added, but it seams, that if it is used within a VALUE Operator the Syntax check doesn't allow it.
According to the documentation: "A component addressed in this way can, depending on its design, be used in all suitable operand positions", this should work (at least from my point of view).
I hope somebody can help me with this, maybe ?
CLASS lcl_model DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-DATA gt_versions TYPE STANDARD TABLE OF REF TO lcl_model WITH DEFAULT KEY.
DATA mv_version TYPE i READ-ONLY.
DATA mv_is_dirty TYPE abap_bool READ-ONLY.
CLASS-METHODS is_dirty
IMPORTING iv_version TYPE i
RETURNING VALUE(rv_is_dirty) TYPE abap_bool.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_model IMPLEMENTATION.
METHOD is_dirty.
"1. this works
TRY.
rv_is_dirty = gt_versions[ table_line->mv_version = iv_version ]->mv_is_dirty.
CATCH cx_sy_itab_line_not_found ##NO_HANDLER.
ENDTRY.
"2. this doesn't
rv_is_dirty = VALUE #( gt_versions[ table_line->mv_version = iv_version ]->mv_is_dirty OPTIONAL ).
ENDMETHOD.
ENDCLASS.
Br Amadeus
‎2016 Sep 21 8:37 AM
Hello,
This restriction was a kind of lapse in development and wasn't documented in 7.50.
The restriction is now documented in SP01 for the upcoming 7.51 (unfortunately, correction close was before the lapse was reported).
The restriction is removed in the Release following 7.51 (that will be 7.52).
Horst
(if you really want to have it patched, you have to open a ticket ...)
‎2016 Aug 16 12:33 PM
To make a long thing shorter:
DATA itab TYPE TABLE OF REF TO i.
DATA(test1) = itab[ 1 ]->*.
DATA(test2) = VALUE #( itab[ 1 ]->* OPTIONAL ). "Syntax error
From my point of view it should work, -> forwarded to development.
Horst
‎2016 Sep 21 8:37 AM
Hello,
This restriction was a kind of lapse in development and wasn't documented in 7.50.
The restriction is now documented in SP01 for the upcoming 7.51 (unfortunately, correction close was before the lapse was reported).
The restriction is removed in the Release following 7.51 (that will be 7.52).
Horst
(if you really want to have it patched, you have to open a ticket ...)