Abap选择屏幕笔记(一)

*&---------------------------------------------------------------------*
*& Report Z_SCREEN_1
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_screen_1.
TABLES: zemployees2.

DATA: my_employees LIKE zemployees2-eenum.
*PARAMETERS: my_ee    LIKE zemployees-eenum,
PARAMETERS: my_ee LIKE zemployees2-eenum DEFAULT '20000001' OBLIGATORY,
*            my_fname   LIKE zemployees2-SURNAME,
*           my_numbr TYPE i,

             "复选框
*            my_chkb AS CHECKBOX,
             "单选框
*            my_green RADIOBUTTON GROUP grp1,
*           my_blue RADIOBUTTON GROUP grp1,
*            my_red RADIOBUTTON GROUP grp1,
             "下拉菜单
            my_g  LIKE zemployees2-gender.

* 选择范围的语法规则,有扩展
* SELECT-OPTIONS my_dob for zemployees2-dob.

* 选择范围的语法规则,没有扩展
SELECT-OPTIONS my_dob FOR zemployees2-dob NO-EXTENSION.

INITIALIZATION.

START-OF-SELECTION.

  DATA tb1 LIKE TABLE OF zemployees2. "定义内表
  DATA tb2 TYPE zemployees2.          "定义结构体

  SELECT * FROM zemployees2
  INTO TABLE tb1
  WHERE eenum = my_ee.

  IF sy-subrc = 0.

    LOOP AT tb1 INTO tb2.
      WRITE: tb2-surname.
    ENDLOOP.

 ENDIF.
* my_employees = zemployees2-eenum.
*  IF  zemployees2-dob IN my_dob.
*    WRITE: 'HELLO'.
*  ENDIF.
* ENDSELECT.

*T SELECTION-SCREEN ON my_ee.
* IF  my_ee > my_employees.
* ENDIF.