๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿง‘‍๐Ÿ’ผ SAP/ABAP

[SAP ABAP] INTO CORRESPONDING FIELDS OF TABLE๊ณผ INTO TABLE ์ฐจ์ด์ , ์˜ˆ์ œ

by Jay Din 2024. 7. 10.
728x90
๋ฐ˜์‘ํ˜•

์š”์•ฝ

INTO CORRESPONDING FIELDS OF TABLE ๊ณผ INTO TABLE ์€ ABAP์—์„œ SQL SELECT ๋ฌธ์„ ์‚ฌ์šฉํ•  ๋•Œ ๋ฐ์ดํ„ฐ๋ฅผ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์— ๋„ฃ๋Š” ๋ฐฉ๋ฒ•์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

  INTO CORRESPONDING FIELDS OF TABLE INTO TABLE
๊ณตํ†ต์  ํ•„๋“œ ์ด๋ฆ„๊ณผ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”๊ณผ ์ผ์น˜ํ•ด์•ผ ํ•จ
์ฐจ์ด์  ์„ ํƒํ•œ ํ•„๋“œ๋งŒ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์— ๋งคํ•‘ํ•  ๋•Œ ์‚ฌ์šฉ ๋ชจ๋“  ํ•ƒ๋ฅด๋ฅผ ํฌํ•จํ•œ ์ „์ฒด ํ…Œ์ด๋ธ” ์กฐํšŒํ•  ๋•Œ ์‚ฌ์šฉ

 

 

์˜ˆ์ œ

INTO TABLE ์˜ˆ์ œ

DATA: lt_sflight TYPE TABLE OF sflight.

SELECT *
  INTO TABLE lt_sflight
  FROM sflight
  WHERE carrid = 'LH'.
  • SFLIGHT ํ…Œ์ด๋ธ”์˜ ๋ชจ๋“  ํ•„๋“œ๋ฅผ lt_sflight ํ…Œ์ด๋ธ”์— ๊ทธ๋Œ€๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ํ•„๋“œ ์ด๋ฆ„๊ณผ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ์ •ํ™•ํžˆ ์ผ์น˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

INTO CORRESPONDING FIELDS OF TABLE ์˜ˆ์ œ

TYPES: BEGIN OF TY_SFLIGHT,
         CARRID TYPE SFLIGHT-CARRID,
         CONNID TYPE SFLIGHT-CONNID,
         FLDATE TYPE SFLIGHT-FLDATE,
       END OF TY_SFLIGHT.

DATA: LT_SFLIGHT TYPE TABLE OF TY_SFLIGHT.

SELECT CARRID CONNID FLDATE
  INTO CORRESPONDING FIELDS OF TABLE LT_SFLIGHT
  FROM SFLIGHT
  WHERE CARRID = 'LH'.
  • SFLIGHT ํ…Œ์ด๋ธ”์—์„œ carrid, connid, fldate ํ•„๋“œ๋งŒ ์„ ํƒํ•˜์—ฌ lt_sflight ํ…Œ์ด๋ธ”์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์„ ํƒ๋œ ํ•„๋“œ์˜ ์ด๋ฆ„๊ณผ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ty_sflight์™€ ์ •ํ™•ํžˆ ์ผ์น˜ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

 

 

 

728x90
๋ฐ˜์‘ํ˜•