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

[SAP ABAP] ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”(Internal Table)์ด๋ž€?

by Jay Din 2023. 8. 24.
728x90
๋ฐ˜์‘ํ˜•

์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”(Internal Table)

์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”(Internal Table)์€ ํ”„๋กœ๊ทธ๋žจ ๋‚ด์—์„œ ์ •์˜ํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Local Table์ž…๋‹ˆ๋‹ค.

ABAP ํ”„๋กœ๊ทธ๋žจ์—์„œ ๊ฐ•๋ ฅํ•œ ๊ธฐ๋Šฅ๊ณผ ํŽธ์˜์„ฑ์„ ์ œ๊ณตํ•˜๋Š” ๊ฒƒ ๋‘ ๊ฐ€์ง€๋ฅผ ๋ฝ‘์œผ๋ผ๋ฉด ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”๊ณผ ๋””๋ฒ„๊น…์ด๋ผ๊ณ  ์ฃผ์ €ํ•˜์ง€ ์•Š๊ณ  ๋Œ€๋‹ตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

ํŠนํžˆ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์˜ ๊ธฐ๋Šฅ๊ณผ ์—ญํ• ์„ ABAP ํ”„๋กœ๊ทธ๋ž˜๋ฐ์˜ ๊ฝƒ์ด๋ผ๊ณ  ํ•ด๋„ ๊ณผ์–ธ์ด ์•„๋‹™๋‹ˆ๋‹ค.

์ด ๋‘ ๊ฐ€์ง€ ๊ธฐ๋Šฅ๋งŒ ์•Œ๊ณ  ์žˆ์–ด๋„, Copy & Paste๋กœ ABAP ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค์–ด ๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(๋‹ค๋ฅธ ์–ธ์–ด๋กœ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ํ•ด๋ณธ ์‚ฌ๋žŒ์ด๋ผ๋ฉด).

 

C์™€ ABAP ์ฐจ์ด์ 

๋จผ์ €, ABAP ํ”„๋กœ๊ทธ๋žจ๊ณผ C์–ธ์–ด์˜ ๊ตฌ์กฐ์ฒด ๊ฐœ๋…๋ถ€ํ„ฐ ์ดํ•ดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ธ์‚ฌ ์ •๋ณด๋Š” ์‚ฌ์› ๋ฒˆํ˜ธ, ์ด๋ฆ„, ์†Œ์† ๋“ฑ์ด ์žˆ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์•„๋ž˜์— C์–ธ์–ด์™€ ABAP ์–ธ์–ด์—์„œ ์‚ฌ์› ์ •๋ณด๋ฅผ ๊ฐ€์ง€๋Š” ๊ตฌ์กฐ๋ฅผ ์„ ์–ธํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

C์–ธ์–ด์—์„œ๋Š” STRUCT ๊ตฌ๋ฌธ์„ ์ด์šฉํ•˜์—ฌ ๊ตฌ์กฐ์ฒด๋ฅผ ์„ ์–ธํ•œ๋‹ค๋Š” ์  ์ด์™ธ์—๋Š” ABAP ์–ธ์–ด์™€ ํฐ ์ฐจ์ด๊ฐ€ ์—†๊ณ  ์‚ฌ์šฉ๋ฒ•๋„ ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

 

Structure(๊ตฌ์กฐ์ฒด) ๋น„๊ต

// C ์–ธ์–ด์—์„œ์˜ ๊ตฌ์กฐ์ฒด ์„ ์–ธ
STRUCT s_type
{
	CHAR no[6];
    CHAR name[10];
    CHAR part[16];
};
STRUCT s_type sawon;

// ABAP์—์„œ์˜ ๊ตฌ์กฐ์ฒด ์„ ์–ธ
DATA: BEGIN OF s_type,
    NO(6)	TYPE C,
    NAME(10)	TYPE C,
    PART(16)	TYPE C,
END OF s_type.
  C ์–ธ์–ด ABAP ์–ธ์–ด
์„ ์–ธ STRUCT ๊ตฌ์กฐ์ฒด { }; DATA ๊ตฌ์กฐ์ฒด TYPE ๊ตฌ์กฐ์ฒด ํƒ€์ž…
DATA ๊ตฌ์กฐ์ฒด LIKE OBJ.
DATA BEGIN OF ๊ตฌ์กฐ์ฒด ~ END OF.
๊ฐ’ ํ• ๋‹น sawon.name = 'Kim' sawon-name = 'Kim'
๊ฐ’ ์‚ฌ์šฉ PRINTF('%s', sawon.name) WRITE sawon-name.

 

์œ„ ๊ตฌ์กฐ์ฒด ์„ ์–ธ๊ณผ ํ‘œ์—์„œ ์•Œ ์ˆ˜ ์žˆ๋“ฏ์ด ๋ชจ๋“  ์–ธ์–ด์˜ ๊ตฌ์กฐ์ฒด ์„ ์–ธ๋ฒ•์€ ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

์šฐ์„  ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์„ ์–ธํ•˜๊ณ  ๋‚˜์„œ ๊ตฌ์กฐ์ฒด ๋ณ€์ˆ˜๋ฅผ ์„ ์–ธํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋‹จ์ง€, ๊ธฐ๊ณ„์–ด ์ฝ”๋“œ๋ฅผ ํ”„๋กœ๊ทธ๋ž˜๋จธ๊ฐ€ ์‰ฝ๊ฒŒ ์•Œ์•„๋ณผ ์ˆ˜ ์žˆ๋„๋ก ๋ฒˆ์—ญํ•˜๋Š” ๊ณผ์ •์—์„œ ์–ธ์–ด๋งˆ๋‹ค ๋‹ค๋ฅธ ๊ตฌ๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ์ฐจ์ด๋งŒ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ตฌ์กฐ์ฒด๋Š” ์‚ฌ์› 1๋ช…์˜ ๊ฐ’๋งŒ ํ• ๋‹นํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‚ฌ์› 1๋ช…์œผ๋กœ ์ด๋ฃจ์–ด์ง„ ํšŒ์‚ฌ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š๋“ฏ์ด ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•˜์—ฌ ์—ฌ๋Ÿฌ ๋ช…์˜ ์‚ฌ์›์„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ ‡๋‹ค๋ฉด, ์—ฌ๋Ÿฌ ๋ช…์˜ ์‚ฌ์› ์ •๋ณด๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ABAP์˜ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”(C ์–ธ์–ด์—์„œ์˜ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด) ๊ตฌ์กฐ๋Š” ์–ด๋– ํ•œ์ง€ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

๋ฐ˜์‘ํ˜•

 

Structure(๊ตฌ์กฐ์ฒด) ๋ฐฐ์—ด๊ณผ Internal Table

// C ์–ธ์–ด์—์„œ์˜ ๊ตฌ์กฐ์ฒด ์„ ์–ธ
STRUCT s_type
{
	CHAR no[6];
    CHAR name[10];
    CHAR part[16];
};
STRUCT s_type sawon[100];

// ABAP์—์„œ์˜ ๊ตฌ์กฐ์ฒด ์„ ์–ธ
TYPE: BEGIN OF s_type,
    NO(6)	TYPE C,
    NAME(10)	TYPE C,
    PART(16)	TYPE C,
END OF s_type.
    
DATA sawon TYPE STANDARD
	TABLE OF s_type INITIAL SIZE 100.
DATA sawon TYPE t_type.
  C ์–ธ์–ด ABAP ์–ธ์–ด
์„ ์–ธ STRUCT ๊ตฌ์กฐ์ฒด[๊ฑด์ˆ˜] { }; DATA ํ…Œ์ด๋ธ”๋ช… TYPE ํ…Œ์ด๋ธ” ํƒ€์ž…
INITIAL SIZE ๊ฑด์ˆ˜.
๊ฐ’ ํ• ๋‹น sawon[1].name = 'Kim';
sawon[2].name = 'Lee'
sawon-name = 'Kim'.
APPEND sawon.
sawon-name = 'Lee'.
APPEND sawon.
๊ฐ’ ์‚ฌ์šฉ PRINTF('%s', sawon[1].name)
PRINTF('%s', sawon[2].name)
LOOP AT sawon.
  WRITE sawon-name.
ENDLOOP.

 

๊ตฌ์กฐ์ฒด ์„ ์–ธ๊ณผ ์œ ์‚ฌํ•˜๊ฒŒ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”(๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด)๋„ ๋‘ ์–ธ์–ด ์‚ฌ์ด์— ํฐ ์ฐจ์ด๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.

๋‹ค๋งŒ, ๊ฐ’์„ ํ• ๋‹นํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” ๊ตฌ๋ฌธ์˜ ์ฐจ์ด๊ฐ€ ์žˆ์„ ๋ฟ์ž…๋‹ˆ๋‹ค.

C์–ธ์–ด์˜ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด์€ ๋ฐฐ์—ด ์ˆœ๋ฒˆ์„ ์ง€์ •ํ•˜์—ฌ ๊ฐ’์„ ํ• ๋‹นํ•˜์—ฌ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด ABAP ์–ธ์–ด์˜ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์€ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด(ARRAY)์˜ ๊ฐœ๋…์„ ๋ชจ๋‘ ์ง€์›ํ•˜๋ฉฐ ์ถ”๊ฐ€๋กœ ์‹ค์ œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ…Œ์ด๋ธ”์˜ ๋ชจ์Šต๊ณผ ์œ ์‚ฌํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌํ˜„๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

C ์–ธ์–ด์—์„œ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰ํ•˜๋ฉด Array ๊ตฌ์กฐ๊ฐ€ ์ด๋ฏธ ๋ฉ”๋ชจ๋ฆฌ์— Load๋˜์–ด 100๊ฑด์˜ ์‚ฌ์› ์ •๋ณด ๋ฐฉ์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

sawon-name[1]๋ฒˆ ๋ฐฉ, [2]๋ฒˆ ๋ฐฉ, [3]๋ฒˆ ๋ฐฉ๊ณผ ๊ฐ™์ด ์ด๋ฏธ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ์ƒ์„ฑ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ ๋ฉ”๋ชจ๋ฆฌ์˜ ์œ„์น˜์— ๊ฐ’๋งŒ ํ• ๋‹นํ•˜๋ฉด ๋˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ABAP ํ”„๋กœ๊ทธ๋žจ์—์„œ๋„ C์–ธ์–ด์™€ ์œ ์‚ฌํ•˜๊ฒŒ ๋ฐฐ์—ด ์ˆœ๋ฒˆ์„ ์ง€์ •ํ•˜์—ฌ ๊ฐ’์„ ๋””๋ฒ„๊น… ๋ชจ๋“œ์—์„œ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

C์–ธ์–ด๊ฐ€ ๋ฐฐ์—ด์„ ์„ ์–ธํ•  ๋•Œ ๋ฏธ๋ฆฌ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•˜๋Š” ๋ฐ˜๋ฉด, ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์€ INITIAL SIZE๊ตฌ๋ฌธ์œผ๋กœ ํ…Œ์ด๋ธ” ํฌ๊ธฐ๋งŒ ์„ ์–ธํ•  ๋ฟ ๋ฏธ๋ฆฌ ๋ฉ”๋ชจ๋ฆฌ์— Loadํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ INSERT ๋˜๋Š” APPEND ๊ตฌ๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ Line์ด ์ถ”๊ฐ€๋  ๋•Œ๋งˆ๋‹ค ๋ฉ”๋ชจ๋ฆฌ์— Loadํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ธก๋ฉด์—์„œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ๋™์ ์ธ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด(Dynamic Data Object)์ด๋ผ๊ณ ๋„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

  • Internal Table์€ ๋™์ ์ธ ๊ตฌ์กฐ์ฒด ๋ฐฐ์—ด(Dynamic Data Object)์ด๋‹ค.
  • INITIAL SIZE ๊ตฌ๋ฌธ์€ ์‹ค์ œ๋กœ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์„ ํ• ๋‹นํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์˜ˆ์•ฝ(RESERVE)์„ ํ•œ๋‹ค.

์ฒ˜์Œ ABAP์„ ์ ‘ํ•˜๊ฒŒ ๋˜๋ฉด sawon-name = 'kim'. ๋งŒ ์„ ์–ธํ•˜๊ณ  ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์— ๊ฐ’์ด ์—†๋‹ค๊ณ  ๋ถˆํ‰์„ ํ„ธ์–ด๋†“๋Š” ๊ฒฝํ—˜์„ ํ•œ ๋ฒˆ์ฏค ํ•˜๊ฒŒ ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

ABAP ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์—์„œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์€ ํ•ญ์ƒ ํ• ๋‹น๊ณผ ์ถ”๊ฐ€(APPEND) ๊ตฌ๋ฌธ์ด ์Œ์œผ๋กœ ์›€์ง์—ฌ์•ผ ํ•จ์„ ๋ช…์‹ฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์ด ํฌํ•จํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐ์ดํ„ฐ ๊ฑด์ˆ˜๋Š” ๋ฉ”๋ชจ๋ฆฌ ํฌ๊ธฐ๋กœ ํ•œ์ •๋˜์–ด ์žˆ์œผ๋ฉฐ, SAP ์„ค์น˜ ์‹œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์ด ์ฐจ์ง€ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์„ ๊ธฐ๋ณธ 2 Gigabyte๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

 

Local Table Type์„ ์ด์šฉํ•œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ์ƒ์„ฑ

๊ฐœ๋ณ„ ABAP ํ”„๋กœ๊ทธ๋žจ์—๋งŒ ์‚ฌ์šฉ๋˜๋Š” ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋Š” ๊ฒฝ์šฐ์— ์ฃผ๋กœ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ฒซ ๋ฒˆ์งธ ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์„ ์–ธํ•˜๊ณ , ๋‘ ๋ฒˆ์งธ ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์ฐธ๊ณ ํ•˜๋Š” ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ํƒ€์ž…์„ ์„ ์–ธํ•˜๊ณ , ์„ธ ๋ฒˆ์งธ ์ด ํƒ€์ž…์„ ์ฐธ๊ณ ํ•˜์—ฌ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

1. ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์„ ์–ธ

TYPES: BEGIN OF t_str,
	~~~
    END OF t_str

2. ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์ฐธ๊ณ ํ•˜๋Š” ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ํƒ€์ž… ์„ ์–ธ

TYPES t_itab TYPE STANDARD TABLE OF t_str
	WITH	{UNIQUE|NON-UNIQUE} KEY <keys>
    INITIAL SIZE 100.

3. ํƒ€์ž… ์ฐธ๊ณ ํ•˜์—ฌ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ์ƒ์„ฑ

DATA: gt_itab TYPE t_itab [WITH HEADER LINE].

 

๋ฐ˜์‘ํ˜•

 

์˜ˆ์ œ

์‹ค๋ฌด์—์„œ๋Š” ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์„ ์–ธํ•˜๊ณ , ์ด ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์ฐธ๊ณ ํ•˜๋Š” ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์„ ์–ธํ•˜๋Š” 2๋‹จ๊ณ„ ๋ฐฉ๋ฒ•์„ ๋งŽ์ด ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ฆ‰, 3๋‹จ๊ณ„๋ฅผ ํ†ตํ•ด ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์—์„œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ํƒ€์ž…์„ ์„ ์–ธํ•˜๋Š” ๋‘ ๋ฒˆ์งธ ๋‹จ๊ณ„๋ฅผ ์ƒ๋žตํ•˜๊ณ , ๊ตฌ์กฐ์ฒด ํƒ€์ž…์„ ์ฐธ๊ณ ํ•˜์—ฌ ๋ฐ”๋กœ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

TYPES: BEGIN OF S_TYPE,
  NO(6) TYPE C,
  NAME(4) TYPE C,
  PART(16)  TYPE C,
  END OF S_TYPE.

DATA GT_ITAB TYPE STANDARD TABLE OF S_TYPE WITH NON-UNIQUE KEY NO WITH HEADER LINE.

GT_ITAB-NO = '0001'.
GT_ITAB-NAME = 'Lee'.
GT_ITAB-PART = 'SAP Team'.
APPEND GT_ITAB.

LOOP AT GT_ITAB.
  WRITE : GT_ITAB-NO, GT_ITAB-NAME, GT_ITAB-PART.
ENDLOOP.

 

์•„๋ž˜์™€ ๊ฐ™์ด ๊ตฌ์กฐ์ฒด๋ฅผ ์„ ์–ธํ•œ ๋‹ค์Œ ๊ตฌ์กฐ์ฒด๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์„ ์–ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ฒฝ์šฐ์—๋Š” TYPE ๋Œ€์‹ ์— LIKE๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

DATA GT_ITAB LIKE STANDARD TABLE OF S_TYPE WITH NON-UNIQUE KEY NO WITH HEADER LINE.

 

Global ABAP Dictionary Type์„ ์ด์šฉํ•œ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” ์ƒ์„ฑ

ABAP Dictionary ํ…Œ์ด๋ธ”์ด๋‚˜ ๊ตฌ์กฐ์ฒด๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

DATA: itab TYPE <t_itab> WITH {UNIQUE|NON-UNIQUE} KEY <keys> [INITIAL SIZE <n>] [WITH HEADER LINE].

์˜ˆ์ œ

REPORT ZABAP001 .

DATA GT_ITAB TYPE SORTED TABLE OF SCARR WITH UNIQUE KEY CARRID.
DATA GS_STR LIKE LINE OF GT_ITAB.

SELECT * INTO TABLE GT_ITAB
  FROM SCARR.

LOOP AT GT_ITAB INTO GS_STR.
  WRITE: / GS_STR-CARRID, GS_STR-CARRNAME.
ENDLOOP.

 

728x90
๋ฐ˜์‘ํ˜•