当前位置:网站首页>Abap-sm30 check before deletion
Abap-sm30 check before deletion
2022-06-27 20:37:00 【Tab Zhu】
Title
SM30 enhance - Verify before deleting
I published an article about SM30 Enhanced articles , Today is a little supplement : Use EVENT To check before deleting
One
Method 1- Add events -EVENT
TCODE: SE54 Enter a view name , Then click environment -> event
Add serial number as 03 The entry of , Write the name of the routine that contains the check code
After the save , Click editor , Write code
explain : There are several explanations for the following code :
- EXTRACT-MARK Field is X Indicates that the row is selected
- The code in the text is dang CONTEXT = ' Standard order ' when ,MARK = SPACE, At the same time, a warning is given that deletion is not allowed
- Pay attention to execution SM30 The program needs to be activated before the function , preservation SE54 Configuration of , And then quit , Running SM30(PS: I always keep it when testing , Activate program , Didn't quit SE54 Configuration interface , test SM30 Never , This led me to suspect that maintenance events 03 The function of checking before deleting cannot be realized ) FORM frm_before_delete
FIELD-SYMBOLS <field> TYPE any. FIELD-SYMBOLS <value> TYPE any. DATA ls_zvjxzhu TYPE zvjxzhu_01. DATA lv_message TYPE c. LOOP AT extract. ASSIGN COMPONENT 'MARK' OF STRUCTURE extract TO <field>. IF <field> IS ASSIGNED AND <field> IS NOT INITIAL. ASSIGN COMPONENT 'CONTEXT' OF STRUCTURE extract TO <value>. IF sy-subrc EQ 0 AND <value> = ' Standard order '. lv_message = 'X'. clear <field>. MODIFY extract. ENDIF. ENDIF. ENDLOOP. IF lv_message = 'X'. MESSAGE ' Standard orders cannot be deleted ' TYPE 'I' DISPLAY LIKE 'S'. ENDIF. ENDFORM.
Two
Method 2- Modify the code directly in the function group screen
For this method 2 Point description :
- VIM_MARKED Indicates whether to select this row
- FUNCTION Is the current function button , Delete as 'DELE'
MODULE delete_before_check INPUT. DATA ls_zvjxzhu TYPE zvjxzhu_01. IF vim_marked NE space AND function = 'DELE'. IF zvjxzhu_01-context = ' Standard order '. CLEAR vim_marked. ENDIF. ENDIF. ENDMODULE.
The effect of the first method is shown in the figure below : Click the delete button
边栏推荐
猜你喜欢

Postman 汉化教程(Postman中文版)

数据库锁问题

【STL编程】【竞赛常用】【part 1】

微信iOS版8.0.24更新发布 缓存细分清理上线

A distribution fission activity is more than just a circle of friends

UE4 realizes long press function

本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献

NVIDIA三件套环境配置

No wonder people chose apifox instead of postman

Web APLS phase - Section 14 - local storage
随机推荐
一段时间没用思源,升级到最新的 24 版后反复显示数据加密问题
eval函数,全局、本地变量
CocosCreator播放音频并同步进度
Grasp the detailed procedure of function call stack from instruction reading
[STL programming] [common competition] [Part 2]
蓄力中台,用友iuap筑牢社会级企业数智化新底座
【bug】上传图片出现错误(413 Request Entity Too Large)
As a software engineer, give advice to young people (Part 2)
DBeaver恢复和备份数据库的方式
SQL audit platform permission module introduction and account creation tutorial
元宇宙虚拟数字人离我们更近了|华锐互动
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
Binary tree related problems 2
UE4 realizes long press function
database engine
Practice of combining rook CEPH and rainbow, a cloud native storage solution
[help] troubleshooting of JVM's high CPU resource consumption
When developing digital collections, how should cultural and Museum institutions grasp the scale of public welfare and Commerce? How to ensure the security of cultural relics data?
Data intelligence enters the "deep water area", and data governance is the key
Mongodb introduction and typical application scenarios