Advertising:
Value (ABAP keyword): Difference between revisions
From SAP Knowledge Base
(Created page with "category: keywords = Get single row = <syntaxhighlight lang="abap" line copy> "sflight is an internal table of table sflight DATA(single_row) = VALUE #( sflight[ carrid = 'AA' connid = '0017' fldate = '20171219' ] OPTIONAL ). </syntaxhighlight> Without optional and no row is not found, the exception cx_sy_itab_line_not_found is thrown. = Get field of single row = <syntaxhighlight lang="abap"...") |
|||
| Line 19: | Line 19: | ||
Without optional and no row is not found, the exception cx_sy_itab_line_not_found is thrown. | Without optional and no row is not found, the exception cx_sy_itab_line_not_found is thrown. | ||
= | = Append row to table = | ||
<syntaxhighlight lang="abap" line copy> | <syntaxhighlight lang="abap" line copy> | ||
APPEND VALUE #( price = 123 ) TO lt_sflight. | APPEND VALUE #( price = 123 ) TO lt_sflight. | ||
Revision as of 15:37, 21 December 2024
Get single row
"sflight is an internal table of table sflight
DATA(single_row) = VALUE #( sflight[ carrid = 'AA'
connid = '0017'
fldate = '20171219' ] OPTIONAL ).
Without optional and no row is not found, the exception cx_sy_itab_line_not_found is thrown.
Get field of single row
"sflight is an internal table of table sflight
DATA(single_row_field) = VALUE #( sflight[ carrid = 'AA'
connid = '0017'
fldate = '20171219' ]-price OPTIONAL ).
Without optional and no row is not found, the exception cx_sy_itab_line_not_found is thrown.
Append row to table
APPEND VALUE #( price = 123 ) TO lt_sflight.
lt_sflight = VALUE #( BASE lt_sflight ( price = 123 ) ).
FOR
flights_carrid_aa = VALUE #( FOR <flight> IN flights WHERE (carrid = 'AA' ) ( price = <flight>-price ) ).
