Vous êtes sur la page 1sur 35

ALV DOCUMENTATION AND EXAMPLES11 Rajagopalan.

M
ALV (ABAP LIST VIEWER)
Sap provides a set of ALV (ABAP LIST VIEWER) function modules, !ic! can "e put into
use to em"ellis! t!e output of a report# T!is set of ALV functions is used to en!ance t!e
reada"ilit$ and functionalit$ of an$ report output# %ases arise in sap !en t!e output of a
report contains columns e&tendin' more t!an ()) c!aracters in len't!# In suc! cases, t!is set
of ALV functions can !elp c!oose selected columns and arran'e t!e different columns from a
report output and also save different variants for report displa$# T!is is a ver$ efficient tool
for d$namicall$ sortin' and arran'in' t!e columns from a report output# T!e report output can
contain upto *+ columns in t!e displa$ it! t!e ide arra$ of displa$ options#
T!e commonl$ used ALV functions used for t!is purpose are,
-# RE.SE/ALV/VARIA0T/1E2A.LT/3ET
(# RE.SE/ALV/VARIA0T/24
5# RE.SE/ALV/VARIA0T/E6ISTE0%E
4# RE.SE/ALV/EVE0TS/3ET
)# RE.SE/ALV/%788E0TAR9/WRITE
:# RE.SE/ALV/2IEL1%ATAL73/8ER3E
;# RE.SE/ALV/LIST/1ISPLA9
<# RE.SE/ALV/3RI1/1ISPLA9
*# RE.SE/ALV/P7P.P/T7/SELE%T
T!e different steps used for 'ettin' t!e a"ove function modules into use are =
Step 1
DATA DECLARATION
Sap standard t$pe pools= SLIS , >>BL7 #
Sap standard ta"les t$pes ta?en from t!e t$pe pools are= SLIS/LA97.T/ALV ,
SLIS/T/2IEL1%AT/ALV,
SLIS/T/LIST@EA1ER,
SLIS/T/EVE0T,
SLIS/SEL2IEL1#
Internal ta"les to used in t!e pro'ram declared "ased on t!e a"ove ta"le t$pes
1ATA= I/LA97.T T9PE SLIS/LA97.T/ALV,
I/2IEL1TAB T9PE SLIS/T/2IEL1%AT/ALV,
I/@EA1I03 T9PE SLIS/T/LIST@EA1ER,
I/EVE0TS T9PE SLIS/T/EVE0T#
T9PES= >>BL7/SEL2IEL1 T9PE SLIS/SEL2IEL1#
Step 2 (Optional)
1 of 35
ALV DOCUMENTATION AND EXAMPLES22 Rajagopalan. M
SELECTING THE VARIANTS FOR INITIAL LIST DISPLA (DEFA!LT
VARIANT)
T!e variants in t!e list displa$ can "e "ot! userAspecific and 'eneral# T!e user can pro'rammaticall$ set
t!e initial (default) variant for list displa$#
T!e default variant can "e found usin' t!e function module
BRE.SE/ALV/VARIA0T/1E2A.LT/3ETB#
Sample code=
%ALL 2.0%TI70 BRE.SE/ALV/VARIA0T/1E2A.LT/3ETB
E6P7RTI03
i/save C variant save condition ( ACall, . C userAspecific )
%@A03I03
cs/variant C internal ta"le containin' t!e pro'ram name (and t!e default variantAAAoptional )
E6%EPTI70S
not/found C (#
T!e user can also c!oose from t!e list of e&istin' variants usin' t!e function module
DRE.SE/ALV/VARIA0T/24E#
Step "
DEFININING O!TP!T CHARACTERISTICS# PREPARING DISPLA FIELDS
CATALOG
A field catalo' is prepared usin' t!e internal ta"le (I/2IEL1%AT) of t$pe
SLIS/T/2IEL1%AT/ALV# 2ield catalo' containin' descriptions of t!e list output fields
(usuall$ a su"set of t!e internal output ta"le fields)#
A field catalo' is reFuired for ever$ ALV list output to add desired functionalit$ (i#e# >e$,
@otspot, Specific !eadin's, Gustif$, %ol# position etc) to certain fields of t!e output# If not
mentioned specificall$, t!en t!e defaults are ta?en# T!e possi"le values and defaults are listed
"elo#
T!e field catalo' for t!e output ta"le is "uiltAup in t!e callerBs codin'# T!e "uildAup can "e
completel$ or partiall$ automated "$ callin' t!e RE.SE/ALV/2IEL1%ATAL73/8ER3E
module#
T!e minimal field catalo' is documented "elo# T!is can "e done in a routine usin' a local
varia"le# T!e user can use t!e ot!er optional parameters to assi'n output attri"utes to different
fields in t!e output, !ic! differ from t!e default#
A field catalo' need not "e "uiltAup and passed e&plicitl$ onl$ under t!e folloin'
conditions=
-# T!e internal ta"le to "e output !as t!e same structure as a 1ata 1ictionar$ structure
!ic! is referred to in t!e internal ta"le declaration usin' LI>E or I0%L.1E
STR.%T.RE# In t!is case t!e attri"utes of t!e different fields is ta?en directl$ from
t!e ta"le and t!e attri"utes (?e$ fields, len't!, te&ts etc) need to state e&plicitl$#
(# all fields in t!is structure are to "e output
5# T!e structure name is passed to ALV in t!e parameter I/STR.%T.RE/0A8E of
t!e function module RE.SE/ALV/LIST/1ISPLA9#
All t!e values entered in t!e catalo' is specific to t!e particular field !ose name is entered in
t!e fieldname 2IEL10A8E of t!e fieldcat structure# T!e name of t!e ta"le is also entered in
t!e corr# 2ieldname TAB0A8E of t!e structure#
2 of 35
ALV DOCUMENTATION AND EXAMPLES33 Rajagopalan. M
T!e different possi"le attri"utes are=
Ro/pos (ro position)= 7nl$ relevant if t!e list output is to "e multiAline (to or
t!ree lines) "$ default# So, t!is attri"ute can "e used maintain certain level of
ali'nment in t!e output#
Value set= +, - H 5
%ol/pos (column position)= T!is parameter is relevant !en t!e fields in t!e
output are to "e different from t!e seFuence of t!e fields in t!e internal ta"le used
for displa$# T!e parameter specifies t!e relative column position of t!e field
in t!e list output# T!e column order can "e c!an'ed interactivel$ "$ t!e user# If
t!is parameter is initial for all field catalo' entries, columns appear in t!e internal
ta"le field seFuence#
Value set= +, - H :+
2ieldname (field name)= T!is is t!e name of t!e internal ta"le field for !ic! t!e
parameters are passed in t!e catalo'#
Value set= internal output ta"le field name (reFuired parameter)

Ta"name (internal output ta"le)= 0ame of t!e internal output ta"le t!at contains
t!e field 2IEL1%ATA2IEL10A8E a"ove#
Value set= SPA%E, internal output ta"le name#
Ref/fieldname (reference field name)= 0ame of t!e 1ata 1ictionar$ field referred
to# T!is parameter is onl$ used !en t!e internal output ta"le field descri"ed "$
t!e current field catalo' entr$ !as a reference to t!e 1ata 1ictionar$ (not a
pro'ram field), and t!e field name in t!e internal output ta"le is different from t!e
name of t!e field in t!e 1ata 1ictionar$# If t!e field names are identical,
namin' t!e 1ata 1ictionar$ structure or ta"le in t!e 2IEL1%ATA
RE2/TAB0A8E parameter is sufficient#
Value set= SPA%E, 1ata 1ictionar$ field name#
Ref/ta"name (reference ta"leIstructure field name)= Structure or ta"le name of
t!e referred 1ata 1ictionar$ field# T!is parameter is onl$ used !en t!e
internal output ta"le field descri"ed "$ t!e current field catalo' entr$ !as a 1ata
1ictionar$ reference (not a pro'ram field)#
Value set= SPA%E, name of a 1ata 1ictionar$ structure or ta"le

Lin? to currenc$ unit
%fieldname (currenc$ unit field name)= T!is is used for currenc$ fields t!at !ave
a reference to an$ unit field# T!is is onl$ relevant for amount columns it!
associated unit# T!is parameter contains t!e 0ame of t!e internal output ta"le
field containin' t!e currenc$ unit associated it! t!e amount field 2IEL1%ATA
2IEL10A8E# T!e field in 2IEL1%ATA%2IEL10A8E must !ave its on field
catalo' entr$#
Value set= SPA%E, output ta"le field name
%ta"name (internal currenc$ unit field output ta"le)= 0ame of t!e internal output
ta"le containin' t!e 2IEL1%ATA%2IEL10A8E field#
Value set= SPA%E, output ta"le field name#
Lin? to measurement unit
3 of 35
ALV DOCUMENTATION AND EXAMPLES44 Rajagopalan. M
Jfieldname (measurement unit field name)= 7nl$ relevant for Fuantit$ columns
it! unit lin?# 0ame of t!e internal output ta"le field containin' t!e measurement
unit associated it! t!e Fuantit$ field 2IEL1%ATA2IEL10A8E# T!e field in
2IEL1%ATAJ2IEL10A8E must !ave its on field catalo' entr$#
Value set= SPA%E, output ta"le field name#
Jta"name (internal measurement unit field output ta"le)= 0ame of t!e internal
output ta"le containin' t!e 2IEL1%ATAJ2IEL10A8E field#
Value set= SPA%E, output ta"le field name#
7utputlen (column idt!)= T!is parameter is used if t!e desired output len't! for
a field is desired to "e different from t!e internal output ta"le field# 2or fields
it! a 1ata 1ictionar$ lin? t!is parameter can "e left initial# 2or fields it!out a
1ata 1ictionar$ lin? (pro'ram field) t!e parameter must "e 'iven t!e value of t!e
desired field list output len't! (column idt!)#
Initial C column idt! is t!e output len't! of t!e referred 1ata 1ictionar$ field
(domain)#
0 C column idt! is n c!aracters#
Value set= + (initial), n#
>e$ (?e$ column)= B$ default, t!e s$stem ma?es some fields in t!e output as ?e$
fields, provided t!e fields are ?e$ fields in t!eir referencin' ta"le# .sin' t!is
parameter, fields ot!er t!an ?e$ fields of t!e referencin' ta"le can "e made ?e$
field# T!is parameter is most important if t!e output needs to contain some field
!ic! are not scrolla"le or cannot "e !idden#
If t!e internal output ta"le contains fields t!at are ?e$ fields from different ta"les,
t!en all t!ose fields in t!e report output "ecomes unscrolla"le and cannot "e
!idden# So, t!e fields in t!e output internal ta"le s!ould not "e referenced from
ta"les in !ic! t!e$ are ?e$ fields# Instead, t!e$ s!ould "e referenced to t!e
ta"les in !ic! t!e$ are not ?e$ fields, incase t!e$ are not desired as ?e$ field in
t!e output#
B6B C ?e$ field (?e$ field output in color) and >e$ fields can not "e interactivel$
!idden# Parameter 2IEL1%ATA07/7.T must "e left initial#
Value set= SPA%E, B6B#
>e$/sel (!idea"le ?e$ column)= T!is parameter is onl$ relevant for t!e fields
!ic! are made ?e$ fields usin' 2IEL1%ATA>E9 C B6B# .sin' t!is parameter t!e
>e$ field can "e !idden interactivel$#
T!e ?e$ column seFuence cannot "e c!an'ed interactivel$ "$ t!e user# T!e
output is controlled "$ t!e 2IEL1%ATA07/7.T parameter analo'ousl$ to nonA
?e$ fields#
Value set= SPA%E, B6B#
0o/out (field in field list)= T!is parameter is used to remove certain fields from
t!e output durin' initial displa$# T!e user can !oever interactivel$ c!oose t!e
field for output from t!e field list in t!e displa$ variant#
B6B C field is not displa$ed in t!e current list#
Value set= SPA%E, B6B#
Tec! (tec!nical field)= T!is parameter is used to ma?e certain field displa$ onl$
in t!e field catalo'# T!e fields it! t!is parameter set cannot "e output in t!e list
nor can t!e$ "e displa$ed interactivel$ from t!e catalo'#
B6B C tec!nical field#
Value set= SPA%E, B6B#
4 of 35
ALV DOCUMENTATION AND EXAMPLES55 Rajagopalan. M
Emp!asiKe (!i'!li'!t columns in color)= As name su''ests, t!is field parameter is
used to !i'!li'!t certain field it! c!osen colors#
Value set= SPA%E, B6B or B%&$KB (&=B-BAB*B, $,K= B+BCoff ,B-BCon)#
B6B C column is colored it! t!e default column !i'!li'!t color#
B%&$KB C column is colored it! a coded color=
A %= %olor (codin' must "e'in it! %)
A 6= color num"er
A 9= "old
A L= inverse
@otspot (column as !otspot)= T!is parameter is used to ma?e certain field appear
as !otspot i#e# a !and is displa$ed if t!e cursor is positioned on t!e field value#
Sin'le clic? on suc! fields cause t!e PI%> 7R 2( events to !appen#
Value set= SPA%E, B6B#
B6B C column cells are output as !otspots#
2i&/column (fi& column)= T!is parameter is used to fi& certain columns in t!e
output# All columns to "e fi&ed must !ave t!is fla', startin' from t!e left# If a
column it!out t!is fla' is output, onl$ t!e columns to t!e left of t!is column are
fi&ed# T!e user can c!an'e t!e column fi&in' interactivel$#
Value set= SPA%E, B6B#
B6B C column fi&ed (does not scroll !oriKontall$)#

1o/sum (sum over column)= t!e user can also call t!is function interactivel$#
Value set= SPA%E, B6B#
B6B C a sum is calculated over t!is internal output ta"le field#
0o/sum (sums for"idden)= 0o sum can "e calculated over t!is field, alt!ou'! t!e
data t$pe of t!e field ould allo summin'#
Value set= SPA%E, B6B#
Icon= T!e parameter displa$s certain column contents as icons# T!e internal
output ta"le column contents must "e valid icon strin's#
Value set= SPA%E, B6B#
B6B C column contents to "e output as an icon#
S$m"ol= T!e internal output ta"le column must "e a valid s$m"ol c!aracter#
Value set= SPA%E, B6B
B6B C column contents are to "e output as a s$m"ol#
Gust (Mustification)= T!is parameter is used for ali'nment of t!e contents of t!e
output ta"le# T!is is onl$ relevant for %@AR or 0.8% fields in t!e output
internal ta"le# T!e Mustification of t!e column !eader ala$s follos t!e
Mustification of t!e columns# Independent Mustification of t!e column !eader is not
possi"le#
Value set= SPA%E, BRB, BLB, and D%E#
B B C 1efault Mustification for t!is data t$pe
BRB C ri'!tAMustified output
BLB C leftAMustified output
B%B C centered output#

5 of 35
ALV DOCUMENTATION AND EXAMPLES66 Rajagopalan. M
LKero (leadin' Keros)= B$ default ALV outputs 0.8% fields ri'!tAMustified
it!out leadin' Keros# .sin' t!is parameter onl$ t!e 0.8% fields can "e
displa$ed it! leadin' Keroes#
Value set= SPA%E, B6B#
B6B C output it! leadin' Keros#
0o/si'n (no NIA si'n)= T!is parameter is used to suppress t!e si'ns of t!e output
fields# It is onl$ relevant for t!e value fields#
Value set= SPA%E, B6B#
B6B C value output it!out NI si'n#
0o/Kero (suppress Keros)= 7nl$ relevant for value fields#
Value set= SPA%E, B6B#
B6B C suppress Keros#
Edit/mas? (field formattin')= To appl$ t!e report output formattin' options same
as in t!e WRITE statement in report ritin'#
Value set= SPA%E, template#

T!e folloin' parameters are used for customiKin' t!e te&ts in t!e !eadin' of t!e output of
t!e columns# T!e te&ts are ta?en from t!e 1ata 1ictionar$ for fields it! a 1ata 1ictionar$
reference# If t!is is not desired, t!e te&t parameters can also "e specified# T!e 1ata 1ictionar$
te&ts are t!en i'nored#
If t!e user c!an'es t!e column idt! interactivel$, t!e column !eader te&t it! t!e
appropriate len't! is ala$s used#
T$e inte%a&ti'e ()n&tion *Opti+i,e &ol)+n -i.t$* ta/e0 a&&o)nt o( 1ot$ t$e (iel.
&ontent0 an. t$e &ol)+n $ea.e%0# i( all (iel. &ontent0 a%e 0$o%te% t$an t$e 0$o%te0t
&ol)+n $ea.e%2 t$e &ol)+n -i.t$ .epen.0 on t$e &ol)+n $ea.e%3
T!e Blon' field la"elB is also used in displa$ variant definition,
Sort, etc# Popup#
selte&t/l (lon' field la"el)
selte&t/m (medium field la"el)
selte&t/s (s!ort field la"el)
repte&t/ddic(!eader) Analo'ous to t!e 1ata element main !eader
1dict&t (specif$ te&t) = 9ou can specif$ it! values BLB, B8B, and BSB, t!e ?e$ord
t!at s!ould ala$s "e used as column !eader# If t!e column idt! c!an'es, no
attempt is made in t!is case to find an appropriate !eader for t!e ne output
idt!#
Value set= SPA%E, BLB, B8B, and DSE#
Sample code=
Suppose I/P7/1ETAILS is an internal ta"le containin' to fields EBEL0 (P7 num"er) and
EBELP (P7 item no)#
1ATA= L/2IEL1%AT T9PE SLIS/2IEL1%AT/ALV# OLocal varia"le to !old t!e
parameters
for a particular field of t!e field
catalo'
6 of 35
ALV DOCUMENTATION AND EXAMPLES Rajagopalan. M
%LEAR L/2IEL1%AT#
L/2IEL1%ATATAB0A8E C BI/P7/1ETAILSB#
L/2IEL1%ATA2IEL10A8E C BEBEL0B#
L/2IEL1%ATA>E9 C B6B# OT!e P7 no is made t!e ?e$ field,
O%olored and non scrolla"le
L/2IEL1%ATA@7TSP7T C B6B# OT!e po no "ecomes a !otspot
L/2IEL1%ATASELTE6T/S C DP#7 0oE#
L/2IEL1%ATASELTE6T/8 C BP order 0oB#
L/2IEL1%ATASELTE6T/L C BPurc!ase order 0oB#
APPE01 L/2IEL1%AT T7 I/2IEL1TAB#
%LEAR L/2IEL1%AT

L/2IEL1%ATATAB0A8E C BI/P7/1ETAILSB#
L/2IEL1%ATA2IEL10A8E C BEBEL0B#
L/2IEL1%ATA>E9 C B6B# OT!e po item no is made t!e ?e$ field,
O%olored and non scrolla"le
L/2IEL1%ATASELTE6T/S C BItem 0oB#
L/2IEL1%ATASELTE6T/8 C BItem 0oP#
L/2IEL1%ATASELTE6T/L C BP7 Item 0oB#
APPE01 L/2IEL1%AT T7 I/2IEL1TAB#
%LEAR L/2IEL1%AT
T!us t!e catalo' for t!e report output is prepared#
Step 4
T!e ne&t step is to "uild an event ta"le, !ic! are used for firin' "ot! user commands and t!e
s$stem dependent events i#e# top of pa'e, end of pa'e etc#
A list of possi"le events is populated into an event ta"le (I/EVE0TS) !en t!is ta"le is
passed to t!e function module RE.SE/ALV/EVE0T/0A8ES/3ET# T!e return ta"le from
t!is function module contains all t!e possi"le events#
T!e function module contains folloin' import and e&port parameters#
I8P7RTI03 PARA8ETERS= I/LIST/T9PE
T!is parameter !as possi"le values from +A4#
T!e parameter I/LIST/T9PE is of T9PE SLIS/LIST/T9PE and is 1E2A.LT + #
E6P7RTI03 PARA8ETERS= I/EVE0TS ta"le#
T!is ta"le is of T9PE SLIS/T/EVE0T and returns to t!e pro'ram t!e name of all t!e
possi"le events#
T!e ta"le structure contains t!e fields=
I/EVE0TSA0A8E= 0ame of t!e %all"ac? event#
I/EVE0TSA27R8= 0ame of t!e form routine t!at s!ould "e called in t!e callin'
pro'ram at t!e event#
7nl$ events it! a form routine name are processed#
T!e I/EVE0TS ta"le returns it! t!e folloin' possi"le constants=
13 Sli05e'5ite+5.ata5e6pan. TPE 0li05(o%+na+e VAL!E
*ITE75DATA5E8PAND*3
7 of 35
ALV DOCUMENTATION AND EXAMPLES!! Rajagopalan. M
7nl$ relevant for !ierarc!icalAseFuential lists usin' t!e la$out parameter
IS/LA97.TAE6PA01/2IEL10A8E of t!e structure IS/LA97.T# E&it for
passin' item entries (ITE8 ta"le) for a !eader record t!at as e&panded
interactivel$ "$ t!e user#
23 Sli05e'5%ep%ep50el5+o.i(9 TPE 0li05(o%+na+e VAL!E
*REPREP5SEL57ODIF*3
RS/SEL2IEL1ATABI01E6 contains t!e !eader ta"le inde& for !ic! t!e item
entries are to "e put in t!e 'lo"al item output ta"le (T/7.TTAB/SLAVE)# T!e
%all"ac? is onl$ called if ALV !as no items for a !eader t!at is to "e e&panded#
R2L3/ALL is passed it! B6B if t!e user s!os all items# T!e application must
ensure t!at entries are not repeated in t!e item ta"le#
RS/SEL2IEL1 is initial in t!is case#
"3 Sli05e'5&alle%5e6it5at50ta%t TPE 0li05(o%+na+e VAL!E *CALLER5E8IT*3
Is called at t!e "e'innin' of t!e function module to ma?e special settin's# It is not
usuall$ used#
43 Sli05e'5)0e%5&o++an. TPE 0li05(o%+na+e VAL!E *!SER5CO77AND*3
As t!is is a freFuentl$Aused %all"ac? event, t!e form routine can also "e passed
directl$ in t!e interface "$ passin' t!e user command in t!e I8P7RTI03
parameter I/%ALLBA%>/.SER/%788A01#
:3 Sli05e'5top5o(5pa;e TPE 0li05(o%+na+e VAL!E *TOP5OF5PAGE*3
EFuivalent to t!e list processin' T7PA72APA3E event#
<3 Sli05e'5top5o(5&o'e%pa;e TPE 0li05(o%+na+e VAL!E *TOP5OF5COVERPAGE*3
T!e selection information and list status are output to'et!er (if t!e$ e&ist) on
a separate pa'e "$ default
=3 Sli05e'5en.5o(5&o'e%pa;e TPE 0li05(o%+na+e VAL!E
*END5OF5COVERPAGE*3
Analo'ousl$ to T7P/72/%7VERPA3E t!e user can add ot!er information
to t!e information output "$ ALV (selection information, list status) at t!is
event#
>3 Sli05e'5(o%ei;n5top5o(5pa;e TPE 0li05(o%+na+e VAL!E
?FOREIGN5TOP5OF5PAGE*3
T!e TopAofApa'e event is ala$s processed in ALV and is onl$ passed to t!e
caller via t!e %all"ac? mec!anism# T!is is still t!e case if t!e caller, e#'# "$ a
user action, processes a "ranc! list !ic! as not formatted "$ ALV (e#'# a
popup it! additional information a"out t!e list record selected and
displa$ed "$ ALV)#
In t!is case, topAofApa'e cannot "e formatted "$ ALV analo'ousl$ to t!e
"asic list, it must "e !andled completel$ "$ t!e caller# T!e event topAofApa'e
still occurs in ALV# W!en ALV notices a topAofApa'e !ic! as not caused
"$ an ALV output, t!e form routine in 27REI30/T7P/72/PA3E is called#
@3 Sli05e'5(o%ei;n5en.5o(5pa;e TPE 0li05(o%+na+e VAL!E
*FOREIGN5END5OF5PAGE*3
T!e event endAofApa'e is ala$s processed in ALV and onl$ passed to t!e
caller via call"ac?# T!is is still t!e case, e#'# !en t!e caller processes a
details list !ic! as not formatted "$ ALV (e#'# a popup it! furt!er
information a"out selected list records !ic! ere displa$ed "$ ALV)#
In t!is case, endAofApa'e cannot "e formatted "$ ALV analo'ousl$ to t!e
"asic list, it must "e !andled completel$ "$ t!e caller# T!e event endAofApa'e
still occurs in ALV# W!en ALV notices an endAofApa'e t!at as not caused
"$ an ALV output, t!e form routine in 27REI30/E01/72/PA3E is called#
1A3 Sli05e'5p(50tat)050et TPE 0li05(o%+na+e VAL!E *PF5STAT!S5SET*3
If a user list status is to "e set, it must "e done in t!e form routine assi'ned to
t!is event# T!e ALV function codes, !ic! must not "e active, are in t!e
8 of 35
ALV DOCUMENTATION AND EXAMPLES"" Rajagopalan. M
Parameter RT/E6TAB# T!is ta"le must "e passed it! t!e SET P2ASTAT.S
command (it! inactive user function codes as ell, if necessar$)#
T!e STA01AR1 status of t!e function 'roup SALV s!ould "e used as a
template for a userAspecific status# As t!is is a freFuentl$ used %all"ac?
event, its form routine can also "e passed directl$ in t!e interface in t!e
I8P7RTI03 parameter I/%ALLBA%>/P2/STAT.S/SET#
113 Sli05e'5li0t5+o.i(9 TPE 0li05(o%+na+e VAL!E *LIST57ODIF*3
LIST/871I29 .SI03 R/TAB0A8E T9PE SLIS/TAB0A8E
R/I01E6 LI>E S9ATABI6
R/I01E6/ITE8 LI>E S9ATABI6
R/I01E6/S.8 LI>E S9ATABI6#
123 Sli05e'5top5o(5li0t TPE 0li05(o%+na+e VAL!E *TOP5OF5LIST*3
Information output at t!e start of t!e list
1"3 Sli05e'5en.5o(5pa;e TPE 0li05(o%+na+e VAL!E *END5OF5PAGE*3
Information output at t!e end of a pa'e# T!is is onl$ called for printin'#
143 Sli05e'5en.5o(5li0t TPE 0li05(o%+na+e VAL!E *END5OF5LIST*3
Information output at t!e end of t!e list
1:3 Sli05e'5a(te%5line5o)tp)t TPE 0li05(o%+na+e VAL!E
*AFTER5LINE5O!TP!T*3
7utput information after eac! output line# S!ould onl$ "e used in Mustified
cases "ecause it costs a lot of performance#
1<3 Sli05e'51e(o%e5line5o)tp)t TPE 0li05(o%+na+e VAL!E
*BEFORE5LINE5O!TP!T*3
7utput information "efore eac! output line# S!ould onl$ "e used in Mustified
cases "ecause it costs a lot of performance#
1=3 Sli05e'50)1total5te6t TPE 0li05(o%+na+e VAL!E *S!BTOTAL5TE8T*3
T!is event ta"le (I/EVE0TS) is no c!ec?ed it! t!e desired constants# If t!e desired
constant is found, t!en t!e correspondin' field for t!e 27R8 0A8E is populated it! t!e
name of t!e routine containin' t!e correspondin' event#
Sa+ple &o.e #
27R80A8E/T7P/72/PA3E T9PE SLIS/27R80A8E VAL.E BT7P/72/PA3EB,
27R80A8E/E01/72/PA3E T9PE SLIS/27R80A8E VAL.E BE01/72/PA3EB,
27R80A8E/.SER/%788A01 T9PE SLIS/27R80A8E VAL.E
B.SER/%788A01B#
1ATA= L/I/EVE0T T9PE SLIS/ALV/EVE0T#
%ALL 2.0%TI70 BRE.SE/ALV/EVE0TS/3ETB
E6P7RTI03
I/LIST/T9PE C +
I8P7RTI03
ET/EVE0TS C I/EVE0TS#
REA1 TABLE I/EVE0TS WIT@ >E9 0A8E C SLIS/EV/T7P/72/PA3E
I0T7 L/I/EVE0T#
I2 S9AS.BR% C +#
87VE 27R80A8E/T7P/72/PA3E T7 L/I/EVE0TA27R8#
APPE01 L/I/EVE0T T7 I/EVE0TS#
E01I2#
REA1 TABLE I/EVE0TS WIT@ >E9 0A8E C SLIS/EV/E01/72/PA3E
I0T7 L/I/EVE0T#
9 of 35
ALV DOCUMENTATION AND EXAMPLES1#1#
Rajagopalan. M
I2 S9AS.BR% C +#
87VE 27R80A8E/E01/72/PA3E T7 L/I/EVE0TA27R8#
APPE01 L/I/EVE0T T7 I/EVE0TS#
E01I2#
%LEAR L/I/EVE0T#
REA1 TABLE I/EVE0TS WIT@ >E9 0A8E C SLIS/EV/.SER/%788A01
I0T7 L/I/EVE0T#
I2 S9AS.BR% C +#
87VE 27R80A8E/.SER/%788A01 T7 L/I/EVE0TA27R8#
APPE01 L/I/EVE0T T7 I/EVE0TS#
E01I2#
T!is ill prepare t!e events ta"le for t!e report#
T!e report ill contain t!ree forms for t!e a"ove events=
-# 27R8 T7P/72/PA3E = T!is form ill contain t!e top of pa'e event for t!e report i#e
!eader etc
.sin' t!e function module DRE.SE/ALV/%788E0TAR9/WRITEE, t!e internal ta"le
containin' t!e !eadin's for top of pa'e event can "e passed to t!e list output# Also, an$
lo'o specific to t!e report can "e passed to t!e function module#
(# 27R8 E01/72/PA3E = T!is form ill contain t!e end of pa'e event for t!e report i#e
footer etc
5# 27R8 .SER/%788A01 = T!is form ill contain t!e desired user command i#e
pic?Iline selection
Step :
A la$out is "uild for t!e report output list description .SI03 t!e internal ta"le declared a"ove
(I/LA97.T)#
7utput list description structure#
T!e parameters are descri"ed under t!e folloin' !eads=
1ispla$ options
E&ceptions
Totals
Interaction
1etail screen
1ispla$ variants (onl$ for !ierarc!icalAseFuential lists)
%olor
7t!er
T!e la$out ta"le is of t$pe slis/la$out/alv/spec and !as t!e folloin' fields=

1ispla$ options
-# %olidt!/optimiKe (-) T9PE c= T!is parameter optimiKes t!e len't! of t!e
different columns in t!e output# T!e idt! of t!e different col# no depends on t!e
ma&# Len't! of t!e data in t!e column#
Value set= SPA%E, B6B
B6B C optimiKes t!e column idt! so t!at all contents are displa$ed completel$#
(# 0o/col!ead(-) T9PE c = T!is parameter suppresses t!e column !eadin's
Value set= SPA%E, B6B#
B6B C column !eaders are not output
5# 0o/!otspot(-) T9PE c = T!e !eadin' of t!e report output are not output as
!otspot#
10 of 35
ALV DOCUMENTATION AND EXAMPLES1111
Rajagopalan. M
Value set= SPA%E, B6B#
B6B C column !eaders are not output as !otspot
4# Le"ra(-) T9PE c = T!e report is output in t!e striped pattern#
Value set= SPA%E, B6B#
B6B C striped pattern (e#'# for ide lists)
)# 0o/vline(-) T9PE c = T!e report output contains columns onl$ separated "$ space
and no lines# It is not relevant for= !ierarc!icalAseFuential lists and multipleAline lists#
Value set= SPA%E, B6B#
B6B C columns separated "$ SPA%E
:# 0o/min/linesiKe(-) T9PE c = T!e report line siKe is eFual to t!e idt! of t!e list#
It is not relevant for "loc? lists#
Value set= SPA%E, B6E#
B6B C line siKe depends on list idt!
B B C Line siKe is set to <+ or 8I0/LI0ESILE (if Q +) #
;# 8in/linesiKe LI>E s$AlinsK= T!e report output contains a minimum possi"le len't!
of line# If initial min/linesiKe is set to <+ "$ default, t!en t!is parameter is used to
customiKe it# T!e prereFuisite for t!is is t!at t!e parameter no/min/linesiKe s!ould "e
B B#
Value set= +, -+ A ()+
If t!e list is ider, t!e format uses t!e list idt! (ma&imum ()+ or 8A6/LI0ESILE
(if Q +))#
<# 8a&/linesiKe LI>E s$AlinsK= T!e default ma&# LinesiKe is ()+# To c!an'e t!is
default value, t!is parameter can interactivel$Adefine t!e ma&imum list idt! settin'#
Value set= +, <+ A -+(+
*# Windo/title"ar LI>E rsmpeAtitte&t= To set t!e title"ar on t!e report output#
-+# 0o/uline/!s(-) T9PE c#

E&ceptions
--# Li'!ts/fieldname T9PE slis/fieldname= Internal output ta"le field containin' t!e
codes of e&ceptions to "e output#
7utput ta"le field code= B-B C red traffic li'!t
B(B C $ello traffic li'!t
B5B C 'reen traffic li'!t 2ieldname for e&ception
Value set= SPA%E, internal output ta"le field name#

-(# Li'!ts/ta"name T9PE slis/ta"name= 0ame of t!e internal output ta"le t!at
contains t!e field in t!e parameter LI3@TS/2IEL10A8E# If
LI3@TS/2IEL10A8E is not empt$, t!is field must also "e filled for !ierarc!icalA
seFuential lists# 7nl$ relevant for !ierarc!icalAseFuential lists#
# Value set= SPA%E, internal output ta"le name#
-5# Li'!ts/rollname LI>E dfiesArollname= T!e documentation of t!is data element is
displa$ed !en $ou call 2- !elp for an e&ception column#
Value set= SPA%E, data element name#
-4# Li'!ts/condense(-) T9PE c = If a list record is output it! Bred traffic li'!tB, eac!
Su"total t!at includes t!is record is also output it! Bred traffic li'!tB#
Value set= SPA%E, B6B
B6B C t!e Bma&imumB e&ception of t!e items in t!e su"total is output at su"total level#
11 of 35
ALV DOCUMENTATION AND EXAMPLES1212
Rajagopalan. M
Sums
-)# 0o/sumc!oice(-) T9PE c = T!is parameter allos t!e c!oice for summin' up
7nl$ "$ fieldcatalo'#
Value set= SPA%E, B6B
B6B C fields !ic! are to "e summed, passed "$ t!e callin' pro'ram (2IEL1%ATA
17/S.8 C B6B)# T!e user s!ould not "e a"le to c!an'e t!is value interactivel$#
-:# 0o/totalline(-) T9PE c = Removes t!e option of !avin' totals after su"Atotals#
Value set= SPA%E, B6B
B6B C no total record is to "e output# Su"totals can still "e calculated and output# T!e
fields in t!e su"totals are fla''ed 17/S.8 C B6B in t!e field list#
-;# 0o/su"c!oice(-) T9PE c = 1oes not allo t!e user to interactivel$ c!an'e t!e
field c!osen for su"totals#
Value set= SPA%E, B6B
B6B C value !ose c!an'e tri''ers su"totals, provided "$ t!e callin' pro'ram# T!e
user s!ould not "e a"le to c!an'e t!is value interactivel$#

-<# 0o/su"totals(-) T9PE c = 0o su"totals possi"le
Value set= SPA%E, B6B
B6B C no su"totals#
-*# 0umc/sum(-) T9PE c = Totals onl$ possi"le for 0.8%A2ields#
(+# 0o/unit/splittin' T9PE c= 0o separate total lines "$ in!#units
(-#totals/"efore/items T9PE c= 1ispla$ totals "efore t!e items
((# Totals/onl$(-) T9PE c = S!o onl$ totals
Value set= SPA%E, B6B
B6B C onl$ total records are output#
(5# Totals/te&t(:+) T9PE c = Te&t for -st col# in totals
Value set= SPA%E, strin' (ma&#:+)
B B C T!e first column in t!e total record contains an appropriate num"er of BRBs to
indicate t!e total "$ default# If t!e first column is ide enou'!, t!e strin' BTotalB is
output after t!e asteris?s#
BStrin'E C T!e strin' passed is output after t!e total indicated "$ BRB, if t!e column is
ide enou'!#
(4# Su"totals/te&t(:+) T9PE c = Te&ts for su"totals
Value set= SPA%E, strin' (ma&#:+)
B B C In t!e first column of su"total records, t!e su"total is indicated "$ an appropriate
num"er of BRB "$ default# If t!e first column is not a su"total criterion, t!e strin' BTotalB
is output after t!e asteris?s, if t!e column is ide enou'!#
BStrin'E C t!e strin' passed is output after t!e su"total indicated "$ BRB, if t!e column is
ide enou'! and t!e first column is not a su"total criterion# If it is a su"total
criterion, its value is repeated after t!e total, if t!e column is ide enou'!#
Interaction
()# Bo&/fieldname T9PE slis/fieldname= 2ieldname for c!ec?"o& in t!e report
output# If t!e list !as c!ec?"o&es at t!e start of records (for selectin' several records),
t!is parameter contains t!e internal output ta"le field name indicated "$ t!e c!ec?"o&
12 of 35
ALV DOCUMENTATION AND EXAMPLES1313
Rajagopalan. M
selection column# T!e field is a c!ec?"o& at t!e start of list records it!out a list
!eader#
Value set= SPA%E, internal output ta"le field name

(:# Bo&/ta"name T9PE slis/ta"name= 0ame of t!e internal output ta"le t!at contains
t!e field in t!e parameter B76/2IEL10A8E# If B76/2IEL10A8E is not empt$,
t!is field must also "e filled for !ierarc!icalAseFuential lists#
Value set= SPA%E, internal output ta"le name#
(;# Bo&/rollname LI>E dd+5pArollname= rollname for c!ec?"o&
(<# E&pand/fieldname T9PE slis/fieldname= fieldname fla' De&pandE# T!e user can
s!o or !ide t!e items "$ clic?in' on t!e folder s$m"ol (!otspot)# If t!e items for a
!eader entr$ are onl$ to "e read "$ t!e callin' pro'ram and passed to ALV !en a
!eader !as "een e&panded interactivel$, t!is can "e controlled via t!e %ALLBA%>
event BITE8/1ATA/E6PA01B#
(*# @otspot/fieldname T9PE slis/fieldname= .sed to ma?e t!e fieldname fla'
!otspot#
5+# 0o/input(-) T9PE c = T!e fields are onl$ displa$ fields#
Value set= SPA%E, B6B
B6B C all read$AforAinput fields in a list are displa$ed as not read$AforAinput# (Record
selection c!ec?"o&es and fields !ic! can "e made read$AforAinput via t!e field list
parameter 2IEL1%ATAI0P.T C B6B)
5-# 2(code LI>E s$Aucomm= To assi'n an ALV standard function code to dou"leA
clic? (2(), assi'n t!e function code to t!is parameter# E&#= to assi'n t!e ALV standard
function B1etailB (BSETAB) to 2(#
CQ LA97.TA2(%71E C BSETAB#
Value set= SPA%E, function code

5(# %onfirmation/prompt= confirm# Prompt !en leavin'
Value set= SPA%E, B6B
B6B C if one of t!e functions DBac? (2+5)B, DE&it (2-))B or D%ancel (2-()B occurs, a
confirmation prompt appears#
55# >e$/!otspot(-) T9PE c = T!e ?e$ fields are displa$ed as !otspot# T!e columns
defined in t!e field catalo' as ?e$ fields (2IEL1%ATA>E9 C B6B) are output as
!otspots, i#e# clic?in' on a ?e$ column (!i'!li'!ted in color in t!e list) calls t!e
function under 2(#
Value set= SPA%E, B6B#
54# Reprep(-) T9PE c = report report interface active#
5)# 3roup/"uttons(-) T9PE c = 'roupA"uttons for %7L- A %7L) # 3roup output
fields via 2IEL1%ATASP/3R7.P in t!e field list, and pass t!e 'roup name to t!e
list module in t!e interface parameter IT/SPE%IAL/3R7.PS#
Value set= SPA%E, B6B#
5:# 0o/?e$fi&(-) T9PE c = .sed to ma?e t!e ?e$ fields scrolla"le#
Value set= SPA%E, B6B#
B B C T!e ?e$ columns defined in t!e field catalo' "$ 2IEL1%ATA>E9 C B6B are fi&ed
in t!e list output# T!ese columns do not scroll !oriKontall$# T!e item ta"le ?e$
13 of 35
ALV DOCUMENTATION AND EXAMPLES1414
Rajagopalan. M
columns are fi&ed in !ierarc!icalAseFuential lists# T!e !eader ta"le ?e$ fields are not
considered !ere#
B6B C ?e$ columns not fi&ed
5;# 3et/selinfos(-) T9PE c = To read selection screen#
Value set= SPA%E, B6B#
If t!e callin' pro'ram is a report it! an ABAPI4 selection screen, settin' t!is
parameter ma?es ALV read t!e selection screen a'ain# If t!e selections are read
successfull$, a pus!"utton, via !ic! t!e user can call a popup !ic! lists t!e report
selections in a simple form, "ecomes active on t!e results list output "$ ALV#
5<# 'roup/c!an'e/edit(-) T9PE c = Settin's "$ user for ne 'roup
Value set= SPA%E, B6B
B6B C t!e user can enter a format option for eac! sort criterion in t!e sortIsu"total
popup, for t!e list format !en t!is value c!an'es (e#'# ne pa'e or underline)#
5*# 0o/scrollin'(-) T9PE c = 1oes not allo scrollin' of t!e list to t!e ri'!t#
Value set= SPA%E, B6B#
4+# E&pand/all(-) T9PE c = E&pand all positions
1etailed screen
4+# 1etail/popup(-) T9PE c = s!o detail in popup#
Value set= SPA%E, B6B
B B C List record detail displa$ in fullAscreen mode, it! topAofApa'e#
B6B C list record detail displa$ in popup (it!out topAofApa'e)#
4-# 1etail/initial/lines(-) T9PE c = s!o also initial lines
Value set= SPA%E, B6B
B B C 7nl$ fields !ose contents are not initial are output in t!e detail vie#
B6B C initial field contents are also output in detail#
4-# detail/title"ar(5+) t$pe c = Title"ar for detail screen
Value set= SPA%E, strin' (ma&#5+)
P B C B 1etail= 1ispla$B is output as t!e title of t!e detail indo#
BStrin'E C t!e strin' passed is output as t!e title of t!e detail indo#

1ispla$ variants
4(# @eader/te&t ((+) T9PE c= Te&t for !eader "utton# 7nl$ relevant for !ierarc!icalA
seFuential lists# 9ou can to''le "eteen displa$ field and field list vies via
pus!"uttons in t!e displa$ variant definition popup for !ierarc!icalAseFuential lists#
T!e vies refer to t!e !ierarc!$ level of t!e fields# T!is is tec!nicall$ a to''le
"eteen t!e !eader ta"le and item ta"le fields#
Value set= SPA%E, %@AR ((+)
B B C T!e !eader ta"le field pus!"utton te&t is B@eaderB "$ default#
%@AR ((+) C !eader ta"le field pus!"utton te&t#
45#item/te&t((+) T9PE c = Te&t for item "utton# 7nl$ relevant for !ierarc!icalA
seFuential lists# 9ou can to''le t!e vie "eteen t!e displa$ fields and t!e field list
via pus!"uttons in t!e displa$ variant definition popup for !ierarc!icalAseFuential
lists# T!e vies refer to t!e !ierarc!$ level of t!e fields# T!is is tec!nicall$ a to''le
"eteen t!e !eader ta"le and item ta"le fields#
Value set= SPA%E, %@AR ((+)
B B C T!e pus!"utton te&t for t!e item ta"le fields is BItemB "$ default#
%@AR ((+) C item ta"le field pus!"utton te&t#
14 of 35
ALV DOCUMENTATION AND EXAMPLES1515
Rajagopalan. M
44#default/ item(-) T9PE c = Items as default# 7nl$ relevant for !ierarc!icalA
seFuential lists#
Value set= SPA%E, B6B
B B C T!e !eader ta"le fields are displa$ed "$ default in t!e displa$ variant definition
popup# T!e user can sitc! to t!e item ta"le fields interactivel$#
B6B C t!e item ta"le fields are displa$ed "$ default in t!e displa$ variant 1efinition
Popup# T!e user can sitc! to t!e !eader ta"le fields interactivel$#
%olour
4)# Info/fieldname T9PE slis/fieldname= infofield for listoutput# A !ole list record
can "e colored individuall$ usin' a color code in a column of t!e internal output ta"le
for t!e record# Assi'n t!e name of t!e field containin' t!e color code to t!is
parameter#
Value set= SPA%E, internal output ta"le field name
T!e internal output ta"le field must "e of t$pe %@AR(5)#
T!e code must !ave t!e folloin' s$nta&= B%&$B=
% C color (all codes must start it! B%B)
6 C color num"er (B-BAB*B)
9 C "old (B+B C off, B-B C on)
4:# %olta"/fieldname T9PE slis/fieldname= %ells can "e colored individuall$ usin' a
color code !ic! is contained in a column of t!e internal output ta"le for t!e record
containin' t!e cell# Assi'n t!e name of t!e field to t!is parameter#
7t!ers
4;# List/append(-) T9PE c = no call screen# It is onl$ useful to output "loc?Alists
it!out specif$in' t!e a"ove modules if t!e num"er of list "loc?s e&ceeds, or ma$
e&ceed, t!e ma&imum num"er specified in t!e "loc? module documentation# T!ese
operations are not possi"le for userAdefined "loc? lists#
E6a+ple &o.e #
I_LAYOUT-f2code = ws_fcode.
I_LAYOUT-zebra = 'X'.
I_LAYOUT-colwidth_optiize = 'X'.
I_LAYOUT-!o_"e#fi$ = 'X'.
I_LAYOUT-%et_seli!fos = 'X'.
I_LAYOUT-!o_hotspot = 'X'.
I_LAYOUT-!o_i!p&t = 'X'.
I_LAYOUT-hotspot_field!ae = 'I(L)*A+(.
I_LAYOUT-!o_i!p&t = ,X-.
I_LAYOUT-!o_.li!e = /X-.
I_LAYOUT-!o_colhead = , ,.
I_LAYOUT-li%hts_co!de!se = / /.
I_LAYOUT-totals_te$t = / /.
I_LAYOUT-s&btotals_te$t = / /.
I_LAYOUT-totals_o!l# = / /.
I_LAYOUT-"e#_hotspot = ,X-.
I_LAYOUT-detail_pop&p = ,X-.
I_LAYOUT-%ro&p_cha!%e_edit = ,X-.
I_LAYOUT-01OU2_3UTTO*4 = ,X-.

Step <
15 of 35
ALV DOCUMENTATION AND EXAMPLES1616
Rajagopalan. M
T!is step is reFuired to 'et t!e selection screen information in t!e report output#
T!e prereFuisite for t!is is to set t!e parameter LA97.TA3ET/SELI027S of t!e
I8P7RTI03 structure#
T!e parameters to "e passed in t!e IS/SEL/@I1E ta"le are=
o mode= BRB C onl$ t!e entries passed in t!e internal ta"le IS/SEL/@I1EA
T/E0TRIES
Are output in t!e pop up# Selection info, !ic! t!e list tool read in t!e
selection screen (!en called "$ a report it! a selection screen), is
replaced "$ t!e values passed#
BSB C t!e selection info !ic! t!e list tool read in t!e selection screen of t!e
callin' report are modified "$ t!e entries in t!e ta"le IS/SEL/@I1EA
T/E0TRIES#
o t/entries= Selection info ta"le
o t/entriesAmode= BAB C output t!e selection info for t!e current ta"le record in t!e info
popup#
B1B C do not output select option or SEL0A8E parameter selection info
in t!e popup#
o t/entriesAselname= (onl$ used in t/entriesAmode C B1B) = 0ame of t!e select option or
parameter#
T!e folloin' ta"le fields are onl$ used in t/entriesAmode C BAB# T!e$ contain t!e selection
information to "e added#
t/entriesAfield= 11I% field name of t!e field for !ic! selection information is to
"e output#
t/entriesAta"le= 11I% ta"le names of t/entriesAfield#
t/entriesAste&t= 2ield name in info popup#
If t/entriesAfield and t/entriesAta"le !ave "een entered, t!is te&t is ta?en from
11I%#
t/entriesAvaluf= Selection condition BfromB value (e&ternal format)
t/entriesAvalut= Selection condition BtoB value (e&ternal format)
t/entriesAsi'n+= (I)nclusive (E)&clusive
t/entriesAoption= All values of t!e select options 7ption field alloed#
Step <
T!e Ta"le IT/S7RT is populated it! t!e sort criteria for t!e different fields#
T!e caller specifies t!e sortin' andIor su"totalin' of t!e "asic list in t!e internal ta"le
IT/S7RT#
T!is internal ta"le !as t!e folloin' fields=
o spos = Sort seFuence
o fieldname = Internal output ta"le field name
o ta"name = 7nl$ relevant for !ierarc!icalAseFuential lists# 0ame of t!e internal output
ta"le#
o up = B6B C sort in ascendin' order
o don = B6B C sort in descendin' order
o su"tot = B6B C su"total at 'roup value c!an'e
o 'roup = BR B C ne pa'e at 'roup value c!an'e ,B.LB C underline at 'roup value c!an'e
16 of 35
ALV DOCUMENTATION AND EXAMPLES11
Rajagopalan. M
Step =
T!e final step in t!e output of t!e report is t!e use of to ALV functions modules#
-# 1(U4(_AL5_'I(L)6ATALO0_+(10(
(# 1(U4(_AL5_LI4T_)I42LAY
The first f&!ctio! od&le is &sed to pass the field catalo% to the
report o&tp&t a!d er%e it with the i!ter!al o&tp&t table.
2.0%TI70 reuse/alv/fieldcatalo'/mer'e#
RTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
RTRTLo?ale Sc!nittstelle=
RU I8P7RTI03
RT VAL.E(I/PR73RA8/0A8E) LI>E S9AREPI1 7PTI70AL
RT VAL.E(I/I0TER0AL/TAB0A8E) T9PE SLIS/TAB0A8E 7PTI70AL
RT VAL.E(I/STR.%T.RE/0A8E) LI>E 11+(LATAB0A8E 7PTI70AL
RT VAL.E(I/%LIE0T/0EVER/1ISPLA9) T9PE SLIS/%@AR/-
RT 1E2A.LT B6B
RT VAL.E(I/I0%L0A8E) LI>E TR1IRA0A8E 7PTI70AL
RT %@A03I03
RT VAL.E(%T/2IEL1%AT) T9PE SLIS/T/2IEL1%AT/ALV
RT E6%EPTI70S
RT I0%70SISTE0T/I0TER2A%E
RT PR73RA8/ERR7R
RTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Import parameters
I/PR73RA8/0A8E= Pro'ram in !ic! t!e internal output ta"le is declared and populated
I/I0TER0AL/TAB0A8E= Internal output ta"le name
I/STR.%T.RE/0A8E= Structure name (structure, ta"le, and vie)
I/%LIE0T/0EVER/1ISPL= @ide client fields default D6E
I/I0%L0A8E= 1ata declarations include name
%@A03I03 parameter
%T/2IEL1%AT= 2ield catalo' it! field descriptions
T!e variant "ased on a pro'ramAinternal ta"le s!ould onl$ "e used for rapid protot$pin' since
t!e folloin' restrictions appl$=

-# Performance is affected since t!e code of t!e ta"le definition must ala$s "e read and
interpreted at runtime#

(# 1ictionar$ reference are onl$ considered if t!e ?e$ords LI>E or I0%L.1E
STR.%T.RE (not T9PE) are used#
Step >
T!e ot!er function module is used to displa$ t!e internal output ta"le it! t!e contents
2.0%TI70 reuse/alv/list/displa$#
RTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
RTRTLo?ale Sc!nittstelle=
RU I8P7RTI03
17 of 35
ALV DOCUMENTATION AND EXAMPLES1!1!
Rajagopalan. M
RT VAL.E(I/I0TER2A%E/%@E%>) 1E2A.LT SPA%E
RT VAL.E(I/%ALLBA%>/PR73RA8) LI>E S9AREPI1 1E2A.LT SPA%E
RT VAL.E(I/%ALLBA%>/P2/STAT.S/SET) T9PE SLIS/27R80A8E
RT 1E2A.LT SPA%E
RT VAL.E(I/%ALLBA%>/.SER/%788A01) T9PE SLIS/27R80A8E
RT 1E2A.LT SPA%E
RT VAL.E(I/STR.%T.RE/0A8E) LI>E 11+(LATAB0A8E 7PTI70AL
RT VAL.E(IS/LA97.T) T9PE SLIS/LA97.T/ALV 7PTI70AL
RT VAL.E(IT/2IEL1%AT) T9PE SLIS/T/2IEL1%AT/ALV 7PTI70AL
RT VAL.E(IT/E6%L.1I03) T9PE SLIS/T/E6TAB 7PTI70AL
RT VAL.E(IT/SPE%IAL/3R7.PS) T9PE SLIS/T/SP/3R7.P/ALV
RT 7PTI70AL
RT VAL.E(IT/S7RT) T9PE SLIS/T/S7RTI027/ALV 7PTI70AL
RT VAL.E(IT/2ILTER) T9PE SLIS/T/2ILTER/ALV 7PTI70AL
RT VAL.E(IS/SEL/@I1E) T9PE SLIS/SEL/@I1E/ALV 7PTI70AL
RT VAL.E(I/1E2A.LT) 1E2A.LT B6B
T VAL.E(I/SAVE) 1E2A.LT SPA%E
T VAL.E(IS/VARIA0T) LI>E 1ISVARIA0T
T STR.%T.RE 1ISVARIA0T 1E2A.LT SPA%E
T VAL.E(IT/EVE0TS) T9PE SLIS/T/EVE0T 7PTI70AL
T VAL.E(IT/EVE0T/E6IT) T9PE SLIS/T/EVE0T/E6IT 7PTI70AL
T VAL.E(IS/PRI0T) T9PE SLIS/PRI0T/ALV 7PTI70AL
T VAL.E(IS/REPREP/I1) T9PE SLIS/REPREP/I1 7PTI70AL
T VAL.E(I/S%REE0/START/%7L.80) 1E2A.LT +
T VAL.E(I/S%REE0/START/LI0E) 1E2A.LT +
T VAL.E(I/S%REE0/E01/%7L.80) 1E2A.LT +
T VAL.E(I/S%REE0/E01/LI0E) 1E2A.LT +
T E6P7RTI03
T VAL.E(E/E6IT/%A.SE1/B9/%ALLER)
T VAL.E(ES/E6IT/%A.SE1/B9/.SER) T9PE SLIS/E6IT/B9/.SER
T TABLES
T T/7.TTAB
T E6%EPTI70S
T PR73RA8/ERR7R
Import parameters
I/I0TER2A%E/%@E%>= Interface consistenc$ c!ec? lo' output#
I/%ALLBA%>/PR73RA8= 0ame of t!e callin' pro'ram
I/%ALLBA%>/P2/STAT.S/SET= Set E6IT routine to status#
I/%ALLBA%>/.SER/%788A01= E6IT routine for command !andlin'
I/STR.%T.RE/0A8E= Internal output ta"le structure name
IS/LA97.T= List la$out specifications
IT/2IEL1%AT= 2ield catalo' it! field descriptions
IT/E6%L.1I03= Ta"le of inactive function codes
IT/SPE%IAL/3R7.PS= 3roupin' fields for column selection
IT/S7RT= Sort criteria for first list displa$
IT/2ILTER= 2ilter criteria for first list output
IS/SEL/@I1E = Selection information modification
I/1E2A.LT= Initial variant activeIinactive lo'ic
I/SAVE= Variants can "e saved
IS/VARIA0T = Variant information
IT/EVE0TS= Ta"le of events to perform
IT/EVE0T/E6IT = Standard fcode e&it reFuests ta"le
IS/PRI0T= Print information
18 of 35
ALV DOCUMENTATION AND EXAMPLES1"1"
Rajagopalan. M
IS/REPREP/I1= InitialiKation ?e$s for ReIRe interface
I/S%REE0/START/%7L.80= %oordinates for list in dialo' "o&
I/S%REE0/START/LI0E= %oordinates for list in dialo' "o&
I/S%REE0/E01/%7L.80= %oordinates for list in dialo' "o&
I/S%REE0/E01/LI0E= %oordinates for list in dialo' "o&
IT/EVE0T/E6IT= Standard fcode e&it reFuests ta"le
IS/PRI0T= Print information
IS/REPREP/I1= InitialiKation ?e$s for ReIRe interface
I/S%REE0/START/%7L.80= %oordinates for list in dialo' "o&
I/S%REE0/START/LI0E= %oordinates for list in dialo' "o&
I/S%REE0/E01/%7L.80= %oordinates for list in dialo' "o&
I/S%REE0/E01/LI0E= %oordinates for list in dialo' "o&
E&port parameters
E/E6IT/%A.SE1/B9/%ALLER= 1elete list in %ALLBA%>/.SER/%788A01
ES/E6IT/%A.SE1/B9/.SER= @o t!e user left t!e list Ta"les
T/7.TTAB= Ta"le it! data to "e displa$ed AAAmandator$
E6a+ple Co.e
74_1(2*A+( = 4Y-1(2I).
6ALL 'U*6TIO* '1(U4(_AL5_'I(L)6ATALO0_+(10('
(X2O1TI*0
I_21O01A+_*A+( = 74_1(2*A+(
I_I*T(1*AL_TA3*A+( = I!ter!al o&tp&t table field !ae
I_I*6L*A+( = 74_1(2*A+(
68A*0I*0
6T_'I(L)6AT = I_'I(L)TA3.
I' 4Y-4U316 9: ;.
71IT(< '4Y-4U316< '= 4Y-4U316= '1(U4(_AL5_'I(L)6ATALO0_+(10('.
(*)I'.
6ALL 'U*6TIO* '1(U4(_AL5_LI4T_)I42LAY'
(X2O1TI*0
I_6ALL3A6>_21O01A+ = 74_1(2*A+(
I_4T1U6TU1(_*A+( = I!ter!al o&tp&t table field !ae
I4_LAYOUT = I_LAYOUT
IT_'I(L)6AT = I_'I(L)TA3
I_)('AULT = 'A'
I_4A5( = 'A'
I4_5A1IA*T = 'X'
IT_(5(*T4 = I_(5(*T4?@
IT_4O1T = I_4O1T
I4_4(L_8I)( = I_4(LI*'O
TA3L(4
T_OUTTA3 = I!ter!al o&tp&t table field !ae.

I' 4Y-4U316 9: ;.
71IT(< '4Y-4U316< '= 4Y-4U316= '1(U4(_AL5_LI4T_)I42LAY'.
(*)I'
T@IS IS T@E P7P .P T7 ALL7W T@E .SER T7 190A8I%ALL9 SELE%T T@E 2IEL1S 27R
1ISPLA9# @E %A0 %@77SE 2R78 T@IS 2IEL1S A%%# T7 REJ.IRE8E0T A01 @I1E T@E
7T@ER 2IEL1S
19 of 35
ALV DOCUMENTATION AND EXAMPLES2#2#
Rajagopalan. M
E&ample report output "ased prior to selection of t!e field
20 of 35
output.html
ALV DOCUMENTATION AND EXAMPLES2121
Rajagopalan. M
T@E .SER @AS @I11E0 S78E 72 T@E 2IEL1 2R78 T@E T7TAL 2IEL1S T7 %.ST78ILE
T@E REP7RT 7.TP.T
E&ample report output after !idin' some of t!e fields
21 of 35
output1.html
ALV DOCUMENTATION AND EXAMPLES2222
Rajagopalan. M
.SER %A0 %@77SE A PARTI%.LAR SET 72 2IEL1 2R78 T@E 7.TP.T A01 %A0 SAVE
IT AS VARIA0TS
22 of 35
ALV DOCUMENTATION AND EXAMPLES2323
Rajagopalan. M
.sin' ot!er function module BRE.SE/ALV/3RI1/1ISPLA9E can !elp us 'et list output in
t!e form of a 'rid and also attac! lo'os to t!e report output#
23 of 35
ALV DOCUMENTATION AND EXAMPLES2424
Rajagopalan. M
Sa+ple &o.e
- Si+ple li0t o)tp)t=
REP7RT 9/1E87/ALV 07 STA01AR1 PA3E @EA1I03#
R
R 1ata to "e displa$ed
1ATA= I/S2LI3@T T9PE TABLE 72 S2LI3@T#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R Selection
SELE%T R 2R78 S2LI3@T I0T7 TABLE I/S2LI3@T#
R %all ABAP List Vieer (ALV)
%ALL 2.0%TI70 BRE.SE/ALV/LIST/1ISPLA9B
E6P7RTI03
I/STR.%T.RE/0A8E C BS2LI3@TB
TABLES
T/7.TTAB C I/S2LI3@T#
(#Si+ple ;%i. o)tp)t#
REP7RT 9/1E87/ALV/-#
R
R 1ata to "e displa$ed
1ATA= I/S2LI3@T T9PE TABLE 72 S2LI3@T#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R Selection
SELE%T R 2R78 S2LI3@T I0T7 TABLE I/S2LI3@T#
R %all ABAP List Vieer (ALV)
%ALL 2.0%TI70 BRE.SE/ALV/3RI1/1ISPLA9B
E6P7RTI03
I/STR.%T.RE/0A8E C BS2LI3@TB
TABLES
T/7.TTAB C I/S2LI3@T#
"3 De+o (o% *RE!SE5ALV5POP!P5TO5SELECT*
REP7RT $/demo/alv/5#
T9PEAP77LS= slis#
1ATA= BE3I0 72 i/outta" 7%%.RS +#
I0%L.1E STR.%T.RE sfli'!t#
1ATA= /c!? T9PE c# T2or multiple selection
1ATA= E01 72 i/outta"#
24 of 35
ALV DOCUMENTATION AND EXAMPLES2525
Rajagopalan. M
R I/7.TTAB T9PE S2LI3@T 7%%.RS +,
1ATA= i/private T9PE slis/data/caller/e&it,
i/selfield T9PE slis/selfield,
W/e&it(-) T9PE c#
PARA8ETERS= p/title T9PE s$Atitle#
R
STARTA72ASELE%TI70#
SELE%T R 2R78 sfli'!t I0T7 TABLE i/outta"#
%ALL 2.0%TI70 BRE.SE/ALV/P7P.P/T7/SELE%TB
E6P7RTI03
i/title C p/title
i/selection C B6B
i/Ke"ra C B6B
R I/S%REE0/START/%7L.80 C +
R I/S%REE0/START/LI0E C +
R I/S%REE0/E01/%7L.80 C +
R I/S%REE0/E01/LI0E C +
i/c!ec?"o&/fieldname C BW/%@>B
R I/LI0E8AR>/2IEL10A8E C
R I/S%R7LL/T7/SEL/LI0E C B6B
i/ta"name C BI/7.TTABB
i/structure/name C BS2LI3@TB
R IT/2IEL1%AT C
R IT/E6%L.1I03 C
R I/%ALLBA%>/PR73RA8 C
R I/%ALLBA%>/.SER/%788A01 C
R IS/PRIVATE C I/PRIVATE
I8P7RTI03
es/selfield C i/selfield
e/e&it C /e&it
TABLES
t/outta" C i/outta"
E6%EPTI70S
pro'ram/error C -
7T@ERS C (#
I2 s$Asu"rc VQ +#
R 8ESSA3E i+++(+?) WIT@ s$Asu"rc#
E01I2#
RRRRRt!e internal ta"le is modified it! a cross si'n for mar?in' t!e
RRRros selected
L77P AT i/outta" W@ERE /c!? C B6B#
WRITE= I i/outta"Acarrid, i/outta"Aprice#
E01L77P#
43 De+o (o% ALV o)tp)t )0in; (iel. &atalo; an. la9o)t#
REP7RT $/demo/alv 07 STA01AR1 PA3E @EA1I03#
25 of 35
ALV DOCUMENTATION AND EXAMPLES2626
Rajagopalan. M
R ALV related data declaration
T9PEAP77LS= slis#
R 1BATa"le
TABLES sfli'!t#
R Includes
I0%L.1E ViconQ#
I0%L.1E Vs$m"olQ#
R
%70STA0TS=
c/formname/top/of/pa'e T9PE slis/formname VAL.E BT7P/72/PA3EB#
1ATA= i/fieldcat T9PE slis/t/fieldcat/alv,
i/la$out T9PE slis/la$out/alv,
i/sp/'roup T9PE slis/t/sp/'roup/alv,
i/events T9PE slis/t/event,
i/print T9PE slis/print/alv,
i/sort T9PE slis/t/sortinfo/alv#
Rinternal ta"le for data to "e displa$ed
1ATA= BE3I0 72 i/sfli'!t 7%%.RS +#
I0%L.1E STR.%T.RE sfli'!t#
1ATA= "o&,
li'!ts#
1ATA= E01 72 i/sfli'!t#
R
1ATA= /repid LI>E s$Arepid#
1ATA= i/list/top/of/pa'e T9PE slis/t/list!eader#
R Report Selections
SELE%TA7PTI70S s/carrid 27R sfli'!tAcarrid#
SELE%TA7PTI70S s/connid 27R sfli'!tAconnid#
SELE%TA7PTI70S s/fldate 27R sfli'!tAfldate#
RSELE%TI70AS%REE0 S>IP -#
R Parameters
PARA8ETERS= p/ma&ro T9PE i 1E2A.LT 5+#Tto limit t!e selection
SELE%TI70AS%REE0 S>IP -#
R Variant for ALV displa$
SELE%TI70AS%REE0 BE3I0 72 BL7%> + WIT@ 2RA8E TITLE te&tA+++#
PARA8ETERS= p/varnt LI>E disvariantAvariant#
SELE%TI70AS%REE0 E01 72 BL7%> +#
R La$out of t!e report displa$
SELE%TI70AS%REE0 BE3I0 72 BL7%> a WIT@ 2RA8E TITLE te&tA++-#
PARA8ETERS= p/Ke"ra AS %@E%>B76 1E2A.LT B B, TStriped pattern
p/nocol! AS %@E%>B76 1E2A.LT B B, T0o column !eadin'
p/novlin AS %@E%>B76 1E2A.LT B B, T0o vertical lines
p/colopt AS %@E%>B76 1E2A.LT B B, T7ptimiKes col# d
p/?e$!ot AS %@E%>B76 1E2A.LT B B, T>e$ fields !ot
p/noinpt AS %@E%>B76 1E2A.LT B B# T0o field for input
SELE%TI70AS%REE0 E01 72 BL7%> a#
SELE%TI70AS%REE0 BE3I0 72 BL7%> " WIT@ 2RA8E TITLE te&tA++(#
PARA8ETERS= p/li'!ts AS %@E%>B76 1E2A.LT B6B,
p/li'!tc AS %@E%>B76 1E2A.LT B6B#
SELE%TI70AS%REE0 E01 72 BL7%> "#
26 of 35
ALV DOCUMENTATION AND EXAMPLES22
Rajagopalan. M
SELE%TI70AS%REE0 BE3I0 72 BL7%> c WIT@ 2RA8E TITLE te&tA++5#
PARA8ETERS= p/totonl AS %@E%>B76 1E2A.LT B B,
p/tote&t(:+),
p/stte&t(:+)#
SELE%TI70AS%REE0 E01 72 BL7%> c#
SELE%TI70AS%REE0 BE3I0 72 BL7%> d WIT@ 2RA8E TITLE te&tA++4#
PARA8ETERS= p/c!?"o& AS %@E%>B76 1E2A.LT B6B,
p/detpop AS %@E%>B76 1E2A.LT B6B,
p/'roup" AS %@E%>B76 1E2A.LT B B,
p/'roups AS %@E%>B76 1E2A.LT B B#
SELE%TI70AS%REE0 E01 72 BL7%> d#
SELE%TI70AS%REE0 BE3I0 72 BL7%> e WIT@ 2RA8E TITLE te&tA++)#
PARA8ETERS= p/print AS %@E%>B76 1E2A.LT B B,
p/nosinf AS %@E%>B76 1E2A.LT B B,
p/nocove AS %@E%>B76 1E2A.LT B B,
p/nonep AS %@E%>B76 1E2A.LT B B,
p/nolinf AS %@E%>B76 1E2A.LT B B,
p/reserv T9PE i#
SELE%TI70AS%REE0 E01 72 BL7%> e#
1ATA= /"o&nam T9PE slis/fieldname VAL.E BB76B,
/f(code LI>E s$Aucomm VAL.E BSETAB,
/li'nam T9PE slis/fieldname VAL.E BLI3@TSB,
/save(-) T9PE c,
/default(-) T9PE c,
/e&it(-) T9PE c,
i/variant LI>E disvariant,
i/variant- LI>E disvariant#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
I0ITIALILATI70#
/repid C s$Arepid#
PER27R8 fieldcat/init .SI03 i/fieldcat#
PER27R8 eventta"/"uild .SI03 i/events#
PER27R8 comment/"uild .SI03 i/list/top/of/pa'e#
PER27R8 sp/'roup/"uild .SI03 i/sp/'roup#
PER27R8 t/sort/"uild .SI03 i/sort#
R Set 7ptions= save variant userspecific or 'eneral
RRRR BA or B.B are for userAspecific variants list
RRRR B6B or BspaceB for 'eneral
/save C BAB#
PER27R8 variant/init#
R 3et default variant
i/variant- C i/variant#
%ALL 2.0%TI70 BRE.SE/ALV/VARIA0T/1E2A.LT/3ETB
E6P7RTI03
i/save C /save
%@A03I03
cs/variant C i/variant-
27 of 35
ALV DOCUMENTATION AND EXAMPLES2!2!
Rajagopalan. M
E6%EPTI70S
not/found C (#
I2 s$Asu"rc C +#
p/varnt C i/variant-Avariant#
E01I2#
R Process on value reFuest (list of possi"le variants)
AT SELE%TI70AS%REE0 70 VAL.EAREJ.EST 27R p/varnt#
PER27R8 f4/for/variant#
R PAI
AT SELE%TI70AS%REE0#
PER27R8 pai/of/selection/screen#
STARTA72ASELE%TI70#
PER27R8 selection#
E01A72ASELE%TI70#
PER27R8 la$out/"uild .SI03 i/la$out# T'# Parameters
PER27R8 print/"uild .SI03 i/print# T'# Parameters
%ALL 2.0%TI70 BRE.SE/ALV/2IEL1%ATAL73/8ER3EB
E6P7RTI03
i/pro'ram/name C /repid
R i/internal/ta"name C BI/S2LI3@TB
i/structure/name C BS2LI3@TB
i/client/never/displa$ C B6B
i/inclname C /repid
%@A03I03
ct/fieldcat C i/fieldcatWX
E6%EPTI70S
inconsistent/interface C -
pro'ram/error C (
7T@ERS C 5#
I2 s$Asu"rc VQ +#
8ESSA3E I1 s$Ams'id T9PE BSB 0.8BER s$Ams'no
WIT@ s$Ams'v- s$Ams'v( s$Ams'v5 s$Ams'v4#
E01I2#
R %all ABAPI4 List Vieer
%ALL 2.0%TI70 BRE.SE/ALV/3RI1/1ISPLA9B
E6P7RTI03
R I/I0TER2A%E/%@E%> C B B
i/call"ac?/pro'ram C /repid
R I/%ALLBA%>/P2/STAT.S/SET C B B
R I/%ALLBA%>/.SER/%788A01 C B B
R I/%ALLBA%>/T7P/72/PA3E C B B
R I/%ALLBA%>/@T8L/T7P/72/PA3E C B B
R I/%ALLBA%>/@T8L/E01/72/LIST C B B
i/structure/name C BS2LI3@TB
i/"ac?'round/id C BALV/BA%>3R7.01B
28 of 35
ALV DOCUMENTATION AND EXAMPLES2"2"
Rajagopalan. M
R I/3RI1/TITLE C
R I/3RI1/SETTI03S C
is/la$out C i/la$out
it/fieldcat C i/fieldcatWX
R IT/E6%L.1I03 C
it/special/'roups C i/sp/'roupWX
it/sort C i/sortWX
R IT/2ILTER C
R IS/SEL/@I1E C
R I/1E2A.LT C B6B
i/save C /save
is/variant C i/variant
it/events C i/eventsWX
R IT/EVE0T/E6IT C
is/print C i/print
R IS/REPREP/I1 C
R I/S%REE0/START/%7L.80 C +
R I/S%REE0/START/LI0E C +
R I/S%REE0/E01/%7L.80 C +
R I/S%REE0/E01/LI0E C +
R I8P7RTI03
R E/E6IT/%A.SE1/B9/%ALLER C
R ES/E6IT/%A.SE1/B9/.SER C
TABLES
t/outta" C i/sfli'!t
E6%EPTI70S
pro'ram/error C -
7T@ERS C (#
I2 s$Asu"rc VQ +#
R 8ESSA3E I1 S9A8S3I1 T9PE S9A8S3T9 0.8BER S9A8S307
R WIT@ S9A8S3V- S9A8S3V( S9A8S3V5 S9A8S3V4#
E01I2#
R %ALL 2.0%TI70 BRE.SE/ALV/LIST/1ISPLA9B
R E6P7RTI03
R i/call"ac?/pro'ram C /repid
R i/structure/name C BS2LI3@TB
R is/la$out C i/la$out
R it/fieldcat C i/fieldcatWX
RR IT/E6%L.1I03 C
R it/special/'roups C i/sp/'roupWX
R it/sort C i/sortWX
RR IT/2ILTER C
RR IS/SEL/@I1E C
RR i/default C W/1E2A.LT
R i/save C /save
R is/variant C i/variant
R it/events C i/eventsWX
RR IT/EVE0T/E6IT C
R is/print C i/print
RR I/S%REE0/START/%7L.80 C +
RR I/S%REE0/START/LI0E C +
RR I/S%REE0/E01/%7L.80 C +
RR I/S%REE0/E01/LI0E C +
29 of 35
ALV DOCUMENTATION AND EXAMPLES3#3#
Rajagopalan. M
RR I8P7RTI03
RR E/E6IT/%A.SE1/B9/%ALLER C
R TABLES
R t/outta" C i/sfli'!t#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 2IEL1%AT/I0IT R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R AAQ L/2IEL1%AT R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 fieldcat/init .SI03 l/fieldcat T9PE slis/t/fieldcat/alv#
1ATA= ls/fieldcat T9PE slis/fieldcat/alv#
R
%LEAR ls/fieldcat#
ls/fieldcatAfieldname C BSEATS7%%B#
RT!e field is not displa$ed in t!e initial output, can "e interactivel$
R c!osen for displa$
ls/fieldcatAno/out C B6B#
RT!is field is assi'ned to a special 'roup it! tec!# ?e$ BAB and can "e
Rdispla$ed usin' t!e special 'roup "uttons
ls/fieldcatAsp/'roup C BAB#
RT!e field cannot "e summed irrespective of its data t$pe
ls/fieldcatAno/sum C B6B#
APPE01 ls/fieldcat T7 l/fieldcat#
R
%LEAR ls/fieldcat#
ls/fieldcatAfieldname C BSEATS8A6B#
ls/fieldcatAno/out C B6B#
ls/fieldcatAsp/'roup C BAB#
APPE01 ls/fieldcat T7 l/fieldcat#
R
%LEAR ls/fieldcat#
ls/fieldcatAfieldname C BPRI%EB#
ls/fieldcatAno/out C B6B#
ls/fieldcatAsp/'roup C BBB#
APPE01 ls/fieldcat T7 l/fieldcat#
R
%LEAR ls/fieldcat#
ls/fieldcatAfieldname C B%ARRI1B#
ls/fieldcatAoutputlen C ;#
APPE01 ls/fieldcat T7 l/fieldcat#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 1ATA/A11 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R AAQ L/S2LI3@T
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 data/add TABLES l/sfli'!t STR.%T.RE i/sfli'!t#
L77P AT l/sfli'!t#
I2 s$Ata"i& Q -+#
30 of 35
ALV DOCUMENTATION AND EXAMPLES3131
Rajagopalan. M
l/sfli'!tA"o& C B6B#
l/sfli'!tAli'!ts C B5B#
ELSE#
I2 s$Ata"i& C -#
l/sfli'!tAli'!ts C B(B#
ELSE#
l/sfli'!tAli'!ts C B-B#
E01I2#
E01I2#
871I29 l/sfli'!t#
E01L77P#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 EVE0TTAB/B.IL1 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R AAQ l/EVE0TS R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 eventta"/"uild .SI03 l/events T9PE slis/t/event#
1ATA= ls/event T9PE slis/alv/event#
R
%ALL 2.0%TI70 BRE.SE/ALV/EVE0TS/3ETB
E6P7RTI03
i/list/t$pe C +
I8P7RTI03
et/events C l/events#
REA1 TABLE l/events WIT@ >E9 name C slis/ev/top/of/pa'e I0T7 ls/event#
I2 s$Asu"rc C +#
87VE c/formname/top/of/pa'e T7 ls/eventAform#
APPE01 ls/event T7 l/events#
E01I2#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 %788E0T/B.IL1 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R AAQ L/T7P/72/PA3E R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 comment/"uild .SI03 l/top/of/pa'e T9PE slis/t/list!eader#
1ATA= ls/line T9PE slis/list!eader#
RRR@eader
%LEAR ls/line#
ls/lineAt$p C B@B#
R LS/LI0EA>E9= not used for t!is t$pe
ls/lineAinfo C B@eadin' listB#
APPE01 ls/line T7 l/top/of/pa'e#
31 of 35
ALV DOCUMENTATION AND EXAMPLES3232
Rajagopalan. M
RRRSelection
%LEAR ls/line#
ls/lineAt$p C BSB#
ls/lineA?e$ C B>e$ -B#
ls/lineAinfo C BInformationB#
APPE01 ls/line T7 l/top/of/pa'e#
ls/lineA?e$ C B>e$ (B#
APPE01 ls/line T7 l/top/of/pa'e#
RRRAction
%LEAR ls/line#
ls/lineAt$p C BAB#
R LS/LI0EA>E9= not used for t!is t$pe
Ls/lineAinfo C BStatus listB#
APPE01 ls/line T7 l/top/of/pa'e#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 LA97.T/B.IL1 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R VAQ LS/LA97.T R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 la$out/"uild .SI03 ls/la$out T9PE slis/la$out/alv#
ls/la$outAf(code C /f(code#
ls/la$outAKe"ra C p/Ke"ra#
ls/la$outAcolidt!/optimiKe C p/colopt#
I2 p/c!?"o& C B6B#
R2ieldname for c!ec? "o& on t!e report output
ls/la$outA"o&/fieldname C /"o&nam#
ELSE#
ls/la$outA"o&/fieldname C space#
E01I2#
ls/la$outAno/input C p/noinpt#
ls/la$outAno/vline C p/novlin#
ls/la$outAno/col!ead C p/nocol!#
I2 p/li'!ts C B6B 7R p/li'!tc C B6B#
RR2ieldname for li'!ts on t!e report output
ls/la$outAli'!ts/fieldname C /li'nam#
ELSE#
%LEAR ls/la$outAli'!ts/fieldname#
E01I2#
ls/la$outAli'!ts/condense C p/li'!tc#
ls/la$outAtotals/te&t C p/tote&t#
ls/la$outAsu"totals/te&t C p/stte&t#
ls/la$outAtotals/onl$ C p/totonl#
ls/la$outA?e$/!otspot C p/?e$!ot#
ls/la$outAdetail/popup C p/detpop#
ls/la$outA'roup/c!an'e/edit C p/'roups#
R E+)/LS/LA97.TA3R7.P/B.TT70S C P/3R7.PB#
R ls/la$outA'roup/"uttons C B6B#
32 of 35
ALV DOCUMENTATION AND EXAMPLES3333
Rajagopalan. M
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 SP/3R7.P/B.IL1 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R AAQ L/SP/3R7.P R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 sp/'roup/"uild .SI03 l/sp/'roup T9PE slis/t/sp/'roup/alv#
1ATA= ls/sp/'roup T9PE slis/sp/'roup/alv#
R2ields are assi'ned to t!e special 'roup
%LEAR ls/sp/'roup#
ls/sp/'roupAsp/'roup C BAB#
ls/sp/'roupAte&t C BReservation statusB#
APPE01 ls/sp/'roup T7 l/sp/'roup#
%LEAR ls/sp/'roup#
ls/sp/'roupAsp/'roup C BBB#
ls/sp/'roupAte&t C B2li'!t c!ar'esB#
APPE01 ls/sp/'roup T7 l/sp/'roup#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 SELE%TI70 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 selection#
SELE%T R 2R78 sfli'!t I0T7 %7RRESP701I03 2IEL1S 72 TABLE i/sfli'!t
.P T7 p/ma&ro R7WS W@ERE carrid I0 s/carrid
A01 connid I0 s/connid A01 fldate I0 s/fldate#
PER27R8 data/add TABLES i/sfli'!t#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 T7P/72/PA3E R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R ######## R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 top/of/pa'e#
R
%ALL 2.0%TI70 BRE.SE/ALV/%788E0TAR9/WRITEB
E6P7RTI03
i/lo'o C BE0G79SAP/L737B
it/list/commentar$ C i/list/top/of/pa'e#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 24/27R/VARIA0T R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 f4/for/variant#
R
%ALL 2.0%TI70 BRE.SE/ALV/VARIA0T/24B
33 of 35
ALV DOCUMENTATION AND EXAMPLES3434
Rajagopalan. M
E6P7RTI03
is/variant C i/variant
i/save C /save
R it/default/fieldcat C
I8P7RTI03
e/e&it C /e&it
es/variant C i/variant-
E6%EPTI70S
not/found C (#
I2 s$Asu"rc C (#
8ESSA3E I1 s$Ams'id T9PE BSB 0.8BER s$Ams'no
WIT@ s$Ams'v- s$Ams'v( s$Ams'v5 s$Ams'v4#
ELSE#
I2 /e&it C space#
p/varnt C i/variant-Avariant#
E01I2#
E01I2#
E0127R8#
RSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
RS 2orm PAI/72/SELE%TI70/S%REE0
RSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R to c!ec? !et!er ri'!t variant is entered on t!e selection scr
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 pai/of/selection/screen#
R
I2 07T p/varnt IS I0ITIAL#
87VE i/variant T7 i/variant-#
87VE p/varnt T7 i/variant-Avariant#
%ALL 2.0%TI70 BRE.SE/ALV/VARIA0T/E6ISTE0%EB
E6P7RTI03
i/save C /save
%@A03I03
cs/variant C i/variant-#
i/variant C i/variant-#
ELSE#
PER27R8 variant/init#
E01I2#
E0127R8# T PAI/72/SELE%TI70/S%REE0
RSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
RS 2orm VARIA0T/I0IT
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 variant/init#
R
%LEAR i/variant#
i/variantAreport C /repid#
E0127R8# T VARIA0T/I0IT
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 PRI0T/B.IL1 R
34 of 35
ALV DOCUMENTATION AND EXAMPLES3535
Rajagopalan. M
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R ######## R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 print/"uild .SI03 l/print T9PE slis/print/alv#
R
l/printAprint C p/print#
l/printAno/print/selinfos C p/nosinf#
l/printAno/coverpa'e C p/nocove#
l/printAno/ne/pa'e C p/nonep#
l/printAno/print/listinfos C p/nolinf#
l/printAreserve/lines C p/reserv#
l/printAprint C p/print#
E0127R8#
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
R 27R8 T/S7RT/B.IL1 R
RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
27R8 t/sort/"uild .SI03 l/sort T9PE slis/t/sortinfo/alv#
1ATA= ls/sort T9PE slis/sortinfo/alv#
ls/sortAfieldname C B%ARRI1B#
ls/sortAspos C -#
ls/sortAup C B6B#
ls/sortAsu"tot C B6B#
APPE01 ls/sort T7 l/sort#
E0127R8#
35 of 35