当前位置:网站首页>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
边栏推荐
- What is a low code development platform? Why is it so hot now?
- Database log
- 【STL编程】【竞赛常用】【part 2】
- [required reading for high-quality products] sub query of Oracle database in Linux system
- Redis cluster Series III
- CSDN 技能树使用体验与产品分析(1)
- 可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹
- Logcli Loki command line tool
- Longitude and latitude analysis
- Talk about graduation season
猜你喜欢

CSDN skill tree experience and product analysis (1)

数智化进入“深水区”,数据治理是关键

云原生安全指南: 从零开始学 Kubernetes 攻防

Grasp the detailed procedure of function call stack from instruction reading

Mongodb introduction and typical application scenarios

NVIDIA three piece environment configuration

Oracle 架构汇总

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

蓄力中台,用友iuap筑牢社会级企业数智化新底座

#夏日挑战赛# OpenHarmony HiSysEvent打点调用实践(L2)
随机推荐
NVIDIA三件套环境配置
Ble Bluetooth module nrf518/nrf281/nrf528/nrf284 chip scheme comparison
北汽制造全新皮卡曝光,安全、舒适一个不落
海量数据出席兰州openGauss Meetup(生态全国行)活动,以企业级数据库赋能用户应用升级
UOS prompts for password to unlock your login key ring solution
Redis 大 key 问题处理总结
润迈德医疗开启招股:未有基石投资者参与,亏损金额翻倍增长
NVIDIA three piece environment configuration
SQL审核平台权限模块介绍和账号创建教程
安全才是硬道理,沃尔沃XC40 RECHARGE
Postman Chinese tutorial (postman Chinese version)
Mass lucky hash game system development - conflict resolution (code analysis)
实现字符串MyString
数据库事务
Common shell script commands (III)
Cloud native Security Guide: learn kubernetes attack and defense from scratch
元宇宙虚拟数字人离我们更近了|华锐互动
Redis cluster
可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹
Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance