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

[SAP ABAP] SELECTION-SCREEN ์ด๋ž€? (์˜ˆ์ œ ํฌํ•จ)

by Jay Din 2024. 7. 16.
728x90
๋ฐ˜์‘ํ˜•

SELECTION-SCREEN ์ด๋ž€?

์˜ˆ์‹œ ํ™”๋ฉด

 

ABAP ํ”„๋กœ๊ทธ๋žจ์—์„œ ์‚ฌ์šฉ์ž ์ž…๋ ฅ์„ ์œ„ํ•œ ํ™”๋ฉด์„ ์ •์˜ํ•˜๋Š”๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ์ž์—๊ฒŒ ๊ฐ’์„ ์ž…๋ ฅ๋ฐ›๋Š” ๊ธฐ๋Šฅ์„ ํ•ฉ๋‹ˆ๋‹ค.

 

์˜ˆ์ œ

REPORT ZABAP001 .

* 1. ๋ณ€์ˆ˜ ์„ ์–ธ
DATA: lv_name TYPE char20,
      lv_age  TYPE i,
      lv_date TYPE d.

* 2. Selection screen ์š”์†Œ ์ •์˜
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE  text-001.

* 3. PARAMETERS
PARAMETERS: p_name TYPE char20 OBLIGATORY,
            p_age  TYPE i DEFAULT 25,
            p_date TYPE d DEFAULT sy-datum.

SELECTION-SCREEN END OF BLOCK b1.

* 4. START-OF-SELECTION
START-OF-SELECTION.
  lv_name = p_name.
  lv_age = p_age.
  lv_date = p_date.

  WRITE: / 'Name:', lv_name.
  WRITE: / 'Age:', lv_age.
  WRITE: / 'Date:', lv_date.

 

  1. ๋ณ€์ˆ˜ ์„ ์–ธ
    • lv_name: CHAR20 ํƒ€์ž…์˜ ๋ฌธ์ž์—ด ๋ณ€์ˆ˜
    • lv_age: ์ •์ˆ˜ํ˜• ๋ณ€์ˆ˜
    • lv_date: ๋‚ ์งœํ˜• ๋ณ€์ˆ˜
  2. SELECTION-SCREEN BEGIN OF BLEOCK ... END OF BLOCK
    • ์ž…๋ ฅ ํ•„๋“œ๋“ค์„ ๊ทธ๋ฃนํ™”ํ•˜์—ฌ ๋ธ”๋ก์œผ๋กœ ๋ฌถ์Šต๋‹ˆ๋‹ค.
    • 'WITH FRAME': ๋ธ”๋ก ์ฃผ์œ„์— ํ”„๋ ˆ์ž„์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
    • 'TITLE text-001': ๋ธ”๋ก์˜ ์ œ๋ชฉ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ 'text-001'์€ ํ…์ŠคํŠธ ์š”์†Œ์ž…๋‹ˆ๋‹ค.
  3. PARAMETERS
    • 'p_name': CHAR20 ํƒ€์ž…์˜ ๋ฌธ์ž์—ด ์ž…๋ ฅ ํ•„๋“œ. 'OBLIGATORY' ๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ ํ•„๋“œ์ž„์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
    • 'p_age': ์ •์ˆ˜ํ˜• ์ž…๋ ฅ ํ•„๋“œ. ๊ธฐ๋ณธ๊ฐ’์€ 25๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
    • 'p_date': ๋‚ ์žํ˜• ์ž…๋ ฅ ํ•„๋“œ. ๊ธฐ๋ณธ๊ฐ’์€ ํ˜„์žฌ ์‹œ์Šคํ…œ ๋‚ ์งœ(sy-datum)๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
  4. START-OF-SELECTION
    • ์ด ์ด๋ฒคํŠธ๋Š” SELECTION-SCREEN์—์„œ ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅ์„ ์™„๋ฃŒํ•˜๊ณ  ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰์„ ์‹œ์ž‘ํ•  ๋•Œ ์‹คํ–‰๋˜๋‹ˆ๋‹ค.
    • SELECTION-SCREEN์—์„œ ์ž…๋ ฅ๋ฐ›์€ ๊ฐ’์„ ํ”„๋กœ๊ทธ๋žจ ๋ณ€์ˆ˜ (lv_name, lv_age, lv_date)์— ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค.
    • WRITE ๊ตฌ๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅ๋ฐ›์€ ๊ฐ’์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

๊ฐ‘ ์ž…๋ ฅ ํ™”
์ถœ๋ ฅ ํ™”๋ฉด

 

 

 

728x90
๋ฐ˜์‘ํ˜•