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

[SAP ABAP] Runtime Error - Description of Exception ํ•ด๊ฒฐ

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

์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€

๋ฐ˜์‘ํ˜•

์ฝ”๋“œ

REPORT ZABAP001 .

DATA : GV_VAL1 TYPE I VALUE 2.
DATA : GV_VAL2 TYPE I VALUE 3.
DATA : GV_SUM TYPE I.

PERFORM SUM_DATA USING GV_VAL1 GV_VAL2 CHANGING GV_SUM.

WRITE: / 'Result is : ', GV_SUM.

FORM SUM_DATA USING VALUE(P_VAL1)
      VALUE(P_VAL2)
  CHANGING VALUE(P_SUM).
  P_SUM = P_VAL1+P_VAL2.
  ENDFORM.

 

๋ฌธ์ œ์ 

์—๋Ÿฌ๋ฅผ ์ฐพ์„ ๋‹จ์„œ๊ฐ€ ๋‘๊ฐœ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์—๋Ÿฌ ์ œ๋ชฉ(runtime error)
  • short text(Invalid partial field access: Inappropriate field type "I")

๋Ÿฐํƒ€์ž„์— ๋Œ€ํ•ด์„œ ๋ชจ๋ฅธ๋‹ค๋ฉด ์ฐธ๊ณ  ํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.

 

๋ฐ˜์‘ํ˜•

 

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

short text์˜ ๋‚ด์šฉ์„ ํ•ด์„ํ•ด๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋ถ€๋ถ„ ํ•„๋“œ ์•ก์„ธ์Šค๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ•„๋“œ ์œ ํ˜• "I"๊ฐ€ ์ž˜๋ชป๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

 

Abap Data type 'i'๋Š” ์ •์ˆ˜๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ ์ •์ˆ˜์ธ ๋ณ€์ˆ˜์— ์ •์ˆ˜๊ฐ€ ์•„๋‹Œ ๊ฐ’์ด ์ ‘๊ทผํ•˜๋ ค๊ณ  ํ•ด์„œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฑฐ๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

 

ํ™•์ธ ๊ฒฐ๊ณผ,

14๋ฒˆ์งธ ์ค„์— p_sum = p_val1+p_val2.์—์„œ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ์Šต๋‹ˆ๋‹ค.

p_sum์€ ์ •์ˆ˜ ํƒ€์ž…์˜ ๋ณ€์ˆ˜์ธ๋ฐ ์ •์ˆ˜ ํƒ€์ž…์ด ์•„๋‹Œ ๋‹ค๋ฅธ ํƒ€์ž…์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ์ ‘๊ทผํ•˜์—ฌ ์—๋Ÿฌ๊ฐ€ ๋‚œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

SAP ABAP์—์„œ ๋ช…๋ น์–ด๋‚˜ ์ˆ˜์‹ ๋“ฑ์€ ๊ณต๋ฐฑ์„ ๋‘๊ณ  ์ฒ˜๋ฆฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 

๋”ฐ๋ผ์„œ p_sum = p_val1 + p_val2. ์™€ ๊ฐ™์ด p_val1์™€ p_val2 ์‚ฌ์ด์— ์žˆ๋Š” + ์–‘ ์˜†์— ๊ณต๋ฐฑ์„ ์ฃผ๋ฉด ์˜ค๋ฅ˜๊ฐ€ ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค. p_val1+p_val2 ๋Š” ์˜๋„ ํ–ˆ๋˜ ๋”ํ•˜๊ธฐ ๊ตฌ๋ฌธ์ด ์™„์„ฑ๋˜์ง€ ์•Š์•„ ๋‹ค๋ฅธ ํƒ€์ž…์œผ๋กœ ์ธ์‹๋˜์–ด ์˜ค๋ฅ˜๊ฐ€ ๋‚œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

๊ฐ€๋” ์—๋Ÿฌ๊ฐ€ ๋‚ฌ์„ ๋•Œ, ๋ฌธ์ œ์ ์„ ์•„๋ฌด๋ฆฌ ์ฐพ์•„๋„ ๋ˆˆ์— ์•ˆ ๋ณด์ผ ๋•Œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿด ๋• ์ „์ฒด ์ฝ”๋“œ๋ฅผ ์ฃผ์„ ์ฒ˜๋ฆฌํ•œ ํ›„, ํ•œ ์ค„์”ฉ ์‹คํ–‰ํ•ด๋ณด๋Š” ๊ฒƒ๋„ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•