You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe the coding is not the ideal way for the conversion, but the cleaner leads to an initial value.
The sql statement is used to read a float value. In this example, the value is a characteristic in the format date. Therefore, the float value is to be converted into a date field.
For this purpose, a second variable lv_numc8 is used because a direct conversion from float to date is not possible. First, the float value is converted into the variable lv_numc8. In the second step, the numeric value is converted into the date variable. For convenience, this is in one line.
DATA lv_numc8 TYPE n LENGTH 8.
DATA lv_datum TYPE datum.
SELECT SINGLE
FROM ausp
FIELDS atflv
WHERE objek = @lv_objek
AND atinn = @lv_atinn
INTO @DATA(lv_float_value).
IF sy-subrc = 0.
lv_datum = lv_numc8 = lv_float_value.
ENDIF.
thanks very much for this example! That was indeed not correctly considered yet, so I guess we must change the cleanup rule "Resolve equals sign chain into several commands" to never repeat the final term, but instead to always do the assignments step by step:
" input:
a = b = c= d= <any term>.
" output: d= <any term>.
c= d.
b = c.
a = b.
okay, with the next release, this cleanup rule will now always make sure that all conversion steps are kept. This is also true if the rightmost term is a literal:
Hello,
Maybe the coding is not the ideal way for the conversion, but the cleaner leads to an initial value.
The sql statement is used to read a float value. In this example, the value is a characteristic in the format date. Therefore, the float value is to be converted into a date field.
For this purpose, a second variable lv_numc8 is used because a direct conversion from float to date is not possible. First, the float value is converted into the variable lv_numc8. In the second step, the numeric value is converted into the date variable. For convenience, this is in one line.
Using the cleaner the result looks like this:
In this particular case, where there is an assignment with different formats, the value is lost.
The text was updated successfully, but these errors were encountered: