代码语言:javascript复制
COND:
DATA(time) = COND string(
WHEN sy-timlo < '120000' THEN |{ sy-timlo TIME = ISO } AM|
WHEN sy-timlo > '120000' THEN |{ CONV t( sy-timlo - 12 * 3600 ) TIME = ISO } PM|
WHEN sy-timlo = '120000' THEN |High Noon|
ELSE THROW cx_cant_be( ) ).
Switch:
DATA(number) = SWITCH string( sy-index
WHEN 1 THEN 'one'
WHEN 2 THEN 'two'
WHEN 3 THEN 'three'
ELSE THROW cx_overflow( ) ).