DATA:
lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY,
l_tzone TYPE tznzone.
" get time zone for plant
SELECT SINGLE land1, regio FROM t001w
WHERE werks = @pa_werks
INTO ( @DATA(l_land1), @DATA(l_regio) ).
IF sy-subrc = 0.
IF l_regio IS INITIAL.
" determine timezone without region
SELECT tzone FROM ttz5 WHERE land1 = @l_land1
INTO TABLE @lt_tzone.
ELSE.
" determine timezone with region
SELECT tzone FROM ttz5s WHERE
land1 = @l_land1 AND
bland = @l_regio AND
tzonedft = 'X'
INTO TABLE @lt_tzone.
ENDIF.
IF lines( lt_tzone ) > 0.
SORT lt_tzone. " ensure stable result
l_tzone = lt_tzone[ 1 ].
ENDIF.
ENDIF.
IF sy-subrc <> 0.
l_tzone = 'CET'.
ENDIF.