Skip to Content

VALUE iterator for range, get low and high?

Trying to use VALUE iterator to create a table from a range of type vbeln. When option = 'BT', how can I add the low AND high values to the expression? The below code gets the low, and I tried using COND inside the VALUE to act on 'BT', but there I'm still only able to pass one argument, so I can't get the high value. Any help is appreciated!

DATA: lrt_so TYPE RANGE OF vbak-vbeln,
      lr_so LIKE LINE OF lrt_so.
SELECT-OPTIONS o_so FOR lr_so.
---
  TYPES: BEGIN OF ty_result,
           so       TYPE vbak-vbeln,
           shipment TYPE vttk-tknum,
           invoice  TYPE vbrk-vbeln,
         END OF ty_result,
         ty_results_t TYPE TABLE OF ty_result WITH DEFAULT KEY.
---
DATA(lt_results) = VALUE ty_results_t(
  FOR ls_so IN o_so
  ( so = COND vbeln(
    WHEN ls_so-option = 'EQ' THEN ls_so-low
    ELSE ls_so-high )
  )
).
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 21, 2017 at 04:49 PM

    Another VALUE operator behind ELSE to construct what you want there? Or a LET expression at an appropriate position.

    Not easy to answer, since it is not clear what you want to achieve, but I´m sure it´s possible. Think how you would do it with statements and translate to nested expressions.

    Add comment
    10|10000 characters needed characters exceeded