SAP MIRO 基础信息抬头文本传输到行项目文本增强text transfer to accounting document

现象:

1.SAP MIRO在进行发票过账的时候,行项目是通过采购订单带过来的数据,在维护好相关的信息点击保存之后过账发现,抬头-》基本信息-》文本中的数据并没有带到生成的2张凭证行项目文本中,只有原始凭证有文本数据,后继凭证没有文本数据。

2.如果是在MIRO行项目中的某个采购订单行里面写入文本后进行过账,发现原始凭证和后继凭证就又都有相同的文本了,但是用户一般只维护抬头文本,所以有这个增强需求。

处理过程:

1.通过查阅官方note 837859发现需要CMOD中对LMR1M004进行增强,写入E_SGTXT = TAB_DRSEG-SGTXT,但是debug的时候发现,实际上即使是有抬头文本,但是实际上TAB_DRSEG-SGTXT的字段是空值,这个exit  EXIT_SAPLMRMP_004的传参只有        E_SGTXT、TAB_DRSEG,没有抬头的参数,所以没办法直接处理。

2.通过查阅官方note 366412 发现,实际上这个是标准的一个“bug”,需要打补丁进行修复,但是因为是生产环境有这个问题,打note的话需要停机停服务,这显然是不现实的。

3.在LMR1M004中新增加的_SGTXT = TAB_DRSEG-SGTXT打上断点,选择全局,查看程序执行的步骤,然后查看标准代码看看是否有预留增强点。

4.发现MRM_INVOICE_POST实际上就是保存的处理函数,在其中的es_saplmrmp中的pointmrm_invoice_post_11中有对参数进行处理,所以在这个位置创建一个新的增强实施,插入以下代码块

然后点击激活进行测试,发现成功了。

以上就是整个处理过程,如果官方note无效的话可以考虑采用以上方式。

下面附带官方的原文:

837859 - MIRO: Text transfer to accounting document

Symptom

It is not clear how texts are transferred from MM invoice documents to the FI follow-on document.

Other Terms

MIRO, FI document, SGTXT, transfer

Reason and Prerequisites

You post invoice documents in Materials Management using transaction "Enter Invoice" (MIRO).

Solution

The header text on the "Details" tab is copied to the document header text of the FI follow-on document (INVFO-BKTXT -> BKPF-BKTXT). If the FI Business Add-In (BAdI) AC_DOCUMENT is active, see Note 1025810.

The item text on the "Basic Data" tab is transferred to the item text for the vendor line item of the FI document (INVFO-SGTXT -> BSEG-SGTXT).

The texts entered in the item list are transferred to the other lines of the FI follow-on document.

  • On the "Purchase Order" tab: DRSEG-SGTXT -> BSEG-SGTXT
  • On the "G/L account" tab: ACGL_ITEM-SGTXT -> BSEG-SGTXT
  • For posting lines from the "Material" MIRO tab, you cannot enter an item text in the same way as transaction MR22.


The text transfer to the invoice items (BSEG-SGTXT, except for the vendor line item) may differ in the enhancement LMR1M004 (EXIT_SAPLMRMP_004).
If this enhancement is active, only the contents are transferred from E_SGTXT to the other item texts in the FI document. To transfer the item text created in MIRO, the following line must appear at the start of customer-specific code:
   E_SGTXT = TAB_DRSEG-SGTXT
  Exceptions and special cases can be dealt with afterwards.

366412 - MIRO: Enhancement LMR1M004 item text

Symptom

Customer enhancement LMR1M004 makes it possible to automatically fill the item texts in the follow-on documents which are created when posting in logistics invoice verification (for example, with the purchase order text).
However, this function is not possible for multiple account assignment.

Other Terms

Multiple account assignment

Reason and Prerequisites

This is caused by the program design.

Solution

This is changed for Release 4.6B and 4.6C via Support Package.
This program change now causes the customer enhancement also to be run through for the multiple account assignment for every account assignment item; the item text determined in the customer enhancement is contained in the follow-on documents.

### 关于SAP MIRo增强开发与配置 在处理SAP MIRo(Material Incoming Invoice)增强时,主要关注点在于调整发票验证逻辑以及集成其他业务流程。对于涉及付款条件和折扣的具体情况,在MIRO使用净值加付款条件下,当采用特定计价方式如'S'时,原本应计入库存科目的金额差异会被重新分配至价格差异科目内[^3]。 为了实现更复杂的自定义需求,可以通过以下几种方式进SAP MIRo增强: #### 使用BAdI (Business Add-In) 通过创建并激活相应的BAdI来扩展标准功能而不改变原程序代码。这允许开发者针对特定场景定制化处理逻辑而不会影响系统的稳定性。 ```abap CLASS zcl_miro_enhancement DEFINITION. PUBLIC SECTION. METHODS: on_invoice_verification FOR EVENT invoice_verification OF cl_fi_rm07g00 IMPORTING ebeln " Purchase Order Number ebelp " Item number of purchase order item lifnr " Vendor Number CHANGING wa_bseg TYPE bseg. ENDCLASS. CLASS zcl_miro_enhancement IMPLEMENTATION. METHOD on_invoice_verification. " Custom logic here to enhance the verification process based on business requirements ENDMETHOD. ENDCLASS. ``` #### 用户退出(User Exits) 利用用户出口函数模块对现有事务进补充或修改。这些出口提供了插入额外处理步骤的机会,比如更改默认值、增加新的字段校验等。 ```abap FUNCTION USEREXIT_MIRO_CHECK. *"---------------------------------------------------------------------- *"*" Local Interface: *" IMPORTING *" VALUE(VBELN) LIKE VBRK-VBELN *"---------------------------------------------------------------------- DATA: lv_message(80). IF sy-subrc EQ 0. CASE vbeln. WHEN 'SPECIFIC_CONDITION'. CONCATENATE 'Custom validation failed for PO:' vbeln INTO lv_message SEPARATED BY space. MESSAGE lv_message TYPE 'E'. ENDCASE. ENDIF. ENDFUNCTION. ``` #### 自定义Z程序 编写专门的应用程序以满足特殊的企业政策或是优化某些操作流程。这类程序可以直接调用现有的BAPIs或者RFC接口与其他系统交互。 ```abap REPORT zmiro_custom_processing. PARAMETERS: p_ebeln TYPE ekko-ebeln OBLIGATORY, p_lifnr TYPE lfa1-lifnr DEFAULT 'VENDOR'. START-OF-SELECTION. PERFORM fetch_data USING p_ebeln p_lifnr. PERFORM perform_custom_logic. PERFORM update_database. ... FORM fetch_data USING iv_ebeln iv_lifnr. SELECT SINGLE * FROM ekpo WHERE ebeln = iv_ebeln AND lifnr = iv_lifnr. IF sy-subrc NE 0. WRITE: / 'No matching records found.'. ENDIF. ENDFORM. ``` 以上三种方法可以根据实际项目的需求灵活选用一种或多组合起来应用。重要的是要确保所有的变更都经过充分测试,并遵循公司内部的最佳实践指导方针。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值