Code: Alles auswählen.
IF counter <op1> <green>.
lv_image = 'ICON_GREEN_LIGHT'.
ELSEIF counter <op2> <red>.
lv_image = 'ICON_RED_LIGHT'.
ELSE.
lv_image = 'ICON_YELLOW_LIGHT'.
ENDIF.
Code: Alles auswählen.
concatenate counter <op1> <green> into <if_string_green> SEPARATED BY ' '.
concatenate counter <op2> <red> into <if_string_red> SEPARATED BY ' '.
IF <if_string_green>.
lv_image = 'ICON_GREEN_LIGHT'.
ELSEIF <if_string_red>
lv_image = 'ICON_RED_LIGHT'.
ELSE.
lv_image = 'ICON_YELLOW_LIGHT'.
ENDIF.
Weil der (hier rote) Punkt fehlt.TZI hat geschrieben:Der zweite versuch folgendermassen:-> Fehler: Fehlerhafter Logischer ausdruckCode: Alles auswählen.
concatenate counter <op1> <green> into <if_string_green> SEPARATED BY ' '. concatenate counter <op2> <red> into <if_string_red> SEPARATED BY ' '. IF <if_string_green>. lv_image = 'ICON_GREEN_LIGHT'. ELSEIF <if_string_red>[b][color=#FF0000].[/color][/b] lv_image = 'ICON_RED_LIGHT'. ELSE. lv_image = 'ICON_YELLOW_LIGHT'. ENDIF.
Code: Alles auswählen.
RANGES green for counter.
ranges red for counter.
green-sign = 'I'.
green-option = 'LT'.
green-low = 100.
append green.
red-sign = 'I'.
red-option = 'GE'.
red-low = 101.
append red.
if counter in green.
lv_image = 'ICON_GREEN_LIGHT'.
elseif counter in red.
lv_image = 'ICON_RED_LIGHT'.
...
endif.
Code: Alles auswählen.
data green type i value 10.
data yellow type i value 30.
if counter < green.
lv_image = 'GREEN'.
elseif counter < yellow.
lv_image = 'YELLOW'.
else.
lv_image = 'RED'.
endif.
Code: Alles auswählen.
DATA: BEGIN OF ls_green,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE zportfostatxt-gruen,
high TYPE zportfostatxt-gruen,
END OF ls_green.
DATA: lt_green LIKE STANDARD TABLE OF ls_green.
DATA: BEGIN OF ls_red,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE zportfostatxt-rot,
high TYPE zportfostatxt-rot,
END OF ls_red.
DATA: lt_red LIKE STANDARD TABLE OF ls_red.
ls_green-sign = 'I'.
ls_green-option = <op1>.
ls_green-low = <green>.
ls_green-high = <green>.
CALL METHOD -> zum austauschen der Operatoren (<= -> LE)
APPEND ls_green TO lt_green.
ls_red-sign = 'I'.
ls_red-option = <op2>.
ls_red-low = <red>.
ls_red-high = <red>.
CALL METHOD -> zum austauschen der Operatoren (<= -> LE)
APPEND ls_red TO lt_red.
IF counter IN lt_green.
lv_image = 'ICON_GREEN_LIGHT'.
ELSEIF counter IN lt_red.
lv_image = 'ICON_RED_LIGHT'.
ELSE.
lv_image = 'ICON_YELLOW_LIGHT'.
ENDIF.