SAP BLOG XREF1, XREF2, XREF3 in MIRO – the ultimate solution

SAP Blog

Kayıtlı Üye
Katılım
22 Ara 2017
Mesajlar
1,925
Tepki puanı
7
Puanları
6

Problem statement​


Logistics invoice verification transactions like MIRO or MIR7 don’t cover the entire functionality of their FI counterparts like FB60 or FB01. That is confirmed by note 904652 – MIRO: Different from FB60 that reads:

MIRO is an independent Materials Management (MM) transaction that does not claim to be the same as the accounting transactions (such as FB60 or FB01). […]

For example, the following fields from the accounting document are not available in transaction MIRO (this list is not complete): […]

  • Reference key (BSEG-XREF1, -XREF2, -XREF3)

The most annoying shortcoming is lack of reference keys in MIRO i.e. XREF1, XREF2, XREF3 fields.

The issue has been widely discussed on SAP Community pages and various blogs e.g.


Several solutions have been proposed. However none of them felt right to me, easy to implement and addressing the problem fully. So I’ve developed my own.

The ultimate solution​


The solution consists of a simple ABAP enhancement that exhibits the fields on MIRO / MIR7 screen and couple of data dictionary enhancements to save the fields in a logistics invoice document and pass them to accounting documents.

Make the XREF1, XREF2, XREF3 editable in MIRO / MIR7​


The following implicit enhancement at the end of MODIFY_FI_SCREEN form routine in LMR1MF6Q exhibits the fields on MIRO / MIR7 “Details” tab:

Kod:
ENHANCEMENT 1  Z_MIRO_XREF3.    "active version
PERFORM modify_fi_subscreen TABLES t_acscr USING  'XREF3'  'ACTIVE'  '1'.
PERFORM modify_fi_subscreen TABLES t_acscr USING  'XREF2'  'ACTIVE'  '1'.
PERFORM modify_fi_subscreen TABLES t_acscr USING  'XREF1'  'ACTIVE'  '1'.
ENDENHANCEMENT.



My code looks as follows in the actual implementation:
Screenshot_2020-11-04_13-22-44.png


Of course you don’t need to include all XREF* fields if you don’t need them. Adjust the enhancement to your needs.

The ABAP code enhancement gives you the access to the fields. However you’ll notice that only XREF3 will be saved to the logistics invoice document and then transferred to the accounting documents. Changes to XREF1 and XREF2 are not saved yet.

If you are only concerned about XREF3 field, you should skip the “Data dictionary enhancements” section and go directly to the “Summary”.

Data dictionary enhancements​


To take over changes of XREF1 and XREF2, we need couple data dictionary enhancements. All of them are implemented with append structure technique.

Notice that you will get a warning during append structures activation as we are adding the fields without ZZ prefix. That is done on purpose!

Table RBKP enhancement​


Create append structure to RBKP table with XREF1 and XREF2 fields:
Screenshot_2020-11-04_13-24-56.png




Your RBKP table should look like this:
Screenshot_2020-11-04_13-25-26-1.png




Structure ACMM_VENDOR_COMP enhancement​


Create append structure to ACMM_VENDOR_COMP structure with XREF1 and XREF2 fields:
Screenshot_2020-11-04_13-25-47.png




Your ACMM_VENDOR_COMP structure should look like this:
Screenshot_2020-11-04_13-26-19.png




View RBKP_V enhancement​


Create append structure to RBKP_V view with XREF1 and XREF2 fields:
Screenshot_2020-11-04_13-23-42.png




Your RBKP_V view should look like this:
Screenshot_2020-11-04_13-24-33.png




Summary​


With the enhancements implemented XREF1, XREF2, XREF3 fields are editable in MIRO and MIR7 transactions:
Screenshot_2020-11-04_13-29-55-a-1.png




The fields’ values are saved with the logistics invoice document when its hold, parked or saved and they are transferred to the accounting documents:
Screenshot_2020-11-04_13-31-14-a.png




Be aware that XREF3 is used in several SAP standard functions. Therefore be cautions before making XREF3 directly editable and consider relevant SAP support notes.

Okumaya devam et...
 
Üst