AT LINE SELECTIONの使い方

2598 ワード

AT LINE SELECTIONでレポートの出力時に、ある行をクリックして対応するイベントと位置に応答する
*&---------------------------------------------------------------------*
*& Report  ZTEST_LINE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT  ZTEST_LINE.

*AT LINE-SELECTION , , 。

DATA:SQUARE TYPE I,
     CUBE TYPE I.
START-OF-SELECTION.
FORMAT HOTSPOT."  DO 10 TIMES. SQUARE = SY-INDEX ** 2. CUBE = SY-INDEX ** 3. WRITE:/ SY-INDEX. HIDE:SQUARE,CUBE."HIDE field , sy-linno 
ENDDO.
AT LINE-SELECTION.
  WRITE:SQUARE,CUBE.

* field, , 
DATA:L_MBLNR LIKE MKPF-MBLNR.
DATA:I_MKPF LIKE TABLE OF MKPF WITH HEADER LINE.
START-OF-SELECTION.
FORMAT HOTSPOT."  SELECT MBLNR MJAHR INTO CORRESPONDING FIELDS OF TABLE I_MKPF FROM MKPF. ULINE (29). WRITE:/1 '|',2 'MBLNR',20 '|',21 'MJAHR',29 '|'. LOOP AT I_MKPF. ULINE /(29). WRITE:/1 '|',2 I_MKPF-MBLNR,20 '|',21 I_MKPF-MJAHR,29 '|'. ENDLOOP. ULINE /(29). AT LINE-SELECTION. GET CURSOR FIELD I_MKPF-MBLNR VALUE L_MBLNR. READ TABLE I_MKPF WITH KEY MBLNR = L_MBLNR. IF SY-SUBRC = 0. SET PARAMETER ID 'MBN' FIELD I_MKPF-MBLNR. CALL TRANSACTION 'MB03' AND SKIP FIRST SCREEN. ENDIF.