SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

MIRO, MIGO, MB1B enhancements



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ММ
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Tue Jan 15, 2008 10:30 pm    Post subject: MIRO, MIGO, MB1B enhancements Reply with quote

BADI

MRM_HEADER_CHECK - BAdI for Additional Checks of the Document Header Data.

MB_MIGO_BADI - BAdI in MIGO for External Detail Subscreens.
A comprehensive documentation of the BADI with example code exists in SAP. Go to SE18, display the badi, and click 'documentation'.

Use

Application component: MM-IM-GR; MM-IM-GI

With the Business Add-In (BAdI) MB_MIGO_BADI, you can extend the interface of the goods movements transaction ( MIGO) with additional tabstrip controls for the detailed information (detail tabstrips) and header information (header tabstrips). It is possible for an external application

- to display an additional detail tabstrip with own subscreen (max. 10 lines) in MIGO

- to display an additional header tabstrip with own subscreen (max. 3 lines) in MIGO

The program name, screen number and tab page text can be determined dynamically. Different screens can therefore be controlled according to the mode (for example, change mode, display mode, goods receipt, goods issue).

Pushbuttons
It is not possible to implement pushbuttons in the MIGO menu, but you can, however, implement pushbuttons directly on the external subscreen. The OK code from MIGO is forwarded to the external application so it can react.

Cursor Control
So that the cursor stays on the same subscreen after you press Continue, if it was positioned there before, the external application in the own PAI must hold the cursor positioning (on the same screen 'yes'/'no'; if 'yes', on which field), to set the cursor in PBO again.

Requirements

If you use the BAdI MB_MIGO_BADI in MIGO to update customer-own data, in addition to the material document, to the database, you should note the following:

- The BAdI MB_MIGO_BADI is only active in transaction MIGO.

- If you post goods movements with other transactions (for example, with MB01, MB1C, VL02N), you must ensure that customer data is also updated, if necessary.

- You can do this by using the BAdI MB_DOCUMENT_BADI (Creating a material document) to post the goods movements with the transactions mentioned above.

Note that otherwise, posting the goods movements will lead to inconsistencies between SAP system data (for example, in stocks, material documents, FI documents) and customer data.
To avoid these inconsistencies, we recommend posting all goods movements with transaction MIGO.

Standard settings

- In the standard system, the Business Add-In is not active.

- There is no default code.

- The Business Add-In is not filter-dependent.

- The Business Add-In can be used more than once.

Activities

To activate the Business Add-In, you must create an active implementation. Do this in Inventory Management and Physical Inventory Customizing and choose the relevant activity under Maintain Customer-Exits and Business Add-Ins.

For more information about this procedure, see the SAP Library under

Basis Components -> ABAP Workbench -> Changing the SAP Standard -> Business Add-Ins -> Implementing Business Add-Ins.

Note that the Business Add-In can be used multiple times and therefore all active implementations are called and run through.

Create Implementations

BAdI definition MB_MIGO_BADI was created with transaction SE18.

Using transaction SE19, you can create an implementation for this BAdI. You can provide the methods with customer-defined code.

The BAdI definition can be used several times. In MIGO, five additional tabstrip control were defined for the detail screen, and five additional tabstrip controls for the header information. In other words, up to five different implementations can be created.

Recommendation
We recommend that you do not install the external application data directly in the implementation, but enclose it in function modules. You assign the screen with the subscreens to the corresponding function group; see the example implementation.

Example

For easier comprehension, an example code has been created for the BAdI MB_MIGO_BADI. The example implementation class is CL_EXM_IM_MB_MIGO_BADI.

To activate the example implementation, use transaction SE19 to create a new implementation and then activate it. Copy the example code with Goto -> Sample Code -> Copy.

The tabstrip controls MIGO BAdI Example are then displayed in MIGO for the header and detail information.

On the tabstrip control for the detail information, you can enter an additional quantity (and unit of measure). Both are saved in table MIGO_BADI_EXAMPL.

The text field SGTXT can also be changed. An example shows how an external application can change the data from the GOITEM (item data in MIGO) structure.

On the tabstrip control for the header information, you can enter an additional number. This is saved in table MIGO_BADI_EXAMP2.

Further notes

Documentation for BAdI methods:

Initialization and registration of external detail screens:
INIT

PBO of detail screen
PBO_DETAIL

PAI of detail screen
PAI_DETAIL

Insert / change line (GOITEM)
LINE_MODIFY

Delete line (GOITEM)
LINE_DELETE

MIGO reset (delete all internal data)
RESET

Post a goods movement
POST_DOCUMENT

Check item data for goods movement
CHECK_ITEM

Mode of transaction MIGO (action, reference document, etc.)
MODE_SET

Status information and header data
STATUS_AND_HEADER

Save held data
HOLD_DATA_SAVE

Load held data
HOLD_DATA_LOAD

Delete held data
HOLD_DATA_DELETE

PBO of header screen
PBO_HEADER

PAI of header screen
PAI_HEADER

Check item data for goods movement
CHECK_HEADER

You can also call the documentation on the BAdI method via the menu, by carrying out the following steps:

1. Choose the tab page Interface.
2. Double-click on the relevant method.
3. Click on the right mouse button and choose Component documentation.


MB_MIGO_ITEM_BADI - BAdI in MIGO for Changing Item Data.

MB_DOCUMENT_UPDATE - BADI when updating material document: MSEG and MKPF

MB_DOCUMENT_BADI - Business add-ins when creating a material document

The enhancement MB_DOCUMENT_BADI has two methods that are called up by the same interface, though at different times. All material document data from the following tables is transferred to this business add-in:
- MKPF (material document header)
- MSEG (material document items)
- VM07M (update data)

This data can be used in other programs, but cannot be changed.

The methods differ according to the time at which they are called up:

- The method MB_DOCUMENT_BEFORE_UPDATE is called up before the FI document is created. This means that it is called up even if the program is terminated by an error during the subsequent processing. The update of data in separate tables should always be contained in function modules that are called up with the addition 'in update task'. This ensures that all the data is updated consistently.

- The method MB_DOCUMENT_UPDATE is not carried out until update. This means that all updates are carried out immediately in their own tables and do not have to be contained in 'update task' in function modules. For performance reasons, you should not re-read the tables or carry out any time-consuming routines at this point.

You should always call up MB_DOCUMENT_BEFORE_UPDATE before MB_DOCUMENT_UPDATE, particularly if time is a critical factor when posting the material documents. The method MB_DOCUMENT_UPDATE is processed after the FI document numbers are called. As a result, no other FI documents can be posted until this document is completely updated.

Even if the two methods are in the same class, you cannot access the same global fields, as the methods are called up at different times and are therefore carried out in another roll area.

From the business add-in display, you can go to coding examples for both methods by choosing Goto -> Example coding -> Display

Note

The enhancement does not transfer any data to the material document, that is, you cannot change material document data before it is updated.

If this business add-in is not set up properly, it may result in an inconsistency between the documents and the stocks and between the material documents and the accounting documents. Inconsistencies like these may be caused by the following elements in the business add-in:

- COMMIT WORK

- Remote function call (CALL FUNCTION ... DESTINATION)

- Own updates in document tables or stock tables (for example, update in tables MBEW, MARD, MSEG)

- The unlocking of data (for example, via DEQUEUE_ALL)

Before the two business add-ins are called up, data is already flagged for the UPDATE. If a COMMIT WORK or a Remote Function Call is transmitted in the enhancement, these are written in the database. If another error occurs after the business add-ins are processed, you cannot carry out a complete ROLL BACK, as the data up to the COMMIT or Remote Function Call has already been written in the database. This can result in an inconsistent status (for example, material document without accounting document), which can only be repaired with considerable cost and effort.
The business add-ins are not suitable for customer-specific updates in the stock tables, as updates like these destroy the standard stock update.
Unlocking the data (for example, via DEQUEUE_ALL) is also critical, as the data that is to be updated is no longer protected from updates from external systems, and inconsistencies can result from parallel updates.
Before you activate an enhancement, check carefully that the business add-in does not contain any critical coding places.
If data inconsistencies have already occurred in your system as a result of the business add-in, remove the critical coding so that it does not cause any further inconsistencies.

Customer functions exit (SMOD / CMOD)
TCode MRHR
MM08R001 User exits for ERS
MM08R002 User exit for tolerance checks
RMVKON00 Enhancements to report "Settle consignment liabilities"

TCode MIRO
LMR1M001 User exits in Logistics Invoice Verification
LMR1M002 Account grouping for GR/IR account maint
LMR1M003 Number assignment in Logistics Invoice Verification
LMR1M004 Logistics Invoice Verification: item text for follow-on docs
LMR1M005 Logistics Inv. Verification: Release Parked Doc. for Posting
LMR1M006 Logistics Invoice Verification: Process XML Invoice
MRMH0001 Logistics Invoice Verification: ERS procedure
MRMH0002 Logistics Invoice Verification: EDI inbound
MRMH0003 Logistics Invoice Verification: Revaluation/RAP
MRMN0001 Message output and creation: Logistics Invoice Verification

TCode MIGO
MBCF0002 Customer function exit: Segment text in material doc. item
MBCF0005 Material document item for goods receipt/issue slip
MBCF0006 Customer function for WBS element
MBCF0007 Customer function exit: Updating a reservation
MBCF0009 Filling the storage location field
MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1
MBCF0011 Read from RESB and RKPF for print list in MB26
MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.

TCode MB1B
EXIT_SAPMM07M_001 - MBCF0002 - Customer function exit: Segment text in material doc. item
EXIT_SAPMM07M_003 - MBCFC003 - Maintenance of batch master data for goods movements
EXIT_SAPMM07M_004 - MBCFC004 - Maintenance of batch specifications for goods movements
EXIT_SAPMM07M_005 - MBCF0006 - Customer function for WBS element
EXIT_SAPMM07M_009 - MBCF0009 - Filling the storage location field
EXIT_SAPMM07M_010 (Propose Batch / Transfer Batch) - MBCFC010 - Propose batch number on Inventory Management item screen
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ММ All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.