REPORT ZEXAMPLE.

DATA: WINSYS(20),

OSSYS(20).

START-OF-SELECTION.

CALL FUNCTION 'WS_QUERY'

EXPORTING

QUERY = 'WS'

IMPORTING

RETURN = WINSYS

EXCEPTIONS

INV_QUERY = 1

NO_BATCH = 2

FRONTEND_ERROR = 3

OTHERS = 4.

CALL FUNCTION 'WS_QUERY'

EXPORTING

QUERY = 'OS'

IMPORTING

RETURN = OSSYS

EXCEPTIONS

INV_QUERY = 1

NO_BATCH = 2

FRONTEND_ERROR = 3

OTHERS = 4.

PERFORM WSQUERY_CODE CHANGING WINSYS OSSYS.

WRITE:/ 'RUNNING', WINSYS, 'ON THE', OSSYS, 'OPERATING SYSTEM'.

*&---------------------------------------------------------------------*

*& FORM WSQUERY_CODE

*&---------------------------------------------------------------------*

FORM WSQUERY_CODE CHANGING P_WINSYS

P_OSSYS.

* READABLE TEXTS:

CASE P_WINSYS.

WHEN 'MC'.

P_WINSYS = 'MACINTOSH'.

WHEN 'MF'.

P_WINSYS = 'UNIX'.

WHEN 'NT'.

P_WINSYS = 'WINDOWS NT'.

WHEN 'PM'.

P_WINSYS = 'OS\2'.

WHEN 'WN'.

P_WINSYS = 'WINDOWS 3.XX'.

WHEN 'WN32'.

P_WINSYS = '32-BIT WINDOWS'.

WHEN 'WN32_95'.

P_WINSYS = 'WINDOWS 95'.

WHEN 'WN32_98'.

P_WINSYS = 'WINDOWS 98'.

WHEN OTHERS.

P_WINSYS = 'UNKNOWN'.

ENDCASE.

CASE P_OSSYS.

WHEN 'AIX'.

P_OSSYS = 'AIX'.

WHEN 'DOS'.

P_OSSYS = 'DOS'.

WHEN 'HP-UX'.

P_OSSYS = 'HP-UX'.

WHEN 'MAC'.

P_OSSYS = 'MAC'.

WHEN 'NT'.

P_OSSYS = 'NT'.

WHEN 'OS2' OR 'OS\2'.

P_OSSYS = 'OS\2'.

WHEN 'OSF1'.

P_OSSYS = 'OSF1'.

WHEN 'SINIX'.

P_OSSYS = 'SINIX'.

WHEN 'SUNOS'.

P_OSSYS = 'SUNOS'.

WHEN 'ULTRIX'.

P_OSSYS = 'ULTRIX'.

WHEN 'VMS'.

P_OSSYS = 'VMS'.

WHEN OTHERS.

P_OSSYS = 'UNKNOWN'.

ENDCASE.

ENDFORM. " WSQUERY_CODE