当前位置:网站首页>ALV report in SAP tutorial - ABAP list viewer -012
ALV report in SAP tutorial - ABAP list viewer -012
2022-06-22 16:22:00 【Boating in rainy days】
SAP In the tutorial ALV The report - ABAP List viewer -012
A common required feature of any report is “ Column alignment ”, Sort , Filter , Subtotal , Total, etc . To do this from scratch , A lot of coding work is required . To avoid that , We can use one called ABAP List viewer (ALV) The concept of .
In this tutorial , You will learn :
- Simple report
- Block report
- Tiered reporting
- Show variations
Each of these reports provides Function module , These modules help to easily generate the required output . Let's take a closer look at them -
Simple report
The important functional modules in these reports 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 the field directory , This is true of ALV It is important to display data in .
If the output data comes from a single dictionary table , And all columns are selected , Then we do not need to create the field directory exclusively . stay REUSE_ALV_LIST_DISPLAY Take the table name as a parameter (I_structure_name) Mention is enough . But in other cases , We need to create it .
Be careful : Field directories can also be manually populated by populating the internal table with all the required details
The important parameters in :
1. exit :
- I_program_name: The report ID
- I_internal_tabname: Internal output table
- I_inclname: contain Or the name of the report that processes all dynamic forms .
2. change
- ct_fieldcat : The type is SLIS_T_FIELDCAT_ALV The internal table of , In type pool SLIS In a statement .
REUSE_ALV_LIST_DISPLAY
This is the function module for printing data .
Important parameters are :
1. exit :
- I_callback_program: The report ID
- I_bypassing_buffer : ‘X’
- I_buffer_active : ’ ’
- I_callback_pf_status_set : routine , Users can set their own pf Status or change existing pf Function of state .
- I_callback_user_command: Routines that handle function code .
- I_structure name : The name of the dictionary table
- Is_Layout: Set the structure of the report layout
- It_fieldcat: Internal tables , It contains a list of all fields to be printed and their attributes ( This table can be automatically populated by functions )
- It_events : Internal table , It includes ALV A list of all possible events and their corresponding form names .
2. form :
- a. t_outtab: Internal table containing the data to be output
REUSE_ALV_EVENTS_GET:
Returns a table of possible events of list type
1. Import :
Et_Events : The event table will return the specified list type ( Column “NAME”) All possible callback events for . For the event to be handled by the callback , Its... Must be filled in “FORM” Field . If the field is initialized , Then ignore the event . This entry can be read from the event table , Fill in fields “FORM”, And use the type pool SLIS The constants in modify the entry .
2. exit :
I_list_type:0 = Simple list REUSE_ALV_LIST_DISPLAY
1 = Hierarchical order list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = Simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = Hierarchical order block list REUSE_ALV_BLOCK_LIST_HS_APPEND
REUSE_ALV_GRID_DISPLAY
ABAP4.6 New features in version , Used to display results in a grid , Instead of previewing .
Parameters : And reuse_alv_list_display identical
Be careful : The grid cannot handle high volumes . Sorting and other functions , If the amount of data to be displayed is very high , Scrolling down consumes a lot of resources / Time . There is no clear definition , If the amount of data is X, Then select a list or grid , But the developer must call it based on his experience . If not sure , Then the list is a better choice
REUSE_ALV_COMMENTARY_WRITE
This is in “ The first page ” Event to print the title and other comments of the list .
Important parameter
- It_list_commentary : The title is slis_t_listheader Internal table for .
This internal table has three fields :
- type : ‘H’ – title , ‘S’ – choice , ‘A’ – action
- key : Only if the typical value is “S” when .
- Information : Text to print
Block report
This looks like a simple report , But this report only has sorting and filtering functions . If you have to display multiple reports on the output , Use this report . Technically speaking , If you have multiple internal tables , The data is displayed as separate blocks , Then we will choose ALV Block report for .
Important functions for creating this report include :
- REUSE_ALV_BLOCK_LIST_INIT
- REUSE_ALV_BLOCK_LIST_APPEND
- REUSE_ALV_BLOCK_LIST_DISPLAY
REUSE_ALV_BLOCK_LIST_INIT
This function module is used to set the default GUI State, etc . These parameters are similar to reuse_alv_list_display or reuse_alv_grid_display
REUSE_ALV_BLOCK_LIST_APPEND
This function module adds data to the block .
Important parameter
1. exit :
- is_layout: Block layout settings
- it_fieldcat: Field Directory
- I_tabname: Internal table name containing all possible events
2. form : - t_outtab: Internal table containing output data .
REUSE_ALV_BLOCK_LIST_DISPLAY
This function module displays a list containing the data attached to the above function .
Parameters : All parameters are optional .
Tiered reporting
Hierarchical display is used to display relevant data . Such as sales order and material details . here , Sales order details can be header data , The items in the sales order can be item data
The function modules used for this purpose are
REUSE_ALV_HIERSEQ_LIST_DISPLAY
exit :
- I_CALLBACK_PROGRAM
- I_CALLBACK_PF_STATUS_SET
- I_CALLBACK_USER_COMMAND
- IS_LAYOUT
- It_fieldcat
- It_events
- I_tabname_header : The name of the internal table in the program that contains the highest hierarchy level output data .
- I_tabname_item : The name of the internal table in the program that contains the output data at the lowest hierarchy level .
- Is_keyinfo: This structure contains links between two tables ( Share key ) Title and item table field name .
surface
- t_outtab_header: Picture table to output data
- t_outtab_item : The name of the internal table in the program that contains the output data at the lowest hierarchy level .
Internal table 、 All definitions of structures and constants are in the name SLIS Declared in the type pool of . have access to REUSE_ALV_FIELDCATALOG_MERGE Auto populate this internal table .
Show variations
- Show variations for setting alv Default properties for output , Such as sorting conditions 、 Filter conditions 、 Total and subtotal, etc
- Display variations can be user specific and standard ( Standard variants can be used by any user )
- The display variant type that can be saved is determined by the parameters passed in the function module i_save control reuse_alv_list_display/ reuse_alv_grid_display
- You can provide an option on the selection screen , To select the display variant to use
And selection / Verify that the common functional modules related to display variants are
- Reuse_alv_variant_default_get
- Reuse_alv_variant_f4
- Reuse_alv_variant_existence
This is it. ABAP-ALV The whole content of programming !
Reference resources :https://www.guru99.com/alv-list-view-programming.html
边栏推荐
- Make the text template in pycharm project support jinjia2 syntax
- What is the relationship between CSC securities and qiniu school? Is it safe to open a securities account
- 【山大会议】使用TypeScript为项目进行重构
- GD32F4xx MCU 驱动mcp2515扩展CAN接口
- [Shanda conference] definitions of some basic tools
- SAP ABAP 对话框编程教程:中的模块池-09
- 5.文件的读写(学生类)
- SAP ABAP 报告编程-08
- Pod type
- Dear students, don't read the textbooks any more. Just read this one for the complexity of time
猜你喜欢
随机推荐
How to embody the value of knowledge management in business
Applet development - Custom expiration cache
【小程序项目开发-- 京东商城】uni-app开发之分包配置
6.gui (graphics, filling)
Alibaba cloud middleware's open source past
解决mysql远程登录报权限问题
[Shanda conference] project introduces Redux
Make the text template in pycharm project support jinjia2 syntax
Linux安装mysql
[Shanda conference] establishment of webrtc tools for multi person video call
shell学习
Rosbag use command
[Shanda conference] acquisition of user media based on webrtc
着力打造网红产品,新捷途X70S焕新上市,8.79万起售
The difference between nvarchar and varchar
静态断言 static_assert
SAP ABAP data types, operators and editors-02
MySQL trigger
odoo部署到服务器并配置为服务
[VTK] model rotation and Translation









