SAP/실전
[실전 연습] Selection - Option_ Internal table에서 사용하는 방법
Sally_민지
2023. 1. 29. 13:58
최초 작성일: 23년 1월 29일
최종 작성일: 23년 1월 29일
목적: 특정 조건에 맞는 데이터를 출력하는 경우, range 통해서 조건값을 주자. range통해서 조건값 줄때 쓰는 기능인 selection - option 이해하기.
문제의 코드
DATA: gr_erdat type range of vbak-erdat.
gr_erdat = VALUE #(
( SIGN = 'I' OPTION = 'BP' high = '2017.01.01' low = '2017.01.01' ) ). " -> 여기서 sign, option, high가 이해 되지 않음
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_itab FROM vbak
WHERE erdat IN gr_erdat.
-> 2017.01.01 ~ 2017.01.01 사이의 값을 포함 시킨다는 의미
SIGN : 포함 혹은 배제 선택
- I for 'Inclusive'
- E for 'Exclusive'
OPTION : LOW와 HIGH에서 받은 값을 어떻게 처리할 것인지 선택
- EQ for eqaul
- BT for between .... and ...
- CP for Contains Pattern
- LE for Less than or Equal
- GE for Greater thand of Equal
- NE for not equal to
- NB for not between ... and ...
- NP for not contains pattern
- GT for Greater than
- LT for Less Than
LOW: low 입력값
- the comparison value
- with BT, this is the lower limit of the range
HIGH : high 입력값
- with BT and NB, the higher limit of the range
출처:ABAP - RANGES를 이용해서 SELECT-OPTIONS 만들어 사용하기 (tistory.com)