下拉框中的值未刷新 [英] Value in dropdown box isn't refreshed

查看:21
本文介绍了下拉框中的值未刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有两个输入字段的 dynpro 屏幕:

I have a dynpro screen with two input fields:

  • 销售订单编号
  • 销售订单行 n°(在下拉列表中)

我的问题是在输入不同的销售订单编号后,销售订单行没有刷新.但是,与销售订单行相关的其他输出字段已正确刷新为预期数据.

My problem is that the sales order line isn't refreshed after a different sales order n° is input. However the other output fields relating to the sales order line are properly refreshed with the expected data.

程序行为:

Document vente"是销售订单".Poste"是行号".

"Document vente" is "Sales order". "Poste" is "Line number".

从此屏幕上,如果我请求销售订单号 1,订单行 10 保持活动状态并显示在下拉列表中,尽管订单号 1 没有 行号 10.另一个输出字段用第 20 行的数据更新.如果我选​​择行订单 20、30 或 70,值 10 从列表中消失.

From this screen, If I request sales order number 1, the order line 10 remains active and shows up in the dropdown list, despite order number 1 not having a line number 10. The other output fields are updated with the data of line 20. If I pick line orders 20, 30 or 70, the value 10 disappears from the list.

dynpro 屏幕字段被命名为它们在 VBAK 和 VBAP 表中的对应字段,因此它们的值会自动从一个复制到另一个.

The dynpro screen fields are named as their corresponding fields from the VBAK and VBAP tables, so that their values are copied automatically from one to another.

后跟注释将订单行设置为订单中的第一个"的代码似乎不起作用.我希望它用新订单中的第一个行号替换行号字段的值.

The code followed by the comment "Set order line to first one in the order" doesn't seem to work. I expect it to replace the value of the line number field with the first line number in the new order.

代码:

MODULE REFRESH_ALL_FIELDS INPUT.
  DATA temp_vbeln TYPE VBAK-VBELN.
  temp_vbeln = VBAK-VBELN.

  CLEAR: VBAK, VBAP.

  SELECT VBELN KUNNR BSTNK NETWR WAERK
    FROM VBAK
    INTO CORRESPONDING FIELDS OF VBAK
    WHERE VBAK~VBELN = temp_vbeln.
  ENDSELECT.

  " Fill dropdown list with order line numbers.
  TYPE-POOLS VRM.
  DATA it_posnr   TYPE VRM_VALUES.

  REFRESH it_posnr.

  SELECT POSNR
    FROM VBAP
    INTO TABLE it_posnr
    WHERE VBAP~VBELN = VBAK-VBELN.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID                    = 'VBAP-POSNR'
      VALUES                = it_posnr
*   EXCEPTIONS
*     ID_ILLEGAL_NAME       = 1
*     OTHERS                = 2
            .
  IF SY-SUBRC <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  " Set order line number as first in the order.
  SELECT SINGLE POSNR
    FROM VBAP
    INTO VBAP-POSNR
    WHERE VBAP~VBELN = VBAK-VBELN.

  PERFORM REFRESH_ITEM_FIELDS.
ENDMODULE.                 " REFRESH_ALL_FIELDS  INPUT

MODULE REFRESH_ITEM_FIELDS INPUT.
  PERFORM REFRESH_ITEM_FIELDS.
ENDMODULE.                 " REFRESH_ITEM_FIELDS  INPUT

FORM REFRESH_ITEM_FIELDS .
  SELECT SINGLE MATNR ARKTX KWMENG
    FROM VBAP
    INTO CORRESPONDING FIELDS OF VBAP
    WHERE VBAP~VBELN = VBAK-VBELN
    AND VBAP~POSNR = VBAP-POSNR.
ENDFORM.   " REFRESH_ITEM_FIELDS

流程逻辑:

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.
FIELD VBAK-VBELN MODULE REFRESH_ALL_FIELDS ON REQUEST.
FIELD VBAP-POSNR MODULE REFRESH_ITEM_FIELDS ON REQUEST.

我该如何解决这个问题?

How can I fix this ?

推荐答案

最接近的解决方案是更新 PAI 中的工作区域,并根据 WA 的值更新 PBO 中的实际屏幕字段.

The closest solution was to update a working area in the PAI, and update the actual screen fields in the PBO, from the values of the WA.

这篇关于下拉框中的值未刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆