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

[SAP ABAP] TYPE๊ณผ LIKE ์ฐจ์ด

by Jay Din 2023. 10. 4.
728x90
๋ฐ˜์‘ํ˜•

TYPE๊ณผ LIKE์˜ ์ฐจ์ด๋Š” Data Object ์„ ์–ธ ์‹œ TYPE ๋˜๋Š” LIKE ๋’ค์—

Data Object์™€ Data Type ์ค‘ ์–ด๋Š ๊ฒƒ์„ reference ํ•˜๋Š”์ง€ ์ฐจ์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Data Object ์‹ค์ œ ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์— ํ• ๋‹น๋œ ์กด์žฌ
Data Type ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„์„ ์ฐจ์ง€ํ•˜์ง€ ์•Š๊ณ  Data Object๋ฅผ ์ •์˜ํ•˜๊ธฐ ์œ„ํ•œ ํ•˜๋‚˜์˜ ํ…œํ”Œ๋ฆฟ

 

์˜์–ด์‚ฌ์ „์—์„œ TYPE๊ณผ LIKE์˜ ๋œป์„ ์ฐพ์•„๋ณด๋ฉด

TYPE์€ ํ˜•ํƒœ, ํ‹€, ์ข…๋ฅ˜ ๋“ฑ์œผ๋กœ ์ •์˜ํ•˜๊ณ ,

LIKE๋Š” '~์™€ ๊ฐ™์€', '~์™€ ๋น„์Šทํ•œ' ๋“ฑ์œผ๋กœ ์ •์˜๋˜๋ฉฐ ์–ด๋Š ํ•œ ๋Œ€์ƒ(์‹ค์ฒด)๊ณผ ๋น„๊ตํ•ด์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

 

์ฆ‰, TYPE ๋’ค์—๋Š” Data Type์ด ์˜ค๊ณ ,

LIKE ๋’ค์—๋Š” Data Object๊ฐ€ ์‚ฌ์šฉ๋œ๋‹ค๋Š” ๊ฒƒ์„ ์œ ์ถ”ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋ฐ˜์‘ํ˜•

 

์ด ๋•Œ, ์˜ˆ์™ธ์ ์œผ๋กœ Data Type ์ค‘ ์ผ๋ถ€์ธ ABAP Dictionary์˜ Structure Type / Table / Classic View๊ฐ€

LIKE ๊ตฌ๋ฌธ ๋’ค์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

SAP์—์„œ ๊ณผ๊ฑฐ์—๋Š” ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋„๋ก ๋งŒ๋“ค์–ด ๋†“์•˜์ง€๋งŒ SAP ABAP์ด ๋ฒ„์ „์—…์ด ๋˜๋ฉด์„œ

LIKE๋Š” Data Object์ธ ๊ฒฝ์šฐ์—๋งŒ ์‚ฌ์šฉํ•˜๋ผ๊ณ  ๊ถŒ๊ณ  ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

 

https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenlike_obsolete.htm

728x90

์ •๋ฆฌํ•˜๋ฉด

Type repository(SE11:Abap Dictionary) ์— ์žˆ๋Š” ๊ฒƒ์„ ํ”„๋กœ๊ทธ๋žจ ์˜์—ญ์—์„œ ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•  ๋•Œ <- Data Type
Like ํ”„๋กœ๊ทธ๋žจ ์˜์—ญ์—์„œ ์„ ์–ธ๋œ ๊ฒƒ์„ ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•  ๋•Œ <- Data Object

 

๋ฐ˜์‘ํ˜•

์‚ฌ์šฉ ์˜ˆ์‹œ

๊ตฌ๋ถ„ ์„ค๋ช…
TYPE ๋งŒ๋“ค๊ณ  ์‹ถ์€ data object์˜ ํƒ€์ž… ์„ค์ • ์‹œ ์‚ฌ์šฉ(begin of๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ)
ABAP dictionary์˜ ๊ธ€๋กœ๋ฒŒ ํƒ€์ž…์„ ์ฐธ์กฐํ•˜์—ฌ ์„ ์–ธํ•  ์‹œ ์‚ฌ์šฉ
๋ฏธ๋ฆฌ ์ •์˜๋œ ๋ฐ์ดํ„ฐ ํƒ€์ž…์„ ์‚ฌ์šฉํ•  ์‹œ ์‚ฌ์šฉ(N, I, F, D๋“ฑ)
domain์„ ์ง์ ‘ ์ฐธ์กฐํ•œ๋‹ค๋Š” ์˜๋ฏธ๋ฅผ ๊ฐ€์ง
LIKE ์„ ์–ธ๋œ data object๊ณผ ๋™์ผํ•œ data object๋ฅผ ๋งŒ๋“ค ์‹œ ์‚ฌ์šฉ
์„ ์–ธ๋œ ํ•„๋“œ์˜ domain์„ ์ฐธ์กฐํ•œ๋‹ค๋Š” ์˜๋ฏธ๋ฅผ ๊ฐ€์ง
728x90
๋ฐ˜์‘ํ˜•