SUPPRESS DIALOG

本文详细介绍了ABAP中SUPPRESSDIALOG语句的作用及使用场景。此语句允许在处理dynpro时不显示其屏幕,而保持前一dynpro屏幕可见。文中还通过示例展示了如何利用该功能在不显示特定dynpro的情况下处理列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Syntax

SUPPRESS DIALOG.

Effect

If this statement is specified during PBO processing, then the current dynpro is processed without displaying the screen, while the screen of the previous dynpro remains visible. After the PBO processing, the system triggers the event PAI in such as way, as if a user had pressed Enter. The function code assigned to this key in the current GUI status is then transported to sy-ucomm and to the OK field. Outside of PBO processing, this statement has no effect.

If during PAI processing with the statement MESSAGE, either a termination message, error message, information message or a warning is sent, then the screen of the current dynpro is displayed together with the message.

Example

You can use SUPPRESS DIALOG to display lists while dynpros are processed, without displaying the screen of the dynpro during whose processing the list is created.

MODULE call_list OUTPUT.
SUPPRESS DIALOG.
SET PF-STATUS space.
WRITE 'Basic List'.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
ENDMODULE.

// SimplifyModelDialog.cpp #include "SimplifyModelDialog.hpp" #include <uf_modl.h> #include <uf_obj.h> #include <vector> SimplifyModelDialog::SimplifyModelDialog() { UF_UI_create_block("Simplify Model", &block); // 加载.dlx文件(需提前设计) UF_UI_import_block(block, "SimplifyModel.dlx"); UF_UI_add_callback(block, BUTTON_RUN, RunCallback); } SimplifyModelDialog::~SimplifyModelDialog() { UF_UI_delete_block(block); } int SimplifyModelDialog::ShowDialog() { UpdateFeatureList(); return UF_UI_ask_block(block, NULL); } void SimplifyModelDialog::RunCallback(UF_UI_block_t* block, int id) { SimplifyModelDialog* dialog = static_cast<SimplifyModelDialog*>(UF_UI_get_block_data(block)); dialog->ExecuteSuppression(); } void SimplifyModelDialog::UpdateFeatureList() { // 清空列表 UF_UI_list_clear(block, LIST_FEATURES); // 遍历部件特征,查找孔特征 tag_t part = UF_PART_ask_display_part(); tag_t feature = NULL_TAG; std::vector<tag_t> holeFeatures; UF_OBJ_cycle_objs_in_part(part, UF_feature_type, &feature); while (feature != NULL_TAG) { char featType[UF_MODEL_TYPE_MAX_STRING_LEN+1]; UF_MODL_ask_feat_type(feature, featType); // 检测孔特征(普通孔或螺纹孔) if (strcmp(featType, UF_MODL_SIMPLE_HOLE) == 0) { holeFeatures.push_back(feature); } UF_OBJ_cycle_objs_in_part(part, UF_feature_type, &feature); } // 将孔特征添加到列表 for (tag_t hole : holeFeatures) { char featName[UF_OBJ_NAME_LEN+1]; UF_OBJ_ask_name(hole, featName); UF_UI_list_insert(block, LIST_FEATURES, -1, featName); } } void SimplifyModelDialog::ExecuteSuppression() { // 获取用户勾选状态 logical suppressChamfer = UF_UI_get_toggle(block, TOGGLE_CHAMFER); logical suppressHole = UF_UI_get_toggle(block, TOGGLE_HOLE); logical suppressThreadedHole = UF_UI_get_toggle(block, TOGGLE_THREADED_HOLE); // 遍历并抑制特征 tag_t part = UF_PART_ask_display_part(); tag_t feature = NULL_TAG; UF_OBJ_cycle_objs_in_part(part, UF_feature_type, &feature); while (feature != NULL_TAG) { char featType[UF_MODEL_TYPE_MAX_STRING_LEN+1]; UF_MODL_ask_feat_type(feature, featType); // 判断是否抑制 logical suppress = false; if (suppressChamfer && strcmp(featType, UF_MODL_CHAMFER) == 0) { suppress = true; } else if (strcmp(featType, UF_MODL_SIMPLE_HOLE) == 0) { logical isThreaded = is_threaded_hole(feature); if ((suppressHole && !isThreaded) || (suppressThreadedHole && isThreaded)) { suppress = true; } } if (suppress) { UF_MODL_suppress_feature(feature); } UF_OBJ_cycle_objs_in_part(part, UF_feature_type, &feature); } UF_UI_message("Suppression completed!"); }
最新发布
05-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值