SAP MM Stock Tables

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19
At a glance
Powered by AI
This report displays total stock quantities and values of materials at the plant and storage location level. It provides options to view batch stocks, special stocks, and negative stocks.

This report displays the total stock of a material (quantity and value) at the plant and storage location level. It can display transit stocks, stock transfer stocks, and stock values are calculated based on quantity, value, and valuated stock.

Authorization is required to display material master data for all chosen plants and to display accounting documents for the relevant company codes in order to view stock values.

SAP ABAP Reports

Share| Comments (0)

RM07MLBS SAP Report - Display Warehouse Stocks of Material


RM07MLBS is a standard ABAP report available within your SAP system (depending on your version and release level). Below is the standard documentation available for this report and a few details of other objects it interacts with such as tables, function modules, includes etc. If you would like to see the full code listing simply enter the object name( RM07MLBS ) into the relevant SAP transaction such as SE38 or SE80 Within the comments section below there is also an opportunity for anyone to be able add useful hints and information specific to this SAP object. This means that you and other users will be able to find these details quickly by simply searching on the object name.

SAP Documentation for program RM07MLBS


TRANSACTION CODE: MB52 TITLE Warehouse Stocks for Material PURPOSE You use this report to display the total stock of a material (quantity and value) at plant and storage location level. If transit stocks or stock transfer stocks exist at plant level, the system totals these stocks and displays them in the column In Stock Transfer in a stock line without a storage location. Note that in this report, the stock value of the warehouse stock is calculated using the following simplified formula: Stock value = quantity x value/valuated stock Therefore the stock value specified here only has informal characters and does not represent the actual stock value. PREREQUISITES Authorization check You need authorization to display material master data for all chosen plants (authorization object Material Master: Plant , activity 03). If you want to display stock values, you also need authorization to display accounting documents for the relevant company codes (authorization object Accounting document: Authorization for company codes, activity 03). If you do not have this authorization, the system issues a warning. The system only displays the stock quantities without values for the relevant company codes. FEATURES In online mode, the report notes your entered selection parameters after each execution. If you then call up the report in online mode again, the system reads the held selection parameters and proposes them on the initial screen. In background processing, the parameters are set according to the variant. In the output list, the system displays existing deletion flags in a separate column. These deletion flags can be placed at different levels in the material master record. If you require a selection by deletion flag, you can perform this selection using the SAP List Viewer for each stock line.

You can use the two indicators Hierarchy Display (lists with header lines and subordinate item lines) and Non-Hierarchical Display to specify the form of the output list on the initial screen, according to your requirements. Using the non-hierarchical display, you can map subtotals across any columns (also several levels) as well as totals across different units correctly. Note that the selected layout always refers to the selected form of the output list. Settings Options in Customizing In Customizing for Inventory Management under Reporting -> Set Print Functions for Reporting, you can specify the following: Switch the non-hierarchical list to ALV Grid Control You can use the indicator Grid Control to specify whether the non-hierarchical list is displayed as an ALV Grid Control or as a standard SAP List Viewer list. Color numerical values You can use the Without Color indicator to specify whether the numerical values for quantity, stock, and value are highlighted in color according to their +/- sign. Positive numbers are displayed in green, negative numbers in red. Note, that highlighting using colors requires a large amount of performance. SAP recommends that this function is deactivated if you experience performance problems. The indicator Display Only Negative Stocks means that the system only displays thos stock lines that contain at least one negative stock. The indicator Display Batch Stocks allows you to display stocks and special stocks at batch level. If you do not set this indicator, the system displays the totals of the batch stocks at storage location level, and the corresponding special stock. The indicator No Zero Stock Lines allows you to hide any stock lines that do not contain any stock. The indicator Do Not Display Values allows you to hide the values if you do not need to display the stock values for the stock quantities. If you want to display the special stocks, set the indicator Also Select Special Stocks. Using the multiple selection, you can restrict the special stocks to display. The system displays all existing special stocks according to the selection data. The system displays the specification by the different special stock indicators in a separate column. This column can have the following indicators, dependent on the special stock: E: Sales order number with item K, M, O: Vendor number Q: WBS element V and W: Customer number The original fields are available for further evaluations in the field catalog. SELECTION INCLUDE MMIM_SELEKTION OBJECT DOKU ID TX LANGUAGE EN OUTPUT INCLUDE MMIM_BELEGE_PRO_MATERIAL OBJECT DOKU ID TX LANGUAGE EN unrestricted-use stock stock in transfer stock in quality inspection

restricted-use stock blocked stock blocked stock returns INCLUDE MMIM_ANZVAR OBJECT DOKU ID TX LANGUAGE EN Documentation extract taken from SAP system, Copyright (c) SAP AG

Includes used within report:


No INCLUDES are used within this report code!

Tables used within report and the associated select statement:


T001L select werks lgort lgobe from t001l

into corresponding fields of table g_t_t001l where and and T001W SELECT DISTINCT werks name1 bwkey INTO CORRESPONDING FIELDS OF TABLE g_t_organ FROM t001w WHERE werks IN werks. T001K SELECT SINGLE * FROM t001k WHERE bwkey EQ g_s_organ-bwkey. T001 werks in werks lgort in lgort lgobe ne space.

SELECT SINGLE * FROM t001 WHERE bukrs EQ t001k-bukrs. T134M SELECT SINGLE * FROM t134m WHERE mtart IN matart. T023 SELECT SINGLE * FROM t023 WHERE matkl IN matkla. MARA SELECT mara~matnr werks xchar mtart matkl meins trame umlmc bwesb glgmg mara~lvorm as lvorm_mara marc~lvorm as lvorm_marc INTO CORRESPONDING FIELDS OF TABLE t_mat FROM mara INNER JOIN marc ON mara~matnr = marc~matnr for all entries in matnr WHERE mara~matnr = matnr-low AND werks IN werks AND mtart IN matart AND matkl IN matkla AND ekgrp IN ekgrup. MARA SELECT mara~matnr werks xchar mtart matkl meins trame umlmc bwesb glgmg mara~lvorm as lvorm_mara "AC0K020254 "912093 "AC0K020254 "n912093

marc~lvorm as lvorm_marc INTO CORRESPONDING FIELDS OF TABLE t_mat FROM mara INNER JOIN marc ON mara~matnr = marc~matnr WHERE mara~matnr IN matnr AND werks IN werks AND mtart IN matart AND matkl IN matkla AND ekgrp IN ekgrup. MARD SELECT matnr werks lgort labst umlme insme einme speme retme lvorm INTO (collector-matnr, collector-werks, collector-lgort, collector-labst, collector-umlme, collector-insme, collector-einme, collector-speme, collector-retme, collector-lvorm) FROM mard FOR ALL ENTRIES IN t_nobatch WHERE matnr = t_nobatch-matnr AND werks = t_nobatch-werks AND lgort IN lgort. MCHB SELECT matnr werks lgort charg clabs cumlm cinsm ceinm cspem cretm lvorm

INTO (collector-matnr, collector-werks, collector-lgort, collector-charg, collector-labst, collector-umlme, collector-insme, collector-einme, collector-speme, collector-retme, collector-lvorm) FROM mchb FOR ALL ENTRIES IN t_batch WHERE matnr = t_batch-matnr AND werks = t_batch-werks AND lgort IN lgort AND charg IN charg. MKOL SELECT matnr werks lgort charg sobkz lifnr slabs sinsm seinm sspem lvorm INTO (collector-matnr, collector-werks, collector-lgort, collector-charg, collector-sobkz, collector-lifnr, collector-labst, collector-insme, collector-einme, collector-speme, collector-lvorm) FROM mkol FOR ALL ENTRIES IN t_mat WHERE matnr = t_mat-matnr AND werks = t_mat-werks AND lgort IN lgort AND charg IN charg

and sobkz in so_sobkz. MSKU SELECT matnr werks charg sobkz kunnr kulab kuins kuein INTO (collector-matnr, collector-werks, collector-charg, collector-sobkz, collector-kunnr, collector-labst, collector-insme, collector-einme) FROM msku FOR ALL ENTRIES IN t_mat WHERE matnr = t_mat-matnr AND werks = t_mat-werks AND charg IN charg and sobkz MSLB SELECT matnr werks charg sobkz lifnr lblab lbins lbein INTO (collector-matnr, collector-werks, collector-charg, collector-sobkz, collector-lifnr, collector-labst, collector-insme, collector-einme) FROM mslb FOR ALL ENTRIES IN t_mat WHERE matnr = t_mat-matnr AND werks = t_mat-werks in so_sobkz.

AND charg IN charg and sobkz MSKA SELECT mska~matnr mska~werks lgort charg mska~sobkz mska~vbeln mska~posnr kalab kains kaspe kaein kzbws INTO (collector-matnr, collector-werks, collector-lgort, collector-charg, collector-sobkz, collector-vbeln, collector-posnr, collector-labst, collector-insme, collector-speme, collector-einme, collector-kzbws) FROM mska INNER JOIN mssa ON mska~matnr = mssa~matnr in so_sobkz.

AND mska~werks = mssa~werks AND mska~sobkz = mssa~sobkz AND mska~vbeln = mssa~vbeln AND mska~posnr = mssa~posnr FOR ALL ENTRIES IN t_mat WHERE mska~matnr = t_mat-matnr AND mska~werks = t_mat-werks AND mska~lgort IN lgort AND mska~charg IN charg. MSSA SELECT matnr werks sobkz vbeln posnr kzbws satra

INTO (collector-matnr, collector-werks, collector-sobkz, collector-vbeln, collector-posnr, collector-kzbws, collector-umlme) FROM mssa FOR ALL ENTRIES IN t_mat WHERE matnr = t_mat-matnr AND werks = t_mat-werks and sobkz in so_sobkz

AND satra <> 0. MSPR SELECT mspr~matnr mspr~werks lgort charg mspr~sobkz mspr~pspnr prlab prins prspe prein kzbws INTO (collector-matnr, collector-werks, collector-lgort, collector-charg, collector-sobkz, collector-pspnr, collector-labst, collector-insme, collector-speme, collector-einme, collector-kzbws) FROM mspr INNER JOIN mssq ON mspr~matnr = mssq~matnr

AND mspr~werks = mssq~werks AND mspr~sobkz = mssq~sobkz AND mspr~pspnr = mssq~pspnr FOR ALL ENTRIES IN t_mat WHERE mspr~matnr = t_mat-matnr

AND mspr~werks = t_mat-werks AND mspr~lgort IN lgort AND mspr~charg IN charg. MSSQ SELECT matnr werks sobkz pspnr kzbws sqtra INTO (collector-matnr, collector-werks, collector-sobkz, collector-pspnr, collector-kzbws, collector-umlme) FROM mssq FOR ALL ENTRIES IN t_mat WHERE matnr = t_mat-matnr AND werks = t_mat-werks and sobkz in so_sobkz

AND sqtra <> 0. MAKT SELECT matnr maktx INTO CORRESPONDING FIELDS OF TABLE t_makt FROM makt FOR ALL ENTRIES IN t_maktkey WHERE matnr = t_maktkey-matnr AND spras = sy-langu. MCHA SELECT matnr werks charg bwtar INTO CORRESPONDING FIELDS OF TABLE t_mcha FROM mcha

FOR ALL ENTRIES IN t_mchakey WHERE matnr = t_mchakey-matnr AND werks = t_mchakey-werks AND charg = t_mchakey-charg. MBEW SELECT matnr bwkey bwtar lbkum salk3 vprsv verpr stprs peinh "353428 INTO CORRESPONDING FIELDS OF TABLE t_mbew FROM mbew FOR ALL ENTRIES IN t_mbewkey WHERE matnr = t_mbewkey-matnr AND bwkey = t_mbewkey-bwkey AND bwtar = t_mbewkey-bwtar. EBEW SELECT matnr bwkey bwtar sobkz vbeln posnr lbkum salk3 vprsv verpr stprs peinh INTO (t_ebew-matnr, t_ebew-bwkey, t_ebew-bwtar, t_ebew-sobkz, t_ebew-vbeln, t_ebew-posnr,

t_ebew-lbkum, t_ebew-salk3, t_ebew-vprsv, t_ebew-verpr, t_ebew-stprs, t_ebew-peinh) FROM ebew FOR ALL ENTRIES IN t_ebewkey WHERE matnr = t_ebewkey-matnr

AND bwkey = t_ebewkey-bwkey AND bwtar = t_ebewkey-bwtar. EBEW SELECT matnr bwkey bwtar sobkz vbeln posnr lbkum salk3 vprsv verpr stprs peinh INTO (t_ebew-matnr, t_ebew-bwkey, t_ebew-sobkz, t_ebew-bwtar,

t_ebew-vbeln, t_ebew-posnr,

t_ebew-lbkum, t_ebew-salk3, t_ebew-vprsv, t_ebew-verpr, t_ebew-stprs, t_ebew-peinh) FROM ebew FOR ALL ENTRIES IN t_ebewkey WHERE matnr = t_ebewkey-matnr AND bwkey = t_ebewkey-bwkey. QBEW SELECT matnr bwkey bwtar sobkz pspnr lbkum salk3 vprsv verpr stprs peinh INTO (t_qbew-matnr, t_qbew-bwkey, t_qbew-bwtar, t_qbew-sobkz, t_qbew-pspnr, t_qbew-lbkum, t_qbew-salk3, t_qbew-vprsv, t_qbew-verpr, t_qbew-stprs, t_qbew-peinh) FROM qbew FOR ALL ENTRIES IN t_qbewkey

WHERE matnr = t_qbewkey-matnr AND bwkey = t_qbewkey-bwkey AND bwtar = t_qbewkey-bwtar. QBEW SELECT matnr bwkey bwtar sobkz pspnr lbkum salk3 vprsv verpr stprs peinh INTO (t_qbew-matnr, t_qbew-bwkey, t_qbew-bwtar, t_qbew-sobkz, t_qbew-pspnr, t_qbew-lbkum, t_qbew-salk3, t_qbew-vprsv, t_qbew-verpr, t_qbew-stprs, t_qbew-peinh) FROM qbew FOR ALL ENTRIES IN t_qbewkey WHERE matnr = t_qbewkey-matnr AND bwkey = t_qbewkey-bwkey. T134M SELECT bwkey mtart wertu INTO CORRESPONDING FIELDS OF TABLE t_t134m FROM t134m FOR ALL ENTRIES IN t_t134mkey WHERE bwkey = t_t134mkey-bwkey AND mtart = t_t134mkey-mtart. MMIM_REP_PRINT select single * from mmim_rep_print

where report = sy-repid.

Function Modules used within report and the associated call statement:
MMIM_ENTRYCHECK_MAIN CALL FUNCTION 'MMIM_ENTRYCHECK_MAIN' TABLES it_matnr = matnr it_werks = werks it_lgort = lgort it_ekgrp = ekgrup it_sobkz = so_sobkz. REUSE_ALV_VARIANT_EXISTENCE CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE' EXPORTING i_save CHANGING cs_variant = def_variante. REUSE_ALV_VARIANT_DEFAULT_GET CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' EXPORTING i_save CHANGING cs_variant = def_variante = 'A' = 'A'

EXCEPTIONS not_found = 2.

REUSE_ALV_VARIANT_DEFAULT_GET CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET' EXPORTING i_save CHANGING cs_variant = def_variante EXCEPTIONS not_found = 2. = 'A'

REUSE_ALV_HIERSEQ_LIST_DISPLAY CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' EXPORTING I_INTERFACE_CHECK = l_f_check

i_callback_program = repid is_layout it_fieldcat i_default i_save is_variant it_events i_tabname_header i_tabname_item is_keyinfo = layout = fieldcat[] = 'X' = 'A' = variante = gt_events[] = 'HEADER' = 'BESTAND' = keyinfo "n667256

is_print it_sort it_excluding TABLES t_outtab_header t_outtab_item EXCEPTIONS OTHERS REUSE_ALV_VARIANT_F4

= alv_print = sort[] = excluding[]

= header = bestand

= 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4' EXPORTING is_variant i_save * = def_variante_f4 = 'A'

it_default_fieldcat = IMPORTING e_exit es_variant EXCEPTIONS not_found = 2. = variant_exit = def_variante

DB_COMMIT CALL FUNCTION 'DB_COMMIT'. ME_CHECK_T160M CALL FUNCTION EXPORTING 'ME_CHECK_T160M' "n579976 "n579976 "n667256

I_ARBGB I_MSGNR EXCEPTIONS NOTHING OTHERS

= 'M7' = '393'

"n579976 "n579976 "n579976

= 0 = 1.

"n579976 "n579976

Text pool values


Selection Text: CHARG = Batch Selection Text: EKGRUP = Purchasing Group Selection Text: LGORT = Storage Location Selection Text: MATART = Material Type Selection Text: MATKLA = Material Group Selection Text: MATNR = Material Selection Text: NEGATIV = Display Negative Stocks Only Selection Text: NOZERO = D . Selection Text: XMCHB = Display Batch Stocks Selection Text: WERKS = Plant Selection Text: SO_SOBKZ = Special Stock Indicator Selection Text: P_VARI = Layout Selection Text: PA_SOND = Also Select Special Stocks Selection Text: NOVALUES = Do Not Display Values Title: Display Warehouse Stocks of Material Text Symbol: 165 = Following entries missing from table MBEW: Text Symbol: 200 = Read warehouse stocks Text Symbol: 201 = Read batch stocks Text Symbol: 202 = Read special stocks Text Symbol: 203 = Read batch master Text Symbol: 204 = Read material valuation Text Symbol: 205 = Read material short texts Text Symbol: 206 = Read material master Text Symbol: 207 = Data being prepared Text Symbol: 895 = Error during INSERT in table MMIM_RE_PRINT Text Symbol: 027 = Val. GR Blocked St. Text Symbol: 026 = Value Rets Blocked Text Symbol: 025 = Value BlockedStock Text Symbol: 024 = Value Restricted Text Symbol: 023 = Value in QualInsp. Text Symbol: 022 = Value in Stock Tfr Text Symbol: 021 = Value Unrestricted Text Symbol: 020 = Val. Text Symbol: 007 = Non-Hierarchical Representation Text Symbol: 006 = Hierarchical Representation Text Symbol: 005 = Display Options

Text Text Text Text Text Text Text Text Text Text Text Text Text Text

Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol: Symbol:

001 028 160 111 110 101 100 095 090 080 071 070 030 029

= = = = = = = = = = = = = =

Database Selections Val. Tied Empties Material Valuation Area Display Ret. Transp. Packaging Display Consignment Stocks Special Stocks, Stock in Transfer at Plant Level Display Batch Stocks Display Negative Stocks Display Material Flagged for Deletion Settings Selection: Special Stocks Scope of List Val. in Trans./Tfr Value in Transit

RM07MLBD RM07MMBL

Login

Follow the discussion

Comments
There are no comments posted yet. Be the first one!

Post a new comment

Comment as a Guest, or login: Login to IntenseDebate Login to WordPress.com Login to OpenID Name Email Website (optional)
Displayed next to your comments.

Not displayed publicly.

If you have a website, link to it here.

Submit Comment Subscribe to

Share|
Search

You might also like