ALV (Abap List Viewer)

42
ALV (Abap List Viewer) About

description

About. ALV (Abap List Viewer). ALV 란 ?. 1.ALV 개요 . 2.ALV 목적 . 3.USE. 2.ALV 속성 . 1.Class / Function Group. 2.Field Catalog. 3.Layout Structure. ALV Sample. 1. Programming 기법 . 2. Example Program. 4.ALV 기대효과. ALV 란 ?. 1. ALV 란 ?. 1-1. ALV 개요. - PowerPoint PPT Presentation

Transcript of ALV (Abap List Viewer)

Page 1: ALV  (Abap List Viewer)

ALV (Abap List Viewer)About

Page 2: ALV  (Abap List Viewer)

1. ALV 란 ?.

1. ALV 개요 .2. ALV 목적 .3. USE.

2. ALV 속성 .

1. Class / Function Group.2. Field Catalog.3. Layout Structure.

3. ALV Sample.

1. Programming 기법 .2. Example Program.

4. ALV 기대효과 .

Page 3: ALV  (Abap List Viewer)

1. ALV 란 ?

1-1. ALV 개요 .

ALV 란 ?

ALV 는 Abap List Viewer 의 약자로써 SAP 에서 사용자의 편의성을 제공하기 위하여 Standard Function 으로

만들어서 제공하며 여러가지 기능을 포함하고 있어서 사용자가 쓰기에 적합하도록 되어 있다 .

Abap List Viewer 에서 제공하는 기능 .

a) Navigating Within the List.

b) Choosing Detail.

c) Sorting in Ascending/Descending Order.

d) ABC Analysis.

e) Selecting and Deselecting Rows.

f) Row indicator

g) Setting and Deleting Filters.

h) Displaying and Deleting Sums.

I) Creating Subtotals.

j) Choosing Summation Levels.

k) Defining the Breakdown of the Summation Levels.

l) Displaying the List Status.

m) Optimizing the Column Width.

n) Freezing to Columns and Unfreezing Columns.

o) Choosing Display Variants.

p) Defining the Current Display Variant.

q) Saving Display Variants.

r) Management of Display Variants.

s) Displaying The Basic List.

u) Finding Terms.

v) Printing Lists.

w) Sending Lists as Documents

x) SpreadSheets.

y) Word Processing.

z) Local File.

Page 4: ALV  (Abap List Viewer)

기존의 Abap 의 단순한 레포트에서 탈피하여 Function 으로

제공하는 Standard 를 적용함으로써 여러 기능들에 대한

불필요한 코딩을 줄이고 일의 효율성을 높힌다 .

또한 단 시간 내에 Technical 한 프로그램을 완료함으로써

고객의 신뢰를 얻는다 .

1-2. ALV 목적 .

1. ALV 란 ? ALV 란 ?

Page 5: ALV  (Abap List Viewer)

Abap List Viewer 는 아래와 같이 Report 를 Controlling 하는데 주로 쓰인다 .

a) Reports from cost centers and business processes.

b) Actual line from reports from cost centers and business processes.

c) Commitment line item reports.

d) Plan line item reports from cost centers, orders, business processes, cost objects.

e) Budget reports.

f) Cycle reports.

g) Order selection (CO-PC).

h) Flexible itemization (CO-PC).

이외의 모든 Report 에 쓰일수 있으며 강력한 Function 기능과 변형의 가능으로 거의 모든 레포트가

ALV 로 바뀌고 있는 추세이며 ALV(Classic) -> ALV Grid Control 로 바뀌는 추세이다 .

1. ALV 란 ? ALV 란 ?

1-3. Use.

Page 6: ALV  (Abap List Viewer)

Class : SLIS.

Group. Function Group Description.

ALTR : ALV Tree Control : Services Modules

KKBL : Internal Use

KKRT : Hierarchy Display via field Catalog

SALV : Abap List Viewer

SFCC : Internal ALV Function enhancements

SKBE : Extract Management

SKBH : Internal Service Modules ALV

SKBS : Display Variants list tool management

SLVC : ALV Control service module

SLVC_CONSISTENCY_CHECK : ALV Call consistency check

SLVC_DIALOG : ALV Control : Dialog elements

SLVC_FULLSCREEN : ALV Grid control full screen

SLVC_ITEM_SELECTION : Selection Using grid control

SLVC_SERVICES : Services

SPCA : Call PC application in list processing

SSN1 : Scan ABAP Source code

2. ALV 속성 . ALV 속성

2-1. Class / Function Group

Page 7: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

2-2. Field Catalog.

Reference to the FIELEDNAME LVC_FNAME. CHAR(30)

Output Table Field name of output table(required).

Reference to the Data REF_FIELD LVC_RFNAME CHAR(30)

Dictionary SPACE, name of a field in the Data Dictionary that corresponds to a field in the

output table.

REF_TABLE LVC_RTNAME CHAR(30)

SPACE, name of a structure or table from the Data Dictionary that corresponds to a

field

in the output table.

Value Display With DECMFIELD LVC_DFNAME CHAR(30)

Currency/Quantity Unit SPACE, field name of output table

EDIT_MASK LVC_EDTMSK CHAR(60)

SPACE, conv (conversion exit). ex) ==ALPHA

Page 8: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

Output Options CHECKBOX LVC_CHECKB. CHAR(1)

Of column SPACE, ‘X’

COL_POS LVC_COLPOS INT4(10)

Field 에 대한 Column Positions.

DO_SUM LVC_DOSUM CHAR(1)

Field 에 대한 SUM 을 계산한다 .

EMPHASIZE LVC_EMPHASIZE CHAR(04)

Field 에 대한 COLOR 을 지정 . SPACE or ‘X’ or ‘Cxyz’ (X:1~9, y,z : ‘0’ = off ‘1’ = on)

X : color number , Y : intensified display on/off , Z : inverse display on/off.

HOTSPOT LVC_HOTSPOT CHAR(1)

SPACE, ‘X’

KEY LVC_KEY CHAR(1)

SPACE, ‘X’. (Field 가 키가 되는 부분임을 설정한다 )

LOWERCASE LOWERCASE CHAR(1)

Field 의 Upper / lower 를 설정한다 .

Page 9: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

NO_OUT LVC_NOOUT. CHAR(1)

SPACE, ‘X’ 초기에 Display 에 관한 설정 .

NO_SUM LVC_NOSIGN CHAR(1)

SPACE,’X’ 필드에 대한 SUM 을 할 것 인지에 관한 설정 .

OUTPUTLEN LVC_OUTLEN NUMC(06)

0, n 필드의 출력넓이를 설정한다 .

TECH LVC_TECH CHAR(1)

SPACE, ‘X’ 설정할 경우 필드는 보여지지 않는다 .

Formatting Column CURRENCY CHAR(05)

Contents SPACE, 금액 필드일 경우 통화코드를 셋팅 .

CFIELDNAME CHAR(30)

SPACE, 금액 필드일 경우 참조통화 필드를 셋팅 .

CTABNAME CHAR(30)

SPACE, CFIELDNAME 을 설정 했을 시 참조테이블을 셋팅

Page 10: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

EDIT_MASK LVC_EDTMSK. CHAR(60)

SPACE, conv 출력필드에 대한 Conversion Exit 를 설정할 시 쓰임 .

EXPONENT LVC_EXPONT CHAR(3)

initial, integer ( Determines a fixed exponent for the field )

ICON LVC_ICON CHAR(1)

SPACE, ‘X’ 아이콘을 사용할 경우 체크를 해준다 .

JUST LVC_JUST CHAR(1)

SPACE, ‘R’, ‘L’, ‘C’. R = Right justified, L = Left justified, C = Center

필드의 내용을 오른쪽 /왼쪽 /중앙정렬을 결정한다 .

LZERO LVC_ZERO CHAR(1)

SPACE, ‘X’ 체크 했을 시 zero 값은 0 이 display 된다 .(Type: NUMC)

NO_SIGN LVC_NOSIGN CHAR(1)

SPACE, ‘X’ 체크 했을 시 value 가 sign 없이 출력된다 .

NO_ZERO LVC_NOZERO CHAR(1)

SPACE, ‘X’ 체크 했을 시 value field 가 initial 이면 display 되지 않는다 .

Page 11: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

SYMBOL LVC_SYMBOL CHAR(1)

SPACE, ‘X’ 필드를 symbol 로 사용 시 셋팅한다 .

Texts SCRTEXT_L SCRTEXT_L CHAR(40)

Data Dictionary 를 참조하여 필드의 long text 를 가지고 온다 .

SCRTEXT_M SCRTEXT_M CHAR(20)

Data Dictionary 를 참조하여 필드의 medium text 를 가지고 온다 .

SCRTEXT_S SCRTEXT_S CHAR(10)

Data Dictionary 를 참조하여 필드의 shot text 를 가지고 온다 .

REPTEXT_DDIC DD03P-REPTEXT CHAR(55)

Data Dictionary 의 field heading 을 가지고 온다 .

DDICTXT CHAR(1)

참조할 필드의 text 를 결정한다 S:Shot , M:Midium , L:Long

Page 12: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

Parameters for fields ROLLNAME LVC_ROLL CHAR(30)

Without DDIC reference Dictionary 에서 제공하지 않는 출력필드에 대해 F1 Help 를 만들시 참조 Data Element 기

술 .

Other Fields REPREP CHAR(1)

SPACE, ‘X’ 레포트 인터페이스가 될때 설정을 하면 필드의 값이 넘어간다 .

SP_GROUP LVC_SPGRP CHAR(4)

SPACE, Four-digit group key. 여러 필드를 Group 으로 설정

Page 13: ALV  (Abap List Viewer)

종류 . Field Name. Comp. Type. Length.

Description / Value Range.

2. ALV 속성 . ALV 속성

2-3. Layout Structure.

Color ZEBRA CHAR(1)

SPACE, ‘X’ Striped Pattern 을 보여준다 .

NO_VLINE CHAR(1)

SPACE, ‘X’ Columns separated by space

Totals Options NO_TOTLINE CHAR(1)

SPACE, ‘X’ 이 필드가 체크되면 Subtotal 만 표시되고 전체 total 은 표시가 되지 않는다 .

NUMC_TOTAL CHAR(1)

SPACE, ‘X’ 이 필드가 체크되면 Total 계산시 Data Type 이 NUMC 인것만 계산한다 .

Interaction Control KEYHOT CHAR(1)

SPACE, ‘X’ 이 필드가 체크되면 모든 key field 가 hotspot-sensitive 된다 .

Page 14: ALV  (Abap List Viewer)

3-1. Programming 기법 .

기본적인 프로그래밍은 Standard Function 에서 요구하는 인터널 테이블에 대해서 알맞은 데이터를

넘김으로써 프로그램이 되어진다 .

또한 User–Define 부분이 있어서 필요에 따라 Define 함으로써 필요한 기능을 추가 할 수 있다 .

Event 를 정의 하여 인터널 테이블로 넘김으로써 필요한 Event 시 User-Define 한 부분을 실행 할 수 있다 .

더욱더 자세한 것은 Example Program 에서 설명된다 .

3. ALV Sample. ALV Sample

Page 15: ALV  (Abap List Viewer)

3-2. Example Program.

3. ALV Sample. ALV Sample

System : 10.1.20.1 ( 대웅개발 )

System Number : 02

Program ID Description

YALV_01 가장 기본적인 ALV List

YALV_02 Check Box / Pf-status / User-command / Top-of-page

Refresh / Check Box inactive / Line color 변경

YALV_03 Subtotal / Variant / Drill Down

YALV_04 2 개의 연관된 Internal Table 을 Display

다른 Internal Table Append

YALV_05 Popup_select

YALV_06 Grid Control

Page 16: ALV  (Abap List Viewer)

1. YALV_01 출력화면

3. ALV Sample. ALV Sample

Page 17: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_01 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = g_repid <= 프로그램 이름

* i_callback_pf_status_set = g_status

* i_callback_user_command = g_user_command

is_layout = alv_layout <= 뒷장 a 참조

it_fieldcat = it_fieldcat <= 뒷장 b 참조

* it_special_groups = gt_special_group_table

* it_sort = gt_sort_table

it_events = alv_events <= 뒷장 c 참조

TABLES

t_outtab = it_bkpf <= 실제 화면에 보여줄 테이블

EXCEPTIONS

program_error = 1

OTHERS = 2.

Page 18: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

a. Alv_layout 설명 .

출력되는 양식의 Display Options을 지정해주는 부분이다 .

정의 : Data: alv_layout type slis_layout_alv.

값설정 : alv_layout-zebra = ‘X’. “ Striped Pattern

b. it_fieldcat 설명 .

넘기고자 하는 인터널 테이블의 속성을 지정하는 부분이다 . 즉 필드의 이름과 Description, Type,

참조필드

등등을 설명한다 .

정의 : Data: it_fieldcat type slis_t_fieldcat_alv.

값설정 : Data: lt_fieldcat type slis_fieldcat_alv.

clear lt_fieldcat.

lt_fieldcat-col_pos = 1. <- 보여줄 순서

lt_fieldcat-fieldname = ‘ 필드명’.

lt_fieldcat-no_out = ‘X’ , ‘ ‘ <- ‘X’ 설정시 No-display

……

append lt_fieldcat to it_fieldcat. <- 필드에 해당하는 모든 값을

지정하여 it_fieldcat

에 저장한다 .

Page 19: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

c. Alv_event 설명 .

Event를 처리하는 부분으로 Event명과 Form명을 써준다 .

정의 : Data: alv_events type slis_event.

값설정 : Data: ls_event type slis_alv_Event.

ls_event-name = ‘TOP_OF_PAGE’. <- Event Name

ls_event-form = ‘TOP-OF-PAGE’. <- Event발생시

수행하는 Form

append ls_event to alv_event.

ls_event-name = ‘END_OF_LIST’. <- Event Name

ls_event-form = ‘END-OF-PAGE’. <- Event발생시

수행하는 Form

append ls_event to alv_event.

Page 20: ALV  (Abap List Viewer)

2. YALV_02 출력화면

3. ALV Sample. ALV Sample

Page 21: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_02 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = g_repid <= 프로그램 이름

i_callback_pf_status_set = g_status <= 뒷장 a 참조

i_callback_user_command = g_user_command <= 뒷장 b 참조

is_layout = alv_layout <= 뒷장 c 참조

it_fieldcat = it_fieldcat <= 뒷장 d 참조

it_special_groups = gt_special_group_table <= 뒷장 e 참조

* it_sort = gt_sort_table

it_events = alv_events <= 뒷장 f 참조

TABLES

t_outtab = it_bkpf <= 실제 화면에 보여줄 테이블

EXCEPTIONS

program_error = 1

OTHERS = 2.

Page 22: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

a. G_status 설명 .

출력되는 양식의 PF-STATUS을 지정해주는 부분이다 .

정의 : Data: g_status type slis_formname value ‘STATUS’.

ALV에서는 PF-STATUS설정시 본 프로그램의 Form Status를 수행한다 .

값설정 : FORM status USING extab type slis_t_extab.

set pf-status ‘STATUS’ excluding extab.

ENDFORM.

b g_user_command 설명 .

ALV에서 At User-Command / At Line-selection 를 수행할시 callback하여 본 프로그램에서 sy-

ucomm에 따라

수행이 가능하게끔 지정하는 부분이다 .

정의 : Data: g_user_command type slis_formname value ‘USER_COMMAND’.

ALV에서 Event를 수행시 Callback하여 본 프로그램의 Form User_command를

수행 .

값설정 : FORM user_Command using r_ucomm like sy-ucomm <= sy-ucomm

rs_selfield type slis_selfield. <=

선택된 필드의 내용

case r_ucomm.

when ‘&IC1’. …

endcase.

ENDFORM.

Page 23: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

c. alv_layout 설명 .

출력되는 양식의 Display Options을 지정해주는 부분이다 .

정의 : Data: alv_layout type slis_layout_alv.

값설정 : alv_layout-zebra = ‘X’. “ Striped Pattern

alv_layout-box_fieldname = 'BOX'. “ Box가 표시되는

필드이름

alv_layout-box_tabname = 'IT_BKPF'. “ 필드이름을 포함하는 테이블

alv_layout-info_fieldname = 'LISTINFO'. “ infofield for listoutput

d. it_fieldcat 설명 .

앞에서 설명이 되어졌고 프로그래머가 직접 값을 넣어 줄 수도 있고 Function

‘REUSE_ALV_FIELDCATALOG_MERGE’

를 이용하여 인터널 테이블이나 Structure를 넘기고 it_fieldcat을 받을수도 있다 . 이 함수를 거치면

인터널 테이블 정보가 그대로 it_fieldcat에 변환되어 넘어온다 .

CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’

EXPORTING

I_program_name = g_repid

I_internal_name = ‘IT_BKPF’

CHANGING

ct_fieldcat = it_fieldcat.

Page 24: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

e. gt_special_group_table 설명

Current Display Variant의 필드그룹을 지정하는 기능을 한다 .

정의 : DATA: gt_special_group_table TYPE slis_t_sp_group_alv.

값설정 : DATA: gt_special_group_line TYPE slis_sp_group_alv.

FREE gt_special_group_table.

CLEAR gt_special_group_line.

gt_special_group_line-sp_group = 'A'. <= it_fieldcat-sg_group =

‘A’.

gt_special_group_line-text = 'A Group'. <= TEXT

APPEND gt_special_group_line TO gt_special_group_table.

it_fieldcat을 정의시 sp_group = ‘A’ 로 지정된 필드를 Grouping을 한다 . 이것은 화면에

아래와같이

보여진다 . A Group을 선택하면It_fieldcat-sg_group = ‘A’ 로 정의된 필드만Hidden Field에 보여진다 .

Page 25: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

f. Alv_event 설명

Event를 처리하는 부분으로 Event명과 Form명을 써준다

정의 : Data: alv_events type slis_event.

값설정 : Data: ls_event type slis_alv_Event.

ls_event-name = ‘TOP_OF_PAGE’. <- Event Name

ls_event-form = ‘TOP-OF-PAGE’. <- Event발생시

수행하는 Form

append ls_event to alv_event.

FORM top-of-page.

format reset.

format intensified off.

write:/ text-002 centered.

ENDFORM. " TOP-OF-PAGE

Page 26: ALV  (Abap List Viewer)

2. YALV_02 출력화면 ( Checkbox 체크후 저장버튼을 눌렀을시 )

3. ALV Sample. ALV Sample

저장후 Checkbox Inactive

Page 27: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

• 체크박스를 선택하여 PF-STATUS의 “저장”버튼을 누르면 CallBack하여 FORM User_command를 수행하게

된다 .

체크박스가 선택되어 있으면 itab-box = ‘X’ 가 표기되어 있고 아래와 같이 수정후 Modify하면

itab-box = ‘1’ <= Checkbox가 Inactive

itab-box = ‘-’ <= Checkbox가 없어짐

itab-listinfo = ‘C01’. <= 라인 칼라지정

C : Default , 1~9 : Color , 1 : intensified display on 0: intensified

display off

rs_selfield-refresh = ‘X’. <= 화면 Refresh

Page 28: ALV  (Abap List Viewer)

3. YALV_03 입력화면

3. ALV Sample. ALV Sample

선택시

Page 29: ALV  (Abap List Viewer)

3. YALV_03 출력화면

3. ALV Sample. ALV Sample

Page 30: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_03 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' . <= YALV_01, YALV_02 Sample 참조 .

단 여기서 추가된 부분은 Variant부분으로

i_save = g_save

is_variant = g_variant 을 추가해주면 아래와 같은 화면이 추가된다 .

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' <= Default Variant를 구한

다 .

CALL FUNCTION 'REUSE_ALV_VARIANT_F4' <= F4 Help를 만든다 .

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE' <= 해당 Variant가 존재하는지를 체크한다

Page 31: ALV  (Abap List Viewer)

4. YALV_04 출력화면

3. ALV Sample. ALV Sample

Page 32: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_04 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT' <= 초기화시킴

EXPORTING

i_callback_program = g_repid <= Sy-repid

i_callback_user_command = g_user_command

i_callback_pf_status_set = g_status.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_HS_APPEND' <= 두개의 인터널 테이블 Display

EXPORTING

is_layout = alv_layout

it_fieldcat = it_fieldcat1

is_keyinfo = gt_keyinfo <= 뒷장 a 참조

i_header_tabname = 'IT_HEADER' <= Header 가 되는 Internal Table

i_item_tabname = 'IT_BODY' <= Body 가 되는 Internal Table

it_events = alv_events

TABLES

t_outtab_header = it_header <= Header internal Table

t_outtab_item = it_body. <= Body Internal Table

Page 33: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

it_fieldcat = it_fieldcat <= Field Catalog

is_layout = alv_layout

i_tabname = 'IT_BSEG' <= Append 하고자 하는 인터널 테이블

it_events = alv_events

it_sort = gt_sort_table <= Sort 순서

TABLES

t_outtab = it_bseg. <= Display 하고자 하는 테이블

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY' <= 화면에 출력한다

EXPORTING

is_print = gt_print. <= 뒷장 b 참조

Page 34: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

a. gt_keyinfo 설명

두개의 인터널 테이블의 연관성을 정의한다 .

정의 : DATA: gt_keyinfo TYPE slis_keyinfo_alv.

값설정 : gt_keyinfo-header01 = 'BELNR'. <= Header Table의 BELNR

Field와

gt_keyinfo-item01 = 'BELNR'. Body Table의

BELNR을 묶어서

Header Table의 BELNR을

기준으로 출력

b. gt_print 설명

프린트 Option을 설정한다 .

정의 : DATA: gt_print TYPE slis_print_alv.

Page 35: ALV  (Abap List Viewer)

5. YALV_05 출력화면

3. ALV Sample. ALV Sample

Page 36: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_05 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'Sample Test' <= Popup화면 Title

I_ZEBRA = 'X'

i_tabname = 'IT_BSEG' <= 사용할 인터널 테이블

IT_FIELDCAT = it_fieldcat <= Field Catalog

IMPORTING

ES_SELFIELD = ls_sel <= 선택되어진 라인정보

TABLES

t_outtab = it_bseg <= 출력되어질 인터널 테이블

* EXCEPTIONS

* PROGRAM_ERROR = 1

* OTHERS = 2

Page 37: ALV  (Abap List Viewer)

6. YALV_06 출력화면

3. ALV Sample. ALV Sample

Page 38: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

1. YALV_06 설명 - 사용된 함수

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid <= Sy-repid

i_callback_pf_status_set = g_status <= PF-STATUS

i_callback_user_command = g_user_command <= User_COMMAND

i_background_id = 'ALV_BACKGROUND' <= Back Ground

ID

* I_GRID_TITLE = '상세내역 '

is_layout = alv_layout <= Layout정의

it_fieldcat = it_fieldcat <= Field Catalog정의

it_sort = gt_sort_table <= Sort순서정의

i_save = g_save <= A, U:User-Specific

is_variant = g_variant <= Variant

it_events = alv_events <= Event 정의

TABLES

t_outtab = it_bseg. <= 실제 보여줄 테이블

Page 39: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' <= Default Variant를

가져온다

EXPORTING

i_save = g_save

CHANGING

cs_variant = gt_variant

EXCEPTIONS

not_found = 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'‘ <= F4 Help를 만든다 .

EXPORTING

is_variant = g_variant

i_save = g_save

it_default_fieldcat =

IMPORTING

e_exit = g_exit

es_variant = gt_variant

EXCEPTIONS

not_found = 2.

Page 40: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' <= List body comment block output

EXPORTING

* i_logo = 'HTMLCNTL_TESTHTM2_SAPLOGO'

* i_logo = 'ENJOYSAP_LOGO'

* i_logo = 'PMMN_LOGO'

i_logo = 'Z_YMS' <= Logo

it_list_commentary = gt_list_top_of_page. <= 아래 a 참조

a. gt_list_top_of_page 설명

Grid Control의 Header에 들어갈 내용을 인터널 테이블로 만든다 .

정의 : DATA: gt_list_top_of_page type slis_t_listheader.

값설정 : 여기서 gt_list_top_of_page-typ : H : Header / S : Selection / A : Action을

의미한다Header 부분

Selection 부분

Action 부분

Page 41: ALV  (Abap List Viewer)

3. ALV Sample. ALV Sample

값을 넣어줄때

* Header 정의

CLEAR lt_line.

lt_line-typ = 'H'. <= Header

lt_line-info = text-002. <= 전표리스트

APPEND lt_line TO it_top_of_page.

* Selection 정의

CLEAR lt_line.

lt_line-typ = 'S'. <= Selection

lt_line-key = text-003. <= 회사코드

lt_line-info = p_bukrs.

APPEND lt_line TO it_top_of_page.

lt_line-key = text-005. <= 전기기간

lt_line-info = lt_text.

APPEND lt_line TO it_top_of_page.

* Action 정의

CLEAR lt_line.

lt_line-typ = 'A'. <= Action

lt_line-info = 'Detail List'.

APPEND lt_line TO it_top_of_page.

Page 42: ALV  (Abap List Viewer)

ALV 의 기대되는 효과 .

a) 단 시간에 효율적인 레포트를 작성함으로써 일의 효율성을 높힌다 .

b) 하나의 레포트가 여러가지 기능을 제공함으로써 불 필요한 Add-on 프로그램을 줄일수 있다 .

c) 고객의 신뢰를 구축하고 다른 동종업계와 차별화를 이룬다 .

4. ALV 기대효과 . ALV 기대효과