About inventory & Inventory bapi

Source: Internet
Author: User

Mard records the current inventory quantity, but the period is not necessarily the current month. For example, if your materials have not changed the inventory quantity during the entire month in March (the item is not released after the item is confiscated), you can check that the number of entries in Mard is still in March, not in March.
When goods are moved during a period, the system updates the MARD data (the table is updated in real time ), it will check whether this business transfer period is consistent with the corresponding recording period in MARD, that is, to see if this is the first move in this period. If yes, copy the corresponding records in the MARD table to mardh, then change the MARD record to the current period (or delete and then create), and then update the number of data. If it is not the first record, that is, the MARD period is the same as the mseg period, only the number of MARD is updated if no copy record is used.

This process seems to reduce redundant data, but it adds a lot of work to the programming history inventory. I personally think it is not wise.
Inventory table
Mbew mbewh
Mard -- Query master inventory mardh -- master inventory history
Mslb -- special stock o mkol -- special stock K/M Mska -- special stock e msku -- special stock V/W
Mcha mchb

The mbewh table is updated regardless of whether the moving average price map is changed.

The mbewh table recordsMbewThe historical data of the tableMbewIs the material evaluation table.

MbewThe table records the current material price. When the material price is re-evaluated (such as updating the current moving average price of the material), the SAP system writes the current price to the mbewh table and the new priceMbew.

The current price is always recorded in the tableMbewWhen the first operation in a period (period) updates the quantity or value of the item, the SAP system writes a record to the table mbewh, based on the balance and price control before the first operation.

In the mbewh table, the numbers recorded during the previous period are stored in the "current period" lfmon field.

For example, when the first transfer (such as receipt) occurs during the period 3, the system writes the number 2 to the "current period" lfmon field in the mbewh table, the quantity and value are updated to the "Total stock" and "total value" fields, and are equal to the quantity and value that occurred during the 3 period.

If no posting is made for several consecutive periods, mbewh does not create records for each period.

TableMbew, Mbewh and mchbh differences:

Mbew: View the moving average price of the Current billing period

Mbewh: view the moving average price of the historical billing period

The table mbewh records all inventory values, while the table mchbh only represents the value of unlimited' inventory.

How to view the current moving average price:

Transaction code: s_p00_07000139

The latest moving average price after each material re-evaluation.

 

Hundreds of users/customersHistorical inventoryThe reason for report requirements, and can be checked at any time.

Unfortunately,SAPThe system does not have the so-called history stock, but it is not necessary, which violates the redundant rules designed by the database.

I have seenSAPIn the system,Historical inventoryThere are two solutions for "report" or "Time Point Inventory Report:
I. Use the job method to capture inventory information at the job execution time on a regular (generally daily) basis and store it in a custom table;
2. query the details of the business documents or material creden。 and calculate the remaining balance at the time of check.

The advantage of method 1 is that it is faster to query historical data. However, this occupies storage resources;
Second, we cannot guarantee the certainty of this regular job. hardware maintenance and system performance may lead to deviations from this scheduled "time". If the inventory at this time cannot be captured at a time, for the entire report, data is missing;
Third, the methods and methods originally designed to capture data are very likely to be modified or overturned under the pressure of new requirements, which still cannot meet the needs.

The advantage of method 2 is that it solves the second and third problems of the previous solution. However, the report runs like a back-to-Stone Age. This is suitable for scenarios with large volumes of business data.SAPThe impact of the system is fatal because it not only loses

The user's trust is even more terrible because it will shake the confidence of the management.

There may be a third solution, someone may think of information record (LIS ),SAPThere is an inventory analysis report stacked on lis, but people who have used it know that it is extremely untrusted. This report makes the daily logarithm of users, supporters, or implementers

Even though the OSS contains several correction schemes for Lis reports.

I tried the fourth method in the process of a logarithm, that is, the tired table with H: March, mardh, mbewh, etc. After analyzing the update logic of these tables, it does not update each item to the table during each period.

Then, find out how to use the standard program to obtainHistorical inventory. The related tcode is mb5b and mb51, and mb5t is not used.

 

 

Status

Inventory level

Query Method

Valuable stock

In the library

S. Loc

Mb5b (valued option)

In-transit (procurement, two-step database migration)

Plant

Mb5b (valued option)

Quality Control

S. Loc

Mb5b (valued option)

Freeze

S. Loc

Mb5b (valued option)

Other special stock

Plant

Mb5b (valued option)

Zero-price inventory

In the library

S. Loc

Mb5b (S. Loc option)

In-transit (procurement, two-step database migration)

Plant

Mb51 cumulative

Quality Control

S. Loc

Mb5b (S. Loc option)

Freeze

S. Loc

Mb5b (S. Loc option)

Other special stock

Plant

Mb5b (S. Loc option)

 

 

Inventory:
1. bapi_material_availability to obtain available product inventory
2. co_za_availability_check
3. availability_check_controller
4. availability_check
Inventory management:
Bapi_goodsmvt_getdetail: Display goods movement details
Bapi_goodsmvt_getitems shows the detailed list of material creden
Bapi_goodsmvt_create move goods posting, warehouse receiving, warehouse picking
Bapi_goodsmvt_cancel offset goods movement

 

Bapi_material_savedata Create/change material master Region
Bapi_objcl_create Create/Change main material Category
Bapi_objcl_change Create/Change main material Category
Clmm_maintain_classifications Batch create/change the main material Category
Claf_classification_of_objects Displays the main feature values of a material.
Bapi_material_existencecheck Check whether the main material quota exists
Bapi_material_getlist Material master description
   
Bapi_po_create1 Establish purchase orders
Bapi_po_change Change purchase orders
Bapi_po_getdetail Usage instructions
Bapi_po_release Statement of nuclear production
Bapi_requisition_create Create ticket
Bapi_requisition_change Change ticket
Bapi_requisition_getdetail The statement is clear.
Bapi_requisition_release_gen Statement of approval
   
Bapi_charact_create Build features
Bapi_charact_change Change features
Bapi_charact_delete Division features
Bapi_charact_rename Rename features
Bapi_charact_getdetail Feature modularity
Bapi_charact_addlongtext Set the length of a feature or number
Bapi_charact_removelongtext Remove long texts of features or numeric values
Bapi_charact_getlongtext Feature long text for getting numeric values
Card_characteristic_read List of feature values
   
Bapi_class_create Create a class
Bapi_class_change Differences
Bapi_class_delete Division by category
Bapi_class_getdetail Retrieve class-level data records (take class-Level Characteristics and feature values)
Bapi_class_existencecheck Check the existence of Objects
   
Bapi_vendor_getdetail Indication providers
Bapi_vendor_existencecheck Existence of future Query
   
Bapi_materialgroup_get_list Extract material group/material group description
   
Bapi_goodsmvt_create Failed to renew the Materials
Bapi_goodsmvt_cancel Cancel material renewal
Bapi_goodsmvt_getdetail Displays material activation instructions
Bapi_goodsmvt_getitems Display the clear ticket of the Material file

Update mechanism of mbew and mbewh

Assume that a transaction has not been made since period 1. At that time, the inventory is 100, and map is assumed to be 1 RMB/PC. Until now period 4, you have received 100 transactions, 2rmb/PC, the system will write the history record into mbewh for the first transaction during each cross-period. If period 2 and 3 are not traded, mbewh will add a period 3,100 PC, MAP 1 RMB, at the same time, the current period/year of mbew is changed from 2006/period 1 to 2006/03, that is, mbewh will always save the stock value and map of the previous period during the first post. mbewh has no data for several months, indicating that the materials have not been moved for several months. mbewh always saves the total stock value and map of the previous period when the first item in the current period is moved in the post, if there may be no period records in the middle, it indicates that the n-1 period has not been moved.

The following several T-codes may be used to view the inventory report:

Mmbe: The MARD-LABST (valuated stock with unrestricted use)
Mb52: MARD-LABST

Mb51: mseg: erfmg Accumulation

Mm03: MBEW-LBKUM (total valuated stock)
Mb5l: MBEW-SALK3 (value of total valuated stock)

Mc.9: S032-MBWBEST (quantity of valuated stock)
S032-WBWBEST (value of valuated stock)
You can see that the preceding typical T-Code actually reads data from different tables.

* ** I strongly recommend that those who claim to be senior mm consultants spend at least some time to crack three programs.
Po, receipt, and invoice validation logic. I refer to the internal logic.
I have studied sapmm07m and saplmigo (the two correspond to T-code and migo, such as mb1a respectively ).
You will know that if the data of MARD, mseg, and mbew is not matched, then sap will have a problem and you will know when
Material Doc. No and Fi Doc No (at this time, it is not actually saved to the table, which is easy to explain
Why is there a Doc No hop? If you want to, you can deliberately create a Doc No hop case like slowing down the camera ),
You also know how the materail movement is updated to the DB table.

Again, the use of the T-code of MARD, mseg, and mbew will usually be consistent to see the inventory data, but mc.9 and others will not necessarily use the LIS table.
Those familiar with Lis must be familiar with these two tables.
Tmc4: global control elements: Lis INFO structure
Tmcae: Features of Application
It is also known that the update Rule of s031 and s032 is synchronous updating (V1 update)
Yes, it is done by the include program rmcsv3vb of mb1 *. That is to say, real-time update during material movement. Why?
What are the differences between the inventory displayed by mc.9 and mb1 * or mmbe? There are many reasons, for example, you should change the material type and material group,

If a problem occurs, you must update the data of the Information Organization.
Update s012 purchase data.
Oli3-Statistical setup of info structures from purchasing documents
Restructured the purchase Doc to Lis.
Nprt-log for setup of statistical data
Nprt to check resetup log.
Mc26 allows you to see the updates of LIS, QIS, and sis, whether it is Lis, QIS, sis.... If the inventory is inconsistent, you should update it.

There is a heap of T-code below how to update is System
(OLI1-9), in fact you can see the background.

---------------------------------------

1. For WM correlation (Part ):
Ls09 display material data for stor. Type
Ls24 display quants for Material
Ls25 display quants per storage bin
Ls26 warehouse stocks per Material
Ls27 display quants for storage unit
Ls28 display storage units/bin
Lt0g return delivery to stock
Lx02 Stock List
Ii. Inventory re-Valuation
J1a 3 MM goods issue revaluation (reevaluate)
J1a 5 MM warehouse stock report
J1ai asset revaluation (inflation)

Iii. material prices (and changes)
Mr21 price change
Mr22 material debit/credit
Ck24 mark/change Standard Cost
Ckmtopstockval materials w/highest inventory value
Mrn8 lowest value: price variances
4. Inventory Analysis.
Mmbe (mb53): displays a single inventory (you can filter the 0-stock sto)
Mb52: warehouse stocks on hand (cannot be by date)
Mb54: Consignment stocks
Mb51/mb59: Material Doc. List (view material creden, by posting date)
Mb5b: stocks for posting date
** By selection date: You can query the inventory of mb5b in a time range.
Mb5k stock consistency check
Mb5l (mb5w) displays stock values balances
** Mb5l refers to the material value from the material evaluation layer. For example, the valuation clas of a plant 1100 is 12110101.
** If you use mb52 by plant 1100 and mb5l 12110101 (general ledger), the value is different.
Mb5t stock in transit CC (dump)
** Generally, mb1b 311 is used for inter-company dump conversion, while 301 for inter-company dump conversion.
** If MRP is considered for internal company-related trade, the PO is generally opened without using mb1b directly, so that the open po is taken into consideration.

MBBS display valuated special stock
Mbgr displ. Material docs. By MVt. Reason (problematic inventory)
Mblb stocks at subcontractor

Mbst cancel material document
** Generally, the mbst is the whole order, for example, the PO 101 receiving error. For example, mbst can be used for the whole order, or 102 can be used one by one.
** Mbst can find the reverse mvtype corresponding to canceling mat.doc.
Mbsm display cancelled material docs.

Material history.
Mr1_balance sheet values by account (various values)
Mm60 Materials List
Mm04 material changed history (History of material changes)
Mm06 mark material deleted flat (delete the item flag)
Mmam change material type
** What material type does mmam support changing from SFG to FG? What are the conditions? I know.
Mce9 purchasing function (go to The mm_pur function menu)
Mce3 vendor Analysis Selection
Mce5 matgrp Analysis Selection
Mce7 Material Analysis Selection
Mcw2
Me2m material by purchase order
---------------------------------------------------------------
Inventory table:
Mkol: Special stocks from vendor
Mkolh: Special stocks from Vendor: History

MSCA: sales orders on hand with vendor
Mscah: sales order stock at vendor: History

Mska: sales order stock
Mskah: sales order stock: History

Msku: Special Stocks at customer
Mskuh: Special Stocks at Customer: History

Mslb: Special Stocks at vendor
Mslbh: Special Stocks at vendor: History

Mara: plant data for material (Material Plant-related master data)
March: material master C segment: History

Mard: material master storage location (regular inventory in this table)
Mardh: material master storage location segment: History

Mbew: account1-2 for material master data, costing1-2 view.
Mbewh: Material Valuation: History

Mchb: Batch stocks
Mchbh batch stocks: History

M1_batches (if Batch Management Cross-plant)
Mcha batches

 

Http://lfbsunshine.blog.163.com/blog/static/46318572201081485119760/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.