๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90
๋ฐ˜์‘ํ˜•

๐Ÿง‘‍๐Ÿ’ผ SAP/ABAP78

[SAP ABAP] INCLUDE ํŒŒ์ผ๋ช… ๊ทœ์น™ ๋ฐ ์˜๋ฏธ: CLS, F01, I01, O01, T01 INCLUDE ๋ž€? ABAP์—์„œ INCLUDE ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ๊ทธ๋žจ์„ ๋ชจ๋“ˆํ™”ํ•˜๊ณ  ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ฝ”๋“œ ๋ธ”๋ก์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์š”์•ฝ ์ •๋ฆฌINCLUDE ์ด๋ฆ„ ๋’ค์— ๋ถ™๋Š” ์ ‘๋ฏธ์‚ฌ๋Š” ํ•ด๋‹น INCLUDE ๋ชฉ์ ๊ณผ ์—ญํ• ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.CLSํด๋ž˜์Šค๋ฅผ ํฌํ•จํ•˜์—ฌ INCLUDEF01ํผ ๋ฃจํ‹ด(์„œ๋ธŒ๋ฃจํ‹ด)์„ ํฌํ•จํ•˜์—ฌ INCLUDEI01์ดˆ๊ธฐํ™” ๋˜๋Š” ์ž…๋ ฅ์ฝ”๋“œ๋ฅผ ํฌํ•จํ•˜๋Š” INCLDUEO01์ถœ๋ ฅ ๊ด€๋ จ ์ฝ”๋“œ๋ฅผ ํฌํ•จํ•˜๋Š” INCLUDET01ํŽ˜์ด์ง€ ์ƒ๋‹จ ์ถœ๋ ฅ ์ฝ”๋“œ ๋˜๋Š” ํ…Œ์ด๋ธ” ๋ฐ ๋ฐ์ดํ„ฐ ์„ ์–ธ ์ฝ”๋“œ๋ฅผ ํฌํ•จํ•˜๋Š” INCLDUE CLS (Class)ํด๋ž˜์Šค ์ •์˜์™€ ๊ตฌํ˜„์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.INCLUDE ZMYCLASS_CLS.CLASS zmyclass DEFINITION. PUBLIC SECTION. METHODS: method1, .. 2024. 7. 9.
[SAP ABAP] START/END-OF-SELECTION ์ด๋ž€? (์˜ˆ์ œ ํฌํ•จ) ์š”์•ฝSTART-OF-SELECTION๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜ค๋Š” ์ž‘์—…์„ ์ฒ˜๋ฆฌEND-OF-SELECTION์ฝ์–ด์˜จ ๋ฐ์ดํ„ฐ๋ฅผ ํ™”๋ฉด์— ์ถœ๋ ฅํ•˜๊ฑฐ๋‚˜ ํ›„์ฒ˜๋ฆฌ ์ž‘์—…์„ ์ฒ˜๋ฆฌ ๊ฐœ๋… ์ดํ•ดSTART-OF-SELECTION:ํ”„๋กœ๊ทธ๋žจ์ด ์‹œ์ž‘๋  ๋•Œ ๊ฐ€์žฅ ๋จผ์ € ์‹คํ–‰๋˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค.์ฃผ๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜ค๋Š” ์ž‘์—…์„ ์—ฌ๊ธฐ์— ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.END-OF-SELECTION:๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ๊ฐ€ ๋๋‚œ ํ›„ ์‹คํ–‰๋˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค.์ฃผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ํ™”๋ฉด์— ์ถœ๋ ฅํ•˜๊ฑฐ๋‚˜ ํŒŒ์ผ๋กœ ์ €์žฅํ•˜๋Š” ์ž‘์—…์„ ์—ฌ๊ธฐ์— ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ์ด ์˜ˆ์ œ๋Š” SPFLI ํ…Œ์ด๋ธ”์—์„œ ํ•ญ๊ณต์‚ฌID๋ฅผ ์ž…๋ ฅํ•˜๋ฉด, ํ•ญ๊ณต์‚ฌ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์™€์„œ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค.DATA: LT_SPFLI TYPE TABLE OF SPFLI, " ์—ฌ๋Ÿฌ ํ•ญ๊ณตํŽธ ์ •๋ณด๋ฅผ ๋‹ด์„ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ” WA_SPFLI TYP.. 2024. 7. 9.
[SAP ABAP] FOR ALL ENTRIES IN ์ด๋ž€? (์‚ฌ์šฉ ์˜ˆ์ œ ํฌํ•จ) 1. FOR ALL ENTRIES IN ์ด๋ž€?FOR ALL ENTRIES IN ๊ตฌ๋ฌธ์€ ABAP์—์„œ ๋Œ€๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋˜๋Š” SQL ๊ตฌ๋ฌธ์ž…๋‹ˆ๋‹ค.์ด๋ฅผ ํ†ตํ•ด ์—ฌ๋Ÿฌ ํ•„๋“œ๋ฅผ ํ•œ ๋ฒˆ์— ์กฐํšŒํ•  ์ˆ˜ ์žˆ์–ด ์„ฑ๋Šฅ์„ ์ตœ์ ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž‘๋™ ์›๋ฆฌFOR ALL ENTRIES IN์€ ์ธํ„ฐ๋„ ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ…Œ์ด๋ธ”์—์„œ ๊ด€๋ จ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•  ๋•Œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.์ด๋ฅผ ํ†ตํ•ด ์—ฌ๋Ÿฌ ์กฐ๊ฑด์„ ํ•œ ๋ฒˆ์— ์ฒ˜๋ฆฌํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ ‘๊ทผ ํšŸ์ˆ˜๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.FOR ALL ENTRIES IN์œผ๋กœ WHERE ์กฐ๊ฑด์„ ๋น„๊ตํ•˜๋ ค๋ฉด TYPE๊ณผ ๊ธธ์ด๊ฐ€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. 2. FOR ALL ENTRIES IN ์‚ฌ์šฉ ์˜ˆ์ œDATA: lt_data TYPE TABLE OF mara, " 'mara' ํ…Œ์ด๋ธ”์—์„œ ์ž.. 2024. 6. 27.
[SAP ABAP] CONTINUE, STOP, CHECK ๋ž€? (์‚ฌ์šฉ ์˜ˆ์‹œ ํฌํ•จ) SAP ABAP์—์„œ `CONTINUE`, `STOP`, `CHECK`๋Š” ๋ฃจํ”„ ์ฒ˜๋ฆฌ ์ค‘ ์กฐ๊ฑด์— ๋”ฐ๋ผ ํŠน์ • ํ–‰๋™์„ ๊ฒฐ์ •ํ•˜๋Š”๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.๊ฐ ๋ช…๋ น์–ด๋Š” ๋ฃจํ”„์˜ ํ๋ฆ„์„ ์ œ์–ดํ•˜๋Š”๋ฐ ๋„์›€์ด ๋˜๋ฉฐ, ์ด๋ฅผ ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด ์˜ˆ์‹œ์™€ ํ•จ๊ป˜ ์„ค๋ช…ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์š”์•ฝ ์ •๋ฆฌCOUTINUEํ˜„์žฌ ๋ฐ˜๋ณต์„ ๊ฑด๋„ˆ๋›ฐ๊ณ , ๋‹ค์Œ ๋ฐ˜๋ณต ์‹คํ–‰STOPํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰ ์ค‘๋‹จ(๋ฃจํ”„๊ฐ€ ์•„๋‹ˆ๋ผ ํ”„๋กœ๊ทธ๋žจ ์ˆ˜์ค€์—์„œ ์‚ฌ์šฉ)CHECK์กฐ๊ฑด์ด `FALSE`์ธ ๊ฒฝ์šฐ ํ˜„์žฌ ๋ฐ˜๋ณต์„ ์ข…๋ฃŒํ•˜๊ณ  ๋‹ค์Œ ๋ฐ˜๋ณต ์‹คํ–‰ 1. CONTINUE`CONTINUE` ๋ช…๋ น์–ด๋Š” ํ˜„์žฌ ๋ฃจํ”„์˜ ๋ฐ˜๋ณต์„ ์ข…๋ฃŒํ•˜๊ณ , ๋‹ค์Œ ๋ฐ˜๋ณต์œผ๋กœ ๋„˜์–ด๊ฐ‘๋‹ˆ๋‹ค.ํ˜„์žฌ ๋ฐ˜๋ณต ์ดํ›„์˜ ๋ชจ๋“  ์ฝ”๋“œ๋Š” ์‹คํ–‰๋˜์ง€ ์•Š๊ณ  ๊ฑด๋„ˆ๋›ฐ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ์‹œDO 10 TIMES. IF SY-INDEX MOD 2 EQ 0. CONTINUE. ENDIF. W.. 2024. 5. 30.
728x90
๋ฐ˜์‘ํ˜•