*&---------------------------------------------------------------------*
*& Report ZTR_DEMO_REPORT9 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZTR_DEMO_REPORT8 NO STANDARD PAGE HEADING LINE-SIZE
100 LINE-COUNT 7(3).
TABLES : YEMP , YSAL .
TYPES : BEGIN OF ST_EMP,
EMP_NO TYPE YEMP-EMP_NO,
EMP_NAME TYPE YEMP-EMP_NAME ,
CITY TYPE YEMP-CITY ,
END OF ST_EMP.
DATA : WA_EMP TYPE ST_EMP .
DATA : IT_EMP LIKE STANDARD TABLE OF WA_EMP.
SELECT-OPTIONS : S_EMP_NO FOR YEMP-EMP_NO.
INITIALIZATION .
AT SELECTION-SCREEN.
IF S_EMP_NO-LOW IS INITIAL OR S_EMP_NO-HIGH IS INITIAL.
MESSAGE W001(ZMSG).
ENDIF.
START-OF-SELECTION .
SELECT * FROM YEMP INTO TABLE IT_EMP.
END-OF-SELECTION .
BREAK-POINT .
LOOP AT IT_EMP INTO WA_EMP .
WRITE:/5 WA_EMP-EMP_NO.
HIDE WA_EMP-EMP_NO.
ENDLOOP.
*---AT LINE SELECTION ON SECONDARY LIST WHOSE LIST INDEX IS 1--------
AT LINE-SELECTION.
IF SY-LSIND = 1 .
WINDOW STARTING AT 10 10 ENDING AT 100 50.
LOOP AT IT_EMP INTO WA_EMP
WHERE EMP_NO EQ WA_EMP-EMP_NO.
WRITE :/20 WA_EMP-EMP_NAME .
HIDE WA_EMP-EMP_NO.
HIDE WA_EMP-EMP_NAME.
ENDLOOP.
ENDIF.
IF SY-LSIND = 2 .
WINDOW STARTING AT 10 10 ENDING AT 100 50.
LOOP AT IT_EMP INTO WA_EMP
WHERE EMP_NO EQ WA_EMP-EMP_NO AND
EMP_NAME EQ WA_EMP-EMP_NAME.
WRITE :/20 WA_EMP-CITY .
ENDLOOP.
ENDIF.
TOP-OF-PAGE .
WRITE :/5 'TOP OF PAGE '.
END-OF-PAGE.
SKIP 2 .
WRITE :/5 'END OF PAGE '.
No comments:
Post a Comment