当前位置:网站首页>ALV report flow diagram
ALV report flow diagram
2022-07-26 05:11:00 【Lunar Yin shortage】
https://zhuanlan.zhihu.com/p/355316708
Write a ALV The steps of the report are as follows :
1. Declare the variables needed
TABLES: mseg , mkpf , ztmm063h , mara , makt , ekpo , ekko ,ztbc120h.
2. Define various options for the screen :
for example
SELECT-OPTIONS : s_mblnr FOR mseg-mblnr,
s_budat FOR mkpf-budat,
s_werks FOR mseg-werks,
s_lgort FOR mseg-lgort,
s_matnr FOR mara-mathn,
s_charg FOR ztmm063h-charg,
s_ebeln FOR ekpo-ebeln,
s_lifnr FOR mseg-lifnr.
SELECT-OPTIONS END OF BLOCK b1.
3. Reference output structure
DATA: gt_alv TYPE TABLE OF zsmm141a_alv,
gwa_alv TYPE zsmm141a_alv.
4. Define data processing logic
START-OF-SELECTION.
PERFORM frm_get_data.

Related knowledge
Internal table
An internal table is a sequence of data objects of the same type .
The internal table only exists during the operation of the program .
1. Purpose of internal table :
Temporarily store the data read from the database table , For further processing
Temporarily store the list data for display
As a data buffer, it is used for data exchange with other programs
2. Characteristics of internal tables
The number of rows in the internal table is not predefined , But dynamic growth ( Every time I grow 8K)
Row type of internal table (LINETYPE) It can be any kind of ABAP data type .
3. Types of internal tables :
Standard table , There is a linear index , Access mainly through index .
Sort table , Defined primary key , It can be accessed through primary key and index .
Hashtable , No index , It can only be accessed through the primary key .
4. Processing keywords of internal tables
APPEND: Add the contents of the workspace to the end of the internal table
INSERT: Add the contents of the workspace to the location specified by the internal table ( Line number )
COLLECT: Compare non numeric fields , Add numeric fields to the internal table
MODIFY: Overwrite the contents of the workspace with the rows specified in the internal table
DELECT: Delete the specified row from the internal table
LOOP AT: Read the data of the internal table row by row into the workspace
READ TABLE: Read the data of a specific row of the internal table into the workspace
SORT: Sort the interior
CLEAR: Be clear about the contents of the workspace
REFRESH: Delete all records in the internal table
database
stay ABAP In the program , There are two ways to access the database
OPEN SQL : standard SQL Subset , And ABAP Fully integrated , It is database independent , The database interface will automatically convert it to the standard of the database used SQL.
NATIVE SQL: Related to databases , Use the standards provided by the database SQL, Without syntax checking and conversion of database interface .
Avoid using NATIVE SQL
OPENSQL Visit introduction
OPENSQL Only function data operation language DML, Data definition language DDL adopt ABAP Dictionary object control .
adopt OPEN SQL What can be done :SELECT , UPDATE , INSERT , DELETE , MODIFY
You can use the system variable SY-SUBRC Judge whether the operation is successful ,SY-SUBRC = 0 Indicates successful execution , SYBRC <>0 It means that the execution is unsuccessful ,
For more detailed information, refer to the online help document
SAP SQL The basic format
SELECT Clause is used to determine what data to read - What fields does the result contain - Need to read single record or multiple records (SINGLE)- Whether the result can contain duplicate records (DISTINCT)
INTO Clause indicates the declared location where the read data is put into memory ( Variable , work area , Internal table )FROM Clause represents the data source ( Tables or views )
SAP SQL Read mode
have access to SELECT SINGLE Read a single record , Make sure that the records read out are unique , Need to be in WHERE Determine all primary keys in the statement
If not applicable SINGLE keyword , Then read all that meet WHERE Record of conditions , There are two ways to read :
1. Read the target area line by line in a circular way , Need by ENDSELECT Statement with .
2. Use SELECT…INTO TABLE sentence , Read all records that meet the conditions into the internal table at one time , No loops are used , Step needs ENDSELECT. This way of reading data is more efficient than the previous one .
3. stay INO clause , have access to CORRENPSONDING FIELDS OF , The system only fills in fields with the same name , If not applicable , Fill in from left to right
4. In the field list and WHERE clause , Just specify the field name , There is no need to specify the table name .•WHERE You can use AND or OR Realize complex logical conditions .
5.SELECT * Statement to read all fields of the transparent table , There can be no INTO Clause , But you have to use TABLES Declare transparent table .
SAP SQL Table linking method
have access to JOIN Connect multiple transparent tags to query
INNER JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
Transparent tables can use aliases .
If the field exists in only one table , There is no need to specify the table name
边栏推荐
- ThreadLocal transfer between parent and child threads in asynchronous
- Earth system model (cesm) practical technology
- NPM operation instruction
- Excel VBA: realize automatic drop-down filling formula to the last line
- LeetCode链表问题——203.移除链表元素(一题一文学会链表)
- Briefly describe the application fields of WMS warehouse management system
- Redis解决库存超卖问题
- Teach you how to use code to realize SSO single sign on
- Molecular skeleton transition tool -delinker introduction
- uniapp小程序框架-一套代码,多段覆盖
猜你喜欢

MySQL master-slave synchronization and master-slave synchronization delay solution

Nacos registry

Axi protocol (4): signals on the Axi channel

普林斯顿微积分读本02第一章--函数的复合、奇偶函数、函数图像

MySQL基础学习

Embedded sharing collection 21

Embedded sharing collection 20

Redis solves the problem of oversold inventory

AXI协议(4):AXI通道上的信号

没背景、没学历?专科测试员进入互联网大厂是不是真的没希望?
随机推荐
推荐必读:测试人员如何快速熟悉新业务?
AQS唤醒线程的时候为什么从后向前遍历,我懂了
Common solutions for distributed ID - take one
注解@Autowired如何自动装配
Nacos registry
【Leetcode】493. Reverse Pairs
The landing of tdengine in the GPS and AIS scheduling of Zhongtian steel
Icml2022 | imitation learning by evaluating the professional knowledge of the presenter
DOM事件流 事件冒泡-事件捕获-事件委托
security权限管理详解
Excel VBA:将多个工作表保存为新文件
How to reproduce the official course of yolov5 gracefully (II) -- Mark and train your own data set
C语言力扣第41题之缺失的第一个正数。两种方法,预处理快排与原地哈希
A material of machine learning
Embedded sharing collection 20
阿里三面:MQ 消息丢失、重复、积压问题,如何解决?
公交站间的距离 : 简单模拟题
How to connect tdengine through idea database management tool?
5个chrome简单实用的日常开发功能详解,赶快解锁让你提升更多效率!
如何优雅的复现YOLOv5官方历程(二)——标注并训练自己的数据集