May 2019
Beginner to intermediate
548 pages
12h 39m
English
SQL expression introduced the ability to add, for example, arithmetic calculations or case to SELECT.
The first example involves creating the case. In code, you need to add the case after the list of fields, the list of conditions, and the name of the field where the result is shown.
In the following example, use a case in the carrid field. When a field in the entry is equal to AA, a field named flag will be X; if carrid is not equal to AA, the flag field is empty:
SELECT mandt, carrid, connid, countryfr, countryto, CASE carrid WHEN 'AA' THEN 'X' ELSE ' ' END AS flag FROM spfli INTO TABLE @DATA(lt_spfli).
To create the calculation, you need to create the new field with the result of the calculation. In the following example, ...
Read now
Unlock full access