当前位置:网站首页>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
边栏推荐
- 【STL编程】【竞赛常用】【part 2】
- 谈谈我写作生涯的画图技巧
- UE4 realizes long press function
- Logcli Loki command line tool
- NVIDIA three piece environment configuration
- Select auto increment or sequence for primary key selection?
- Recommended practice sharing of Zhilian recruitment based on Nebula graph
- The meta universe virtual digital human is closer to us | Sinovel interaction
- Hash table - Review
- 什么是堆栈?
猜你喜欢

难怪大家丢掉了postman而选择 Apifox

Csdn Skills Tree use Experience and Product Analysis (1)

No wonder people chose apifox instead of postman

Database lock problem

Openharmony hisysevent dotting and calling practice of # Summer Challenge (L2)
Record a failure caused by a custom redis distributed lock

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

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

Database transactions

Web APLS phase - Section 14 - local storage
随机推荐
Redis集群
[bug] there is an error uploading the picture (413 request entity too large)
Bit. Store: long bear market, stable stacking products may become the main theme
Csdn Skills Tree use Experience and Product Analysis (1)
数仓的字符截取三胞胎:substrb、substr、substring
北汽制造全新皮卡曝光,安全、舒适一个不落
UE4 actor Basics
muduo
SQL Server - window function - solve the problem of filtering consecutive n records
SQL reported an unusual error, which confused the new interns
Redis cluster
Cocoscreator plays audio and synchronizes progress
Logcli Loki command line tool
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
从指令交读掌握函数调用堆栈详细过程
Linux system Oracle 19C OEM monitoring management
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
连接集成开发专题月 | 企业主数据治理的驱动因素
NVIDIA three piece environment configuration
Redis persistence