Notas de Preguntas Leccion ALV

You might also like

You are on page 1of 3

In global class CL_GUI_ALV_GRID that is delivered by SAP, the DBLCLICL_R !

_C L event is de"ined, #hich is triggered #hen a cell in the list is do$ble%clic&ed' (o$ have #ritten a )rogra* in #ich data is dis)layed in a lis $sing class CL_GUI_ALV_GRID' !hat do yo$ have to do in yo$r )rogra* to res)ond the event+ ,ore than one ans#er is correct' Decide #ether eache ans#er is tr$e or "alse' _"_ _t_ _t_ _t_ Ca)t$re the event #ith the CA-C. state*ent Create yo$r o#n class Register on the event $sing S/- .A0DL/R state*ent !rite a handling *ethod "or the event

!hat can yo$ control $sing the "ield catalog o" an SAP ALV grid control+ 1 In"l$ence the "or*at )ro)erties o" col$*n contents, s$ch as the n$*ber o" deci*al )laces or the align*ent o" the content o" a cell ___ $t)$t the list in a stri)ed )attern ___ S)eci"y the colors o" the list ro#s 1 .ide the list col$*ns 1 Set the o$t)$t characteristic o" a col$*n, s$ch as the col$*n )osition o" #idth -he si*)lest #ay to )ass the in"or*ation abo$t "or*atting is $sing a lin& to a Dictionary str$ct$re in the )ara*eter2 a3 i_str$ct$re_na*e b3is_layo$t c3it_o$ttab' d3it_s)ecial_gro$)s Res$*en 42 At least the dis)lay data "ro* the internal table and in"or*ation abo$t "or*atting *$st be )assed' !hen dis)lay on the re)resentation server is re"resh' Pro*)ts the re)resentative instance to send2 a3 -he contents o" the data table' b3 I" necessary, the additional in"or*ation again' c3 nly line ty)e d3 Part o" data table Res$*en 52 /6a*)les o" ty)ical sit$ations in #hich yo$ need to )ass a "ield catalog are2 % Altho$gh the internal table containing the data has a ro# ty)e #ith Dictionary re"erence, the dis)lay is di""er "ro* it, "or e6a*)le #ith regard to col$*n )osition or title' % -he internal table has 7only or additionally3 col$*ns that are not contained in dictionary str$ct$re' .o#ever, "or *any re8$eri*ents, there are alternatives to $sing the "ield catalog' Be"ore yo$ de"ine and "ill a "ield catalog, and )ass it to the re)resentative instance, yo$ can consider #hether yo$ can i*)le*ent yo$r re8$eri*ents another #ay' In so*e cases, there are alternative sol$tions that are both si*)ler and *ore "le6ible' Res$*en 92 -hree ty)es o" sit$ations can occ$r2 Case 42 (o$ can have the "ield catalog a$to*atically generated by the re)resentative instance by )assing the na*e o" the global str$ct$re ty)e' Col$*ns o" the data table not de"ined in the global str$ct$re ty)e are not dis)layed'

Case 52 -ho$gh all "ields o" a global str$ct$re occ$r in the data table #ith the sa*e na*es, ad:$st*ents *ay be re8$ired to be *ade' Li&e "or e6a*)le, to the s)eci"ications "ro* the ABAP Dictionary or additional col$*ns are to be o$t)$t, or both' In this case, yo$ need to create ro#s in the "ield catalog "or the col$*ns to be changed or added' Case 92 -he ro# ty)e o" the data table contains either no re"erence to the ABAP Dictionary, or only to individ$al global str$ct$re "ields or data ele*ents' In this case, the "ield catalog needs to be co*)letely created by the calling )rogra*' Res$*en ;2
-he sit$ation sho#n here is )ertinent to the cases t#o and three that #e :$st disc$ssed' <irst, yo$ create a "ield catalog in the calling )rogra*' -hen assign the na*e o" a col$*n "ro* the data table to the "ield "ieldna*e' -his "ield assigns a ro# in the "ield catalog to a col$*n o" the data table' -he other "ields o" the "ield catalog can be divided into t#o gro$)s #ith regard to their $se #hen creating a "ield catalog2

Re"erences to global ty)es 7that is, str$ct$re "ields in the ABAP Dictionary3 are created $sing the "ields re"_"ield and re"_table' All other "ields o" the "ield catalog contain val$es "or the )ro)erties o" the col$*ns'

I" yo$ assign val$es to the "ields re"_table and, i" necessary, re"_"ield, all ty)e de"initions are trans"erred "ro* the s)eci"ied str$ct$re "ields in the ABAP Dictionary' (o$ can over#rite these by assigning val$es to individ$al "ields o" the latter gro$)'

!hat entries need to be *ade in the "ield catalog and in #hich the col$*n in data table is o" locally de"ined ty)e2 a3 "ieldna*e b3re"_"ield c3re"_table d3all re" "ield

Res$*en ;2 -he "ieldna*e col$*n in the "ield catalog contains the col$*n na*e o" the data table' As yo$ can see "ro* the e6a*)le on yo$r screen, every col$*n o" the data table "or #hich yo$ #ant to control "or*atting *$st have a ro# in the "ield catalog' I" yo$ #ant to re"er to a "ield o" a global str$ct$re #ith the sa*e na*e, assign the na*e o" the str$ct$re to the "ield re"_table' B$t, i" the col$*n na*e o" the data table and the str$ct$re "ield na*e are di""erent, yo$ need to add the "ield na*e to the re"_"ield "ield'

In "ollo#ing state*ent, select the o)tions are -RU/ and <ALS/2 DA-A2 B/GI0 < #a_sboo&' I0CLUD/ -(P/ sboo&' DA-A2 )hone -(P/ sc$sto*%tele)hone, cancelled_icon -(P/ icon%id, char ; /0D < #a_sboo&, it_sboo& LI=/ -ABL/ < #a_sboo&' DA-A2 it_"ieldcat -(P/ lvc_t_"cat, #a_"ieldcat LI=/ LI0/ < it_"ieldcat' a3 Part o" the "ield descri)tion co*es "ro* the Dictionary str$ct$re 7SB =3' b3 Part o" the "ield descri)tion is e6)licitly de"ined in the "ield catalog 7it_"ieldcat3' c3-he "ield catalog 7internal table3 is "illed in the )rogra*' d3-he "ield catalog 7internal table3 is )assed on together #ith the na*e o" the Dictionary str$ct$re d$ring the *ethod call' - e3-he "ields o" the data table it_sboo& that cannot be read "ro* the SB = table also need to be "illed *eaning"$lly' In conve*tions o" "or*atting o)tions, the "ollo#ing state*ent C9>>,C;>4 C?col_constant@ A>B4CA>B4C,?col_constant@ is a de"inition2 a3 color b3tittle c3#ithd d3col$*n as an icon In a Dyn)ro, the co*$nication bet#een the control and a))lication )rogra* is )er"or*ed $sing2 a3 Control <ra*e#or& 7C<!3 b3A$to*atiDation Controller c3 C$sto*er Controller d3!indo#s Controller

!hen yo$ )ress Do$ble_Clic& event' !hat #ill ha))en+ a3the event do$ble_clic& is triggered in the calling )rogra*' b3 A handler *ethod can be either a static *ethod o" a local class or an instance *ethod o" an ob:ect' c3-o create a handler ob:ect "or an event, it is "irst necessary to de"ine a local class' 7.andler Class3 d3(o$ store the so$rce code that is to be r$n #hen the event is triggered, #ithin the i*)le*entation o" the handler *ethod' e3-he *ethod, receives the in"or*ation )rovided by the event abo$t the *o$se )osition at the do$ble%clic&, and generates an in"or*ation *essage' "3(o$ can "ind the n$*ber o" the ro# o" the internal table to #hich the Edo$ble%clic&edE ro# in the data area belongs in the ro#_id "ield'

You might also like