Advertising:
Value (ABAP keyword): Difference between revisions
From SAP Knowledge Base
(3 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
fldate = '20171219' ] OPTIONAL ). | fldate = '20171219' ] OPTIONAL ). | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Without optional and no row is | Without optional and no row is found, the exception cx_sy_itab_line_not_found is thrown. | ||
= Get field of single row = | = Get field of single row = | ||
Line 17: | Line 17: | ||
fldate = '20171219' ]-price OPTIONAL ). | fldate = '20171219' ]-price OPTIONAL ). | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Without optional and no row is | Without optional and no row is found, the exception cx_sy_itab_line_not_found is thrown. | ||
= Append row to table = | = Append row to table = | ||
Line 28: | Line 28: | ||
<syntaxhighlight lang="abap" line copy> | <syntaxhighlight lang="abap" line copy> | ||
flights_carrid_aa = VALUE #( FOR <flight> IN flights WHERE (carrid = 'AA' ) | flights_carrid_aa = VALUE #( FOR <flight> IN flights WHERE (carrid = 'AA' ) | ||
( price = <flight>-price ) ). | ( price = <flight>-price ) ). | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 02:01, 27 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 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 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 ) ).
Construct an internal table
flights_carrid_aa = VALUE #( FOR <flight> IN flights WHERE (carrid = 'AA' )
( price = <flight>-price ) ).