无法关闭模式对话框
我正在尝试将屏幕称为弹出窗口。屏幕类型设置为模态对话框
,我可以调用屏幕,但无法关闭它。当我点击小十字时什么也没有发生。下一个屏幕设置为0
。
我作为弹出窗口调用的屏幕不包含任何按钮,也不包含任何硬编码的按钮。有什么想法我做错了吗?
我还希望它返回的屏幕能够刷新(因此它会再次加载 PBO)。我该怎么做?
这是代码:
MODULE werkende_knoppen_subscreen INPUT.
CASE ok_code.
WHEN 'X'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
I'm trying to call a screen as a popup. The screen type is set to Modal dialog box
and I'm able to call the screen, but unable to close it. Nothing happens when I click on the little cross. The next screen is set to 0
.
The screen I'm calling as a popup, doesn't contain any buttons, not any hard coded ones anyway. Any ideas what I'm doing wrong?
I'd also like the screen it returns to, to be refreshed (so it loads the PBO again). How do I do that?
Here is the code:
MODULE werkende_knoppen_subscreen INPUT.
CASE ok_code.
WHEN 'X'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在弹出窗口的 PAI 部分中检查
'EXIT'
(或者,在您的情况下为自定义关闭按钮,'X'
)用户命令。例如:
You should be checking for the
'EXIT'
(or, in your case for the custom close button,'X'
) user command in the PAI part of your popup.For example:
这是一个未记录的功能,但在模式对话框(弹出窗口)中,用于关闭弹出窗口的右上角按钮被分配了
F12
键,因此您必须将此键分配给功能代码并像任何其他功能代码一样处理它。分步过程:
1) 创建ABAP程序(事务代码
SE38
或SE80
)注意:
设置屏幕0
是关闭对话框(0
表示“当前dynpro序列结束”);如果您有一个复杂的屏幕,您也可以使用LEAVE TO SCREEN
(相当于 2 个语句 SET SCREEN + LEAVE SCREEN)。2)创建画面0100(事务码
SE51
或双击CALL SCREEN
后面的0100
)画面类型:模态对话框
流程逻辑:
3 ) 创建GUI状态0100(事务代码
SE41
或双击SET PF-STATUS
后面的0100
)状态类型:对话框
将 F12 键分配给任意功能代码(我选择名称
CANCEL
),并激活该功能代码(按钮“功能代码”):4) 测试
运行程序,您现在可以单击右上角的按钮(或者按 F12 如果您愿意)关闭模式对话框:
This is a non-documented feature but in a modal dialog box (popup), the top-right button to close the popup is assigned the
F12
key, so you must assign this key to a function code and process it as any other function code.Step-by-step procedure:
1) Create the ABAP program (transaction code
SE38
orSE80
)Note:
SET SCREEN 0
is to close the dialog box (0
means "the current dynpro sequence is ended") ; if you have a complex screen you may also useLEAVE TO SCREEN
(which is equivalent to the 2 statements SET SCREEN + LEAVE SCREEN).2) Create the screen 0100 (transaction code
SE51
or double-click0100
behindCALL SCREEN
)Screen type: modal dialog box
Flow logic:
3) Create the GUI status 0100 (transaction code
SE41
or double-click0100
behindSET PF-STATUS
)Status type: dialog box
Assign the F12 key to an arbitrary function code (I chose the name
CANCEL
), and activate this function code (button "Function Code"):4) Test
Run the program, you may now click the top-right button (or press F12 if you prefer) which closes the modal dialog box: