Vous êtes sur la page 1sur 5

ALV REPORT aruquiapricecircle-ca.

com

Simple Report
Important function modules in these report are

Reuse_alv_fieldcatalog_merge Reuse_alv_list_display Reuse_alv_events_get Reuse_alv_grid_display Reuse_alv_commentary_write

REUSE_ALV_FIELDCATALOG_MERGE This function module is used to populate a field catalog which is essential to display the data in ALV. If the output data is from a single dictionary ta le and all the columns are selected! then we need not e"clusively create the field catalog. Its enough to mention the ta le name as a parameter #I_structure_name$ in the R%&S%_ALV_LIST_'IS(LA). *ut in other cases we need to create it. +ote , -ieldcatalog can e filled manually also y filling up all the re.uired details into the internal ta le Important parameters in are, 1. Export:
I_program_name , report id I_internal_ta name , the internal output ta le I_inclname , include or the report name where all the dynamic forms are

handled. 2. Changing
ct_fieldcat , an internal ta le with the type SLIS_T_-I%L'/AT_ALV which is

declared in the type pool SLIS. REUSE_ALV_LIST_DISPLAY This is the function module which prints the data. The important parameters are, 1. Export:
I_call ac0_program , report id I_ ypassing_ uffer , 123

I_ uffer_active , 1 1 I_call ac0_pf_status_set , routine where a user can set his own pf status or

change the functionality of the e"isting pf status. I_call ac0_user_command , routine where the function codes are handled. I_structure name , name of the dictionary ta le Is_Layout , structure to set the layout of the report It_fieldcat , internal ta le with the list of all fields and their attri utes which are to e printed #this ta le can e populated automatically y the function$ It_events , internal ta le with a list of all possi le events of ALV and their corresponding form names. 2. Tables:
a. t_outta , internal ta le with the data to e output

REUSE_ALV_EVENTS_GET: Returns ta le of possi le events for a a list type 1. Import: Et_Events :The event ta le is returned with all possi le /ALL*A/4 events for the specified list type #column 1+A5%3$. -or events to e processed y the /all ac0! their 1-6R53 field must e filled. If the field is initiali7ed! the event is ignored. The entry can e read from the event ta le! the field 1-6R53 filled and the entry modified using constants from the type pool SLIS. 2. Export: I_list_type, 8 9 simple list R%&S%_ALV_LIST_'IS(LA) : 9 hierarchical-se.uential list R%&S%_ALV_;I%RS%<_LIST_'IS(LA) = 9 simple loc0 list R%&S%_ALV_*L6/4_LIST_A((%+' > 9 hierarchical-se.uential loc0 list R%&S%_ALV_*L6/4_LIST_;S_A((%+' REUSE_ALV_GRID_DISPLAY A new function from A*A(?.@ version! to display the results in grid rather than a preview. (arameters , same as reuse_alv_list_display

Note:Grid cannot handle high volumes. Functions like sort, scrolling down consumes a lot of resources / time if the volume of data to be displayed is high. There is no clear cut definition such that if the amount of data is go for list or grid but the developer has to take a call based on his e!perience. "f not sure, then list is the better option
REUSE_ALV_COMMENTARY_WRITE

This is used in the Top-of-page event to print the headings and other comments for the list. Important (arameters
It_list_commentary , Internal ta le with the headings of the type

slis_t_listheader. This internal ta le has three fields,


1. Typ , 1;3 A header! 1S3 A selection! 1A3 A action 2. 4ey , only when typ is 1S3. 3. Info , the te"t to e printed

*loc0 Report
This loo0s li0e a simple report ut this report has the features of sorting and filtering only.This report is used if you have to display more than one report on the output. Technically spea0ing if you have multiple internal ta le with data to e displayed as separate loc0s then we go for loc0 report of ALV. The important functions used for creating this report are,
R%&S%_ALV_*L6/4_LIST_I+IT R%&S%_ALV_*L6/4_LIST_A((%+' R%&S%_ALV_*L6/4_LIST_'IS(LA)

REUSE_ALV_BLOCK_LIST_INIT This function module is used to set the default gui status etc. The parameters are similar to the one used in reuse_alv_list_display or reuse_alv_grid_display REUSE_ALV_BLOCK_LIST_APPEND This function module adds the data to the loc0. Important (arameters 1.Export :
is_layout , layout settings for loc0 it_fieldcat , field catalog I_ta name , internal ta le name with all all possi le events

2.Tables :
t_outta , internal ta le with output data.

REUSE_ALV_BLOCK_LIST_DISPLAY This function module display the list with data appended y the a ove function. (arameters , All the parameters are optional.

;ierarchical Reports
;ierarchical display is used for displaying data that are related. Li0e sales order and item details. ;ere sales order details can e the header data whereas them

items in the sales order can e the item data The function module used for this is REUSE_ALV_HIERSEQ_LIST_DISPLAY Export: I_/ALL*A/4_(R6BRA5 I_/ALL*A/4_(-_STAT&S_S%T I_/ALL*A/4_&S%R_/655A+' IS_LA)6&T It_fieldcat It_events I_ta name_header , +ame of the internal ta le in the program containing the output data of the highest hierarchy level. I_ta name_item , +ame of the internal ta le in the program containing the output data of the lowest hierarchy level. Is_0eyinfo , This structure contains the header and item ta le field names which lin0 the two ta les #shared 0ey$. Tables
t_outta _header , ;eader ta le with data to e output t_outta _item , +ame of the internal ta le in the program containing the output

data of the lowest hierarchy level. All the definitions of internal ta les! structures and constants are declared in a type-pool called SLIS. This internal ta le can e populated automatically y using R%&S%_ALV_-I%L'/ATAL6B_5%RB%3.

'isplay Variants
'isplay variants are used to set the default properties of an alv output li0e sort

criteria! filtering criteria! totaling and su totaling etc 'isplay variants can e user specific and standard #standard variants can e used y any user $ 4ind of display variants that can e saved is controlled y the parameter i_save that is passed in function modules reuse_alv_list_display C reuse_alv_grid_display )ou can provide an option on the selection screen to select what display variant to e used The common function modules related to selecting C validating display variants are
1. Reuse_alv_variant_default_get 2. Reuse_alv_variant_f? 3. Reuse_alv_variant_e"istence

Thats all to A*A(- ALV programmingD

:E. Fhat are the events in A*A(C? languageG- Initiali7ation! At selection-screen!Start-ofselection! end-of-selection! top-of-page! end-of-page! At line-selection!At user-command! At (-! Bet! At +ew! At LAST! AT %+'! AT -IRST.

=H Fhat is the role of *'/data in call transaction methodGin dc you need to pass data to particular screen and particular screen fields.Fe do this using the structure *'/'ATA availa le in the a ap dictonary. for more information Iust have a loo0 at a sample code for *'/ >H what is dcmsgcol and how it wor0s with call transaction methodG *'/5SB/6LL is a structure availa le in the a ap dictonary. Fe use this to handle errors in call transaction. Fe need to declare an internal ta le li0e dcmsgcoll. Fhen a data ase ta le is updated we get some messages li0e sucessfull ! or not sucessfull or sucessful with some warning message. All these messages pass through this structure. Fe can capture them using a function module called -6R5AT_5%SSAB%.?H Fhat is the role of #gui_upload$ functional module in call transaction methodGits the same as ws_upload or &pload fm. used for uploading data from flat file to internal ta le.JH what is the difference etween synchronous and asynchronous updateGin synchronous updated the parent ta le is updated along with

the child ta les and then a sy-su rc is returned. 8 fior sucessful and ? or K for not sucessful. Fhile in asynchronous updatetion after the updation of the parent ta le we get a sy-su rc return. The system is not othered if the child ta les are updated or not. http,CCscn.sap.comCthreadCJ>>>:> http,CCwi0i.sdn.sap.comCwi0iCdisplayCA*A(CA*A(L'evelopmentLandL (rogramming
Read more at http,CCwww.saptraininghu .comCalv-list-viewprogrammingCM(??7T)Iil8Ti:*L%.NN

Vous aimerez peut-être aussi