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

[SAP ABAP] Modal Dialog Screen Box ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•

by Jay Din 2024. 4. 15.
728x90
๋ฐ˜์‘ํ˜•

Modal Dialog Screen Box ๋ž€?

SAP ABAP์—์„œ๋Š” ๋ชจ๋‹ฌ ๋‹ค์ด์–ผ๋กœ๊ทธ ์ƒ์ž ํ˜•์‹์˜ ํ™”๋ฉด์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฅผ ํ†ตํ•ด ํŠน์ • ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ๋•Œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜๊ฑฐ๋‚˜ ์ž…๋ ฅ์„ ์š”์ฒญํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Modal Dialog Screen Box ๋Š” ๋ณดํ†ต 10๋ฒˆ ๋‹จ์œ„๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ex) 110๋ฒˆ, 150๋ฒˆ etc 

 

Modal Dialog Screen Box  ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•

1. Screens / create

Screen number๋Š” 10๋ฒˆ ๋‹จ์œ„๋กœ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

 

  • Screen Type:
    • ๋ชจ๋‹ฌ ๋‹ค์ด์–ผ๋กœ๊ทธ ๋ฐ•์Šค๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— `scree type : modal dialog box`๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • Next Dynpro:
    • Other Attributes์˜ Next Dynpro ์„ค์ •์€ ์Šคํฌ๋ฆฐ ๊ฐ„์˜ ํ๋ฆ„(๋„ค๋น„๊ฒŒ์ด์…˜)์„ ์ •์˜ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. Next Dynpro๋Š” ํ˜„์žฌ ์Šคํฌ๋ฆฐ์—์„œ ์ข…๋ฃŒ๋  ๋•Œ ๋‹ค์Œ์— ํ˜ธ์ถœ๋  ์Šคํฌ๋ฆฐ์˜ ๋ฒˆํ˜ธ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. Next Dynpro๊ฐ€ 0์œผ๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ, ํ˜„์žฌ ์Šคํฌ๋ฆฐ์—์„œ ๋‹ค์Œ ์Šคํฌ๋ฆฐ์ด ํ˜ธ์ถœ๋˜์ง€ ์•Š์Œ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ํ˜„์žฌ ์Šคํฌ๋ฆฐ์ด ์ข…๋ฃŒ๋˜๋ฉด ์ด์ „ ์Šคํฌ๋ฆฐ์œผ๋กœ ๋Œ์•„๊ฐ€๊ฑฐ๋‚˜ ํ˜„์žฌ ํŠธ๋žœ์žญ์…˜์„ ์ข…๋ฃŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

2. Screen / Layout

SAP ABAP์—์„œ ์Šคํฌ๋ฆฐ์„ ๋งŒ๋“œ๋Š” ๊ณผ์ • ์ค‘ ๋ ˆ์ด์•„์›ƒ(Layout)์€ ์‚ฌ์šฉ์ž๊ฐ€ ์Šคํฌ๋ฆฐ์—์„œ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋Š” ์š”์†Œ(์ปดํฌ๋„ŒํŠธ)๋“ค์„ ๋ฐฐ์น˜ํ•˜๊ณ  ๊ตฌ์„ฑํ•˜๋Š” ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค.

๋ ˆ์ด์•„์›ƒ์„ ํ†ตํ•ด ์Šคํฌ๋ฆฐ์˜ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค(UI)๋ฅผ ๊ตฌ์„ฑํ•˜๊ณ  ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

3. ์ฝ”๋“œ ์ž‘์„ฑ

Includes / ํŒŒ์ผ๋ช…+TOP์— ๋ ˆ์ด์•„์›ƒ ํ…Œ์ด๋ธ”์— ์ถ”๊ฐ€ํ•œ ํ…Œ์ด๋ธ”์„ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค.

 

PBO์— ๋ชจ๋‹ฌ ๋‹ค์ด์–ผ๋กœ๊ทธ ๋ฐ•์Šค์— ๋„ฃ์–ด์ค„ ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

*&---------------------------------------------------------------------*
*&      Module  GET_CARRIER  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE get_carrier OUTPUT.
  
  select SINGLE *
    from scarr
    where carrid = sdyn_conn-carrid.

  
ENDMODULE.

 

์•„๋ž˜๋Š” user_command_0100 ๋ชจ๋“ˆ์—์„œ P๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ์—”ํ„ฐ๋ฅผ ๋ˆ„๋ฅด๋ฉด ๋‹ค์ด์–ผ๋กœ๊ทธ๊ฐ€ ์ถœ๋ ฅ๋˜๋Š” ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.

*&---------------------------------------------------------------------*
*&  Include           MZSCREEN_SOL04I01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  " ๋งจ๋งˆ์ง€๋ง‰ ์ž๋ฆฌ์— 'P'๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ๋‹ค์ด์–ผ๋กœ๊ทธ ์ถœ๋ ฅ
  CASE command.
    WHEN 'X'.
*      go back.
      LEAVE TO SCREEN 0.
    WHEN 'P'.
      CALL SCREEN 150
      STARTING AT 5 3
  ENDCASE.

  " ๋ฒ„ํŠผ ํด๋ฆญ์‹œ gv_mode ๋ณ€ํ™”
  CASE ok_code.
    WHEN 'CHG'.
      IF gv_mode = 0.
        gv_mode = 1.
      ELSE.
        gv_mode = 0.
      ENDIF.
  ENDCASE.

ENDMODULE.

 

3. ๋ชจ๋‹ฌ ๋‹ค์ด์–ผ๋กœ๊ทธ ์ถœ๋ ฅ

p์ž…๋ ฅํ›„ ์—”ํ„ฐ ๊ฒฐ๊ณผ

 

Modal Dialog ์œ„์น˜์™€ ํฌ๊ธฐ ์ œ์–ด

` CALL SCREEN ` ์€ SAP ABAP์—์„œ ๋‹ค๋ฅธ ์Šคํฌ๋ฆฐ์„ ํ˜ธ์ถœํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ฌธ์žฅ์ž…๋‹ˆ๋‹ค.

์ด ๋ฌธ์žฅ์—๋Š” ` STARTING AT ` ๊ณผ ` ENDING AT ` ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ ์Šคํฌ๋ฆฐ์˜ ์œ„์น˜์™€ ํฌ๊ธฐ๋ฅผ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

` STARTING AT ` ๊ณผ ` ENDING AT ` ์€ ๊ฐ™์ด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

STARTING AT ` ์˜ต์…˜

  • ๋ชฉ์ : ํ˜ธ์ถœ๋˜๋Š” ์Šคํฌ๋ฆฐ์˜ ์‹œ์ž‘ ์œ„์น˜(์ขŒ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ)๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • ๊ตฌ๋ฌธ:
CALL SCREEN screen_number
STARTING AT x_position y_position
  • ๋งค๊ฐœ๋ณ€์ˆ˜:
    • x_position: ์Šคํฌ๋ฆฐ์˜ ์ขŒ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ์˜ ์ˆ˜ํ‰ ์œ„์น˜(ํ”ฝ์…€ ๋‹จ์œ„).
    • y_position: ์Šคํฌ๋ฆฐ์˜ ์ขŒ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ์˜ ์ˆ˜์ง ์œ„์น˜(ํ”ฝ์…€ ๋‹จ์œ„).
  • ์˜ˆ์‹œ:
    • CALL SCREEN 100 STARTING AT 100 200.
    • ์œ„ ์˜ˆ์‹œ์—์„œ๋Š” 100๋ฒˆ ์Šคํฌ๋ฆฐ์„ ํ˜ธ์ถœํ•˜๋ฉด์„œ ์Šคํฌ๋ฆฐ์˜ ์ขŒ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ๊ฐ€ X ์ขŒํ‘œ 100, Y ์ขŒํ‘œ 200 ์œ„์น˜์— ์‹œ์ž‘๋˜๋„๋ก ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

 

` ENDING AT ` ์˜ต์…˜

  • ๋ชฉ์ : ํ˜ธ์ถœ๋˜๋Š” ์Šคํฌ๋ฆฐ์˜ ์ข…๋ฃŒ ์œ„์น˜(์šฐํ•˜๋‹จ ๋ชจ์„œ๋ฆฌ)๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • ๊ตฌ๋ฌธ:
CALL SCREEN screen_number
ENDING AT x_position y_position
  • ๋งค๊ฐœ๋ณ€์ˆ˜:
    • x_position: ์Šคํฌ๋ฆฐ์˜ ์šฐํ•˜๋‹จ ๋ชจ์„œ๋ฆฌ์˜ ์ˆ˜ํ‰ ์œ„์น˜(ํ”ฝ์…€ ๋‹จ์œ„).
    • y_position: ์Šคํฌ๋ฆฐ์˜ ์šฐํ•˜๋‹จ ๋ชจ์„œ๋ฆฌ์˜ ์ˆ˜์ง ์œ„์น˜(ํ”ฝ์…€ ๋‹จ์œ„).
  • ์˜ˆ์‹œ:
    • CALL SCREEN 100 ENDING AT 500 400.
    • ์œ„ ์˜ˆ์‹œ์—์„œ๋Š” 100๋ฒˆ ์Šคํฌ๋ฆฐ์„ ํ˜ธ์ถœํ•˜๋ฉด์„œ ์Šคํฌ๋ฆฐ์˜ ์šฐํ•˜๋‹จ ๋ชจ์„œ๋ฆฌ๊ฐ€ X ์ขŒํ‘œ 500, Y ์ขŒํ‘œ 400 ์œ„์น˜์— ์ข…๋ฃŒ๋˜๋„๋ก ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
728x90
๋ฐ˜์‘ํ˜•