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

同一程序内两个PF-Status使用相同功能代码CONFIRM但配置不同文本/图标实现方案咨询

Great question! You absolutely can configure different text, descriptions, or icons for the same function code CONFIRM across two separate PF-Statuses in your ABAP program—you just need to avoid modifying the global function code properties and instead set up each status individually. Here's how to fix your issue:

Method 1: Static Configuration via Screen Painter (SE41/SE80)

This is the simplest approach if you want fixed, distinct visuals for each screen's CONFIRM button:

  • Open your program in SE80 or SE51, navigate to the first dynpro's PF-Status (via SE41 or the "Screen" editor's status tab).
  • In the PF-Status editor, locate the CONFIRM function code entry. Do not edit the global function code properties (like the text in the "Function Codes" tab)—this is exactly why your changes were syncing across statuses.
  • Instead, select the CONFIRM button in the current status's toolbar/menu list, click the Details button (or double-click the entry). Here, you can modify the local display text, icon, or tooltip specifically for this PF-Status. These settings are tied only to the current status, not the global function code.
  • Save and activate the status. Repeat this process for the second dynpro's PF-Status, setting different text/icon/tooltip values for CONFIRM.

Method 2: Dynamic Modification in PBO (Runtime Adjustments)

If you need the button's appearance to change based on runtime logic (not just static per screen), use the PBO (Process Before Output) event for each dynpro:

MODULE adjust_confirm_button OUTPUT.
  DATA: lt_func_texts TYPE TABLE OF sfunctxt,
        ls_func_text  TYPE sfunctxt.

  " Check which screen is currently loading
  CASE sy-dynnr.
    WHEN '0100'. " Replace with your first dynpro's screen number
      ls_func_text-fcode = 'CONFIRM'.
      ls_func_text-text = 'Finalize Order'. " Custom text for first screen
      ls_func_text-icon = 'ICON_CHECKED'.   " Custom icon
      APPEND ls_func_text TO lt_func_texts.
    WHEN '0200'. " Replace with your second dynpro's screen number
      ls_func_text-fcode = 'CONFIRM'.
      ls_func_text-text = 'Submit Request'. " Different text for second screen
      ls_func_text-icon = 'ICON_OKAY'.      " Different icon
      APPEND ls_func_text TO lt_func_texts.
  ENDCASE.

  " Override the button's display properties
  CALL FUNCTION 'SET_FUNCTION_CODE_TEXT'
    EXPORTING
      it_functions = lt_func_texts.
ENDMODULE.
  • Add this module to the PBO of both dynpros. Each time the screen loads, it will dynamically set the CONFIRM button's text/icon based on the current screen.

Why Your Changes Were Syncing

The issue you faced happens when you modify the global function code definition (e.g., editing the default text in SE41's "Function Codes" section) instead of the local settings for each PF-Status. Global function code properties apply to every status that references the code, so always adjust the per-status button details instead.

If for some reason the above methods don't work (e.g., very old SAP system versions with limited functionality), you could create separate function codes like CONFIRM_ORD and CONFIRM_REQ for each status. But this is unnecessary— the first two methods should fully resolve your issue without extra function codes.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.30 10:17:31