인터널테이블
에 반영(저장)한다.데이터를 추가로 저장하는 명령어는
APPEND
인터널테이블
의 몇 번째 인덱스를 바꾸고 지나가야 하는가?SY-TABIX
MODIFY
가 실행된다.TRANSPORTING
에도 변경할 데이터를 가진 필드명을 적어주어야 한다.IF <조건1>.
ELSEIF <조건2>.
ELSEIF <조건3>.
...
ELSE <조건N>.
ENDIF.
MODIFY
의 위치에 주의 : LOOP
연산 안에 포함시킨다.AND
, OR
연산이 가능하다.DATA : gs_sfli TYPE sflight,
gt_sfli LIKE TABLE OF gs_sfli.
CLEAR : gs_sfli.
REFRESH : gt_sfli.
*3)
SELECT carrid connid fldate price currency planetype
seatsmax seatsocc paymentsum seatsmax_b seatsocc_b
seatsmax_f seatsocc_f
INTO CORRESPONDING FIELDS OF TABLE gt_sfli
FROM sflight.
*4)
LOOP AT gt_sfli INTO gs_sfli.
*5, 6)
gs_sfli-planetype = 'A380'.
gs_sfli-seatsocc = 9310.
gs_sfli-fldate = '20230710'.
MODIFY gt_sfli FROM gs_sfli INDEX sy-tabix.
ENDLOOP.
BREAK-POINT.
*1, 2)
DATA : gs_sbook TYPE sbook,
gt_sbook LIKE TABLE OF gs_sbook.
CLEAR : gs_sbook.
REFRESH : gt_sbook.
*3)
SELECT carrid connid fldate bookid customid
custtype invoice class
INTO CORRESPONDING FIELDS OF TABLE gt_sbook
FROM sbook
WHERE carrid = 'DL'
AND custtype = 'P'
AND order_date = '20201227'.
*4)
LOOP AT gt_sbook INTO gs_sbook.
IF gs_sbook-smoker EQ 'X' OR gs_sbook-invoice EQ 'X'.
gs_sbook-class = 'F'.
MODIFY gt_sbook FROM gs_sbook INDEX sy-tabix
TRANSPORTING class.
ENDIF.
ENDLOOP.
*1)
DATA : BEGIN OF gs_fli,
carrid TYPE scarr-carrid,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom,
airpto TYPE spfli-airpto,
cityto TYPE spfli-cityto,
END OF gs_fli,
*2)
gt_fli LIKE TABLE OF gs_fli.
CLEAR : gs_fli.
REFRESH : gt_fli.
*3)
SELECT a~carrid a~carrname
b~connid b~countryfr b~cityfrom b~airpto
INTO CORRESPONDING FIELDS OF TABLE gt_fli
FROM scarr AS a
INNER
JOIN spfli AS b
ON a~carrid = b~carrid
WHERE a~carrid IN ('AA','AZ','DL').
*4)
LOOP AT gt_fli INTO gs_fli.
IF gs_fli-cityfrom EQ 'ROME'.
gs_fli-cityfrom = 'SEOUL'.
ENDIF.
*5)
IF gs_fli-cityto = 'FRANKFURT'.
gs_fli-airpto = 'INCHEON'.
ENDIF.
ENDLOOP.
cl_demo_output=>display( gt_fli ).