You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在VL03N外向交货项目删除时触发自定义警告弹窗?

Implementing a Custom Warning Popup After the Standard Delete Confirmation in VL03N

Nice work tracking down the code path to SAPMV50A -> MV50AF0F_FUNKTION_AUSFUEHREN (right after the FUNKTION_AUSFUEHREN call on line 65)! This is absolutely a valid spot to add your custom logic, and here’s how to do it properly without modifying standard SAP code directly:

Is this location suitable?

Absolutely. The CALL FUNCTION 'FUNKTION_AUSFUEHREN' triggers the standard delete workflow—including the initial "Delete selected item(s)? Y/N" prompt. By adding your code right after this call, you ensure your custom warning runs only after the user has already confirmed the standard popup, which aligns perfectly with your requirement.

Since we’re working with standard SAP code, implicit enhancements are the safest and most upgrade-friendly method. Here’s a step-by-step breakdown:

  1. Open the function module MV50AF0F_FUNKTION_AUSFUEHREN via SE37 or SE80.
  2. Scroll to the line immediately following the CALL FUNCTION 'FUNKTION_AUSFUEHREN' statement.
  3. Right-click on the empty line below it, select Enhance Operations > Insert Implicit Enhancement, and create a new enhancement spot if you don’t have one already.
  4. In the enhancement block, add your custom warning logic. For example:
    " Check if we're in VL03N and processing a delete action
    IF sy-tcode = 'VL03N' AND gv_vorgang = 'L'. " Adjust flag to match your delete action marker
      " Show custom warning popup
      CALL FUNCTION 'POPUP_TO_CONFIRM'
        EXPORTING
          titlebar = 'Custom Deletion Warning'
          text_question = 'Are you certain you want to delete this delivery item?'
          button_1 = 'Proceed'
          button_2 = 'Cancel'
        IMPORTING
          answer = lv_user_choice.
    
      " Handle user's response
      IF lv_user_choice = '2'. " User clicked Cancel
        " Inform user and abort deletion
        MESSAGE 'Deletion has been canceled.' TYPE 'I'.
        " Reset relevant flags to stop the delete process
        gv_loeschen = abap_false.
      ENDIF.
    ENDIF.
    
  5. Activate your enhancement using the enhancement builder (SE24) or the activate button in the editor.

Critical Things to Keep in Mind

  • Target the right action: Make sure your condition checks specifically for the delete operation in VL03N—you don’t want this popup appearing for other actions (like changing items) or in other delivery transactions.
  • Test edge cases: Verify that if the user cancels the standard popup, your custom one doesn’t appear. Also confirm that canceling your popup actually stops the deletion from happening.
  • Avoid conflicts: Check if there are any existing enhancements in this function module before adding your code—you don’t want to overwrite or clash with other customizations.

内容的提问来源于stack exchange,提问作者Duhac

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:16:47