自定义采购订单字段未在EXIT_SAPMM06E_013中更新。

huangapple go评论80阅读模式
英文:

Custom PO fields are not updated in EXIT_SAPMM06E_013

问题

我尝试在使用事务ME22N时更新表EKPO中的客户字段。自定义字段的值必须从项目的确认数据(EKES)中派生。我已通过向CI_EKPODB添加字段ZZTEST来扩展EKPO表。

我已在FM EXIT_SAPMM06E_013中添加了以下代码,以设置内部表XEKPO中自定义字段的值。

LOOP AT xekpo[] ASSIGNING FIELD-SYMBOL(<fs_ekpo>).
    <fs_ekpo>-zztest  = 'TEST OK'.
ENDLOOP.

该代码已被调用,内部表已正确更新。然而,ZZTEST的值未在数据库中(表EKPO)更新。尽管ME22N中的其他标准值已正确更新到数据库中。

我尝试过的其他BADIs:

  • ME_PURCHDOC_POSTED:同样的问题,自定义字段未更新。
  • ME_PROCESS_PO_CUST:由于注意2567839的原因,确认数据无法访问。

简而言之,我正在寻找一个BADI/用户退出,允许我从确认数据中派生值以更新采购订单的自定义字段。从数据库中读取确认数据不可行,因为当前正在编辑的采购订单可能尚未提交。请帮忙。

英文:

I'm trying to update a customer field in table EKPO when transaction ME22N is used. The custom field's value has to be derived from the item's Confirmations data (EKES). I've extended EKPO by adding a field ZZTEST to CI_EKPODB.

I've added the following code in FM EXIT_SAPMM06E_013 to set the values of the custom field in internal table XEKPO.

  LOOP AT xekpo[] ASSIGNING FIELD-SYMBOL(&lt;fs_ekpo&gt;).

    &lt;fs_ekpo&gt;-zztest  = &#39;TEST OK&#39;.

  ENDLOOP.

The code is called and the internal table is correctly updated. However, the value of ZZTEST is not updated in the database (table EKPO). The other standard values changed in ME22N are correctly updated in the DB though.

Other BADIs I have tried:

  • ME_PURCHDOC_POSTED: same problem, the custom field is not updated
  • ME_PROCESS_PO_CUST: confirmation data is not accessible because of note 2567839

TL;DR: I'm looking for a BADI / User exit that would allow me to update a PO's custom field by deriving its value from confirmation data. Reading confirmation data from the database is not possible because the currently edited PO might not be committed yet. Please help.

答案1

得分: 1

在EXIT_SAPMM06E_018中,您可以执行以下操作:

FUNCTION EXIT_SAPMM06E_018.

  INCLUDE ZXM06U40.

ENDFUNCTION.


在包含文件`ZXM06U40`中添加以下代码:

MOVE-CORRESPONDING ci_ekpodb TO e_ci_ekpo.
e_ci_update = 'X'.


`EKPO_CI`(结构:项目子屏幕字段传输的客户自定义结构)包括附加结构`CI_EKPODB`(采购项目的客户附加结构)。

这应该导致数据库表使用自定义字段的值进行更新。

还请注意,屏幕字段应参照`ekpo_ci`创建。
英文:

You can do the following in EXIT_SAPMM06E_018:

FUNCTION EXIT_SAPMM06E_018.

      INCLUDE ZXM06U40.

ENDFUNCTION.

In include ZXM06U40 add the code:

MOVE-CORRESPONDING ci_ekpodb TO e_ci_ekpo.
e_ci_update = &#39;X&#39;.

EKPO_CI (Structure: Customer Inlude for Field Transport to Item Subscreen) includes the append structure CI_EKPODB (Customer append structure purchase items).

This should lead to the the database table update with values for the custom field.

Note also that the screen fields are to be created with reference to ekpo_ci.

huangapple
  • 本文由 发表于 2023年3月31日 17:50:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75897094.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定