Alv Report Guide
Alv Report Guide
etc. To implement these, a lot of coding and logic is to be put. To a oid that we can use a concept called ABAP List Viewer (ALV). This helps us to implement all the features mentioned er! effecti el!. "sing ALV, #e can ha e three t!pes of reports: $. %imple &eport '. Bloc( &eport ). *ierarchical %e+uential &eport There are some function modules which will enable to produce the abo e reports without much effort. All the definitions of internal tables, structures and constants are declared in a t!pe,pool called %L-%. $. %-.PL/ &/P0&T. The important function modules are: A. &euse1al 1list1displa! B. &euse1al 1fieldcatalog1merge 2. &euse1al 1e ents1get 3. &euse1al 1commentar!1write /. &euse1al 1grid1displa! A. &/"%/1ALV1L-%T13-%PLA4 This is the function module which prints the data. The important parameters are : -. /5port : i. -1callbac(1program : report id ii. -1callbac(1pf1status1set : routine where a user can set his own pf status or change the functionalit! of the e5isting pf status iii. -1callbac(1user1command : routine where the function codes are handled i . -1structure name : name of the dictionar! table . -s1la!out : structure to set the la!out of the report i. -t1fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automaticall! b! the function module &/"%/1ALV16-/L32ATAL071./&7/ ii. -t1e ents : internal table with a list of all possible e ents of ALV and their corresponding form names. --. Tables : i. t1outtab : internal table with the data to be output
B. &/"%/1ALV16-/L32ATAL071./&7/: This function module is used to populate a fieldcatalog which is essential to displa! the data in ALV. -f the output data is from a single dictionar! table and all the columns are selected, then we need not e5clusi el! create the field catalog. -ts enough to mention the table name as a parameter(-1structure name) in the &/"%/1ALV1L-%T13-%PLA4. But in other cases we need to create it. The important Parameters are: -. /5port: i. -1program1name : report id ii. -1internal1tabname : the internal output table iii. -1inclname : include or the report name where all the d!namic forms are handled. -- 2hanging ct1fieldcat : an internal table with the t!pe %L-%1T16-/L32AT1ALV which is declared in the t!pe pool %L-%. 2. &/"%/1ALV1/V/8T%17/T: &eturns table of possible e ents for a list t!pe Parameters : -. -mport: /t1/ ents: The e ent table is returned with all possible 2ALLBA29 e ents for the specified list t!pe (column :8A./:). 6or e ents to be processed b! 2allbac(, their :60&.: field must be filled. -f the field is initiali;ed, the e ent is ignored. The entr! can be read from the e ent table, the field :60&.: filled and the entr! modified using constants from the t!pe pool %ALV. --. /5port: -1List1t!pe: < = simple list &/"%/1ALV1L-%T13-%PLA4 $ = hierarchcal,se+uential list &/"%/1ALV1*-/&%/>1L-%T13-%PLA4 ' = simple bloc( list &/"%/1ALV1BL0291L-%T1APP/83 ) = hierarchical,se+uential bloc( list &/"%/1ALV1BL0291L-%T1*%1APP/83 3. &/"%/1ALV120../8TA&41#&-T/: This is used in the Top,of,page e ent to print the headings and other comments for the list. Parameters : -. it1list1commentar! : internal table with the headings of the t!pe slis1t1listheader. This internal table has three fields : T!p : ?*@ A header, ?%@ A selection , ?A@ , action 9e! : onl! when t!p is ?%@. -nfo : the te5t to be printed
/. &/"%/1ALV17&-313-%PLA4: A new function in B.C ersion, to displa! the results in grid rather than as a pre iew. Parameters : same as reuse1al 1list1displa! This is an e5ample for simple list.
'. BL029 &/P0&T This is used to ha e multiple lists continuousl!. The important functions used in this report are: A. &/"%/1ALV1BL0291L-%T1-8-T B. &/"%/1ALV1BL0291L-%T1APP/83 2. &/"%/1ALV1BL0291L-%T1*%1APP/83 3. &/"%/1ALV1BL0291L-%T13-%PLA4
A. &/"%/1ALV1BL0291L-%T1-8-T This function module is used to set the default gui status etc. Parameters: -. -12ALLBA291P&07&A. --. -12ALLBA291P61%TAT"%1%/T ---. -12ALLBA291"%/&120..A83
B. &/"%/1ALV1BL0291L-%T1APP/83 This function module adds the data to the bloc(. &epeat this function for all the different bloc(s to be displa!ed one after the other. Parameters : /5port : -. is1la!out : la!out settings for bloc( --. it1fieldcat : field catalog ---. i1tabname : internal table name with output data -V. it1e ents : internal table with all possible e ents Tables : i. t1outtab : internal table with output data.
2. &/"%/1ALV1BL0291L-%T1*%1APP/83 This function module is used for hierarchical se+uential bloc(s. 3. &/"%/1ALV1BL0291L-%T13-%PLA4 This function module displa! the list with data appended b! the abo e function. Parameters : All the parameters are optional. *ere the functions &/"%/1ALV16-/L32ATAL071./&7/, &/"%/1ALV1/V/8T%17/T, &/"%/1ALV120../8TA&41#&-T/ can be used.
). *ierarchical &eports: *ierarchical se+uential list output. The function module is A. &/"%/1ALV1*-/&%/>1L-%T13-%PLA4 Parameters: -. /5port: i. -12ALLBA291P&07&A. ii. -12ALLBA291P61%TAT"%1%/T iii. -12ALLBA291"%/&120..A83 i . -%1LA40"T . -T16-/L32AT i. -T1/V/8T% ii. i1tabname1header : 8ame of the internal table in the program containing the output data of the highest hierarch! le el. iii. i1tabname1item : 8ame of the internal table in the program containing the output data of the lowest hierarch! le el. i5. is1(e!info : This structure contains the header and item table field names which lin( the two tables (shared (e!). --. Tables i. t1outtab1header : *eader table with data to be output ii. t1outtab1item : 8ame of the internal table in the program containing the output data of the lowest hierarch! le el. slis1t1fieldcat1al : This internal table contains the field attributes. This internal table can be populated automaticall! b! using ?&/"%/1ALV16-/L32ATAL071./&7/@. -mportant Attributes :
A. col1pos : position of the column B. fieldname : internal fieldname 2. tabname : internal table name 3. ref1fieldname : fieldname (dictionar!) /. ref1tabname : table (dictionar!) 6. (e!($) : column with (e!,color 7. icon($) : icon *. s!mbol($) : s!mbol -. chec(bo5($) : chec(bo5 D. Eust($) : (&)ight (L)eft (2)ent. 9. do1sum($) : sum up L. no1out($) : (0)blig.(F)no out .. outputlen : output length 8. selte5t1l : long (e! word 0. selte5t1m : middle (e! word P. selte5t1s : short (e! word >. repte5t1ddic : heading (ddic) &. ddict5t($) : (%)hort (.)iddle (L)ong %. datat!pe : datat!pe T. hotspot($) : hotspot