Report according to mb5b

Dear All,
Can i use MB5B report to see  the opening and closing balance of a particular material in sub contracting scenario.
"I tried using the following way":
I gave the company code , plant and selection date.
now in  special stock indicator  i selected o.
in stock type i selected special stock
in list scope by defauilt all the ticks were there so i did not change them.
now when i am giving mov type 541, 542,543 as pertyhe requirement the system issue a warning message*"If there are restrictions acc. to movement type, results may be incorrect
Message no. M7391
Diagnosis
You have restricted the document selection by movement type.
Report MB5B determines the stocks and values using the material documents, and refers to the current stocks and values.
Restrictions by movement type force the system to only select material documents with the required movement types. However, if the selection does not return all documents, this can lead to incorrect information concerning the stocks and values at the start and end date.
Procedure
A restriction by movement type if only useful for displaying totals of receipts and issues within a specific time interval.*
finally i am able to generate the report but will iut be adequate enough to go with this process or go for a z report using the concept of this.

Hi,
MB5B can be used for subcontracting purpose, but this will show the stock on posting date. In table level MARDH & MBEWH are the period end balances for stock quantity and value. Please note that if the balance is the same as last period there is no entry in MARDH / MBEWH. Try to run the reports  S_ALR_87012300 & S_ALR_87012301 for opening & closing balance of the subcontracting material. Try to use ADSUBCON for this purpose. Thanking you.
Edited by: Padmasri Garapati on Nov 16, 2011 11:13 AM

Similar Messages

  • Material Stock Report  for tcode MB5B

    Hello Expert
    I have a SAP report for stock posting date with T-Code as MB5B and
    the report name is RM07MLBD.
    When I enter Material no, plant code , Movement type (101) and selection
    dates for a month, The report is displaying but not break by Movement type instead it is showing all the movement type....?
    Can anyone have idea about this
    REPORT RM07MLBD NO STANDARD PAGE HEADING MESSAGE-ID M7 LINE-SIZE 95.
        REPORT RM07MLBD   (Transaktionscode MB5B)                        *
    correction June 2004 MM                                   "n747306
    wrong the assignment of the MM and FI documents for data  "n747306
    constellation : n MM doc items --> 1 FI doc item          "n747306
    ABAP-Preprocessor removed                                 "n599218 A
    - this version is for release 4.6C and higher             "n599218 A
    - process database table OBEW always                      "n599218 A
    - IS-OIL specific functions :                             "n599218 A
      - define IS-OIL workings fields                         "n599218 A
      - transport and process these fields only when          "n599218 A
        structure MSEG comprise these fields                  "n599218 A
    Improvements :                       Dec. 2003 MM         "n599218
    - print the page numbers                                  "n599218
                                                              "n599218
    - send warnings and error messages only when report is    "n599218
      launched / advoid warnings when user changes entries on "n599218
      the selection screen                                    "n599218
    - send warning M7 689 when user does not restrict the     "n599218
      database in dialog or print mode                        "n599218
    - send warning M7 393 when user deletes the initial       "n599218
      display variant                                         "n599218
                                                              "n599218
    - allow to process the fields MAT_KDAUF, MAT_KDPOS, and   "n599218
      MAT_PSPNR from release 4.5B and higher                  "n599218
                                                              "n599218
    - show the current activity and the progress              "n599218
                                                              "n599218
    - error message 'programmfehler' improved                 "n599218
                                                              "n599218
    - new categories for scope of list                        "n599218
                                                              "n599218
    - use function module for database commit for the update  "n599218
      of the parameters in table ESDUS. This allows to record "n599218
      this transaction for a batch input session using        "n599218
      transaction SHDB                                        "n599218
                                                              "n599218
    - reset the entries for plant when valuation level is     "n599218
      is company code and mode is valuated stock              "n599218
                                                              "n599218
    - enable this report to run in the webreporting mode      "n599218
    Dec. 2002 MM                                              "n571473
    the definition of the selection screen moved from include "n571473
    RM07MLBP into this report                                 "n571473
    Sept 2002 MM                                              "n555246
    log function tax auditor                                  "n555246
    note 547170 :                              August 2002 MM "n547170
    - representation of tied empties improved                 "n547170
      active this function automatically in retail systems    "n547170
    - FORM routines without preprocessor commands and without "n547170
      text elements moved to the new include reports          "n547170
      RM07MLBD_FORM_01and RM07MLBD_FORM_02                    "n547170
    - the function module FI_CHECK_DATE of note 486477 will   "n547170
      be processed when it exists                             "n547170
    - function and documentation of parameter XONUL improved  "n547170
    - display MM documents with MIGO or MB03 depending from   "n547170
      the release                                             "n547170
    - get and save the parameters per user in dialog mode     "n547170
      only in release >= 4.6                                  "n547170
    the following items were improved with note 497992        "n497992
    - wrong results when remaining BSIM entries contain       "n497992
      an other quantity unit as material master MEINS         "n497992
    - improve check FI summarization                          "n497992
    - the messages M7 390, M7 391, and M7 392                 "n497992
    - definition of field g_f_repid for all releases          "n497992
    - incomplete key for access of internal table IT134M      "n497992
      causes wrong plant selection                            "n497992
    - the function "no reversal movement" did not surpress    "n497992
      the original movements; fields "SJAHR" was moved from   "n497992
      from report RM07MLBD_CUST_FIELDS to RM07MLBD            "n497992
    - process valuated subcontractor stock from database      "n497992
      table OBEW if it exists                                 "n497992
    - if FI summarization is active process warning M7 390    "n497992
      for stock type = valuated stock                         "n497992
    - the user wants to restrict the movement type : process  "n497992
      warning M7 391                                          "n497992
    - the user wants to surpress the reversal movements :     "n497992
      process warning M7 392                                  "n497992
    - consider special gain/loss-handling of IS-OIL           "n497992
    - automatic insert of field WAERS currency key into the   "n497992
      field catalogue :                                       "n497992
      - at least one ref. field is active -> WAERS active     "n497992
      - all reference fields are hidden   -> WAERS hidden     "n497992
    - the length of sum fields for values was increased       "n497992
    - customizing for the selection of remaining BSIM entries "n497992
    - customizing for the processing of tied empties          "n497992
    separate time depending authorization for tax auditor     "n486477
    additional fields are displayed in wrong format           "n480130
    report RM07MLBD and its includes improved  Nov 2001       "n451923
    - merging FI doc number into table G_T_MSEG_LEAN improved "n451923
    - handling of the short texts improved                    "n451923
    - some types and data definitions -> include RM07MLDD     "n451923
    error for split valuation and valuated special stock      "n450764
    process 'goods receipt/issue slip' as hidden field        "n450596
    error at start date : material without stock has value    "n443935
    wrong results for docs with customer consignment "W"      "n435403
    error during data selection for plants                    "n433765
    report RM07MLBD and its includes improved  May 10th, 2001 "n400992
    !!! IMPORTANT : DO NOT CHANGE OR DELETE THE COMMENT LINES !!!        *
    - consider the material number during looking for FI documents
    - field "g_cust_color" in include report "RM07MLBD_CUST_FIELDS"
      allows the customer to activate or inactivate the colors in the
      lines with the documents.
    - error during calcuation of start stock for special stock "M"
    - valuted stocks required : no documents found ? continue and
      process empty document table
    - the length of sum fields for quantities has been increased
      to advoid decimal overflow
    - table ORGAN is replaced by G_T_ORGAN
      - it is filled by the following ways :
        - at process time at selection screen if the
          user wants the selection via cc or plant
        - otherwise after the database selection of the stock
          tables
      - it contains less data fields
      - it contains all entries twice, for binary search
        with plant or valuation area
    - selection of databases MKPF and MSEG in one SELECT
      command with an inner JOIN
    - authority checks after the database selections
    - result of database selection from the both database tables
      MSEG and MKPF in working table G_F_MSEG_LEAN instead of
      the tables IMSEG and IMKPF
    - the number of processed data fields was reduced
    - the user has the possibility to increase the number of
      the processed fields deleting the '*' in the types-command
      in include report RM07MLBD_CUST_FIELDS
    - the creation of the field catalog for the ALV considers
      only the fields of structure G_S_MSEG_LEAN
    - the new table G_T_BELEG contains the results for the ALV.
      the number of fields of table G_T_BELEG corresponds with
      the number of fields of table G_T_MSEG_LEAN.
    - the functions "define breakdown" and "choose" are inactivated
      in the menue, because they are are not carried out correctly
      in all blocks of the list
        Anzeige der Materialbestände in einem Zeitintervall              *
    Der Report gliedert sich im wesentlichen in folgende Verarbeitungs- *
    blöcke:                                                             *
    1) Definition des Einstiegsbildes und Vorbelegung einzelner         *
        Selektionsfelder, sowie Prüfung der eingegebenen Selektions-     *
        parameter und Berechtigungsprüfung                               *
    2) Lesen der aktuellen Bestandswerte                                *
    3) Lesen und Verarbeiten der Materialbelege                         *
    4) Berechnung der Bestandswerte zu den vorgegebenen Datümern        *
    5) Ausgabe der Bestände und Materialbelege                          *
    *eject
    *# APP_CALL_DECLARE TEST
    this definitions depend on the release
    TYPE-POOLS:  IMREP,                   " Typen Bestandsführungsreporting
                 SLIS.                    " Typen Listviewer
      for the selection of the reversal movements only in release >=45B
          DATA: BEGIN OF STORNO OCCURS 0,
                  MBLNR LIKE MSEG-MBLNR,
                  MJAHR LIKE MSEG-MJAHR,
                  ZEILE LIKE MSEG-ZEILE,
                  SMBLN LIKE MSEG-SMBLN,
                  SJAHR LIKE MSEG-SJAHR,
                  SMBLP LIKE MSEG-SMBLP,
                END OF STORNO.
    include:  rm07mldd,     " reportspezifische Datendefinitionen
              rm07grid.     " Gitternetz, Formatierung, Farbgebung
    INCLUDE RM07APP1.     "ABAP-PREPROCESSOR  "TEST
    "n571473
    define the selection screen here                          "n571473
    "n571473
    SELECTION-SCREEN BEGIN OF BLOCK Database-selection
              WITH FRAME TITLE TEXT-001.
    Text-001: Datenbankabgrenzungen
    SELECT-OPTIONS: MATNR FOR MARD-MATNR MEMORY ID MAT
                                         MATCHCODE OBJECT MAT1,
                    BUKRS FOR T001-BUKRS  MEMORY ID BUK,
                    WERKS FOR T001W-WERKS MEMORY ID WRK,
                    LGORT FOR T001L-LGORT,
                    CHARG FOR MCHB-CHARG,
                    BWTAR FOR MBEW-BWTAR,
                    BWART FOR MSEG-BWART.
    PARAMETERS SOBKZ LIKE MSEG-SOBKZ.
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS: DATUM FOR MKPF-BUDAT NO-EXTENSION.
    Datumsintervall für Selektion
    SELECTION-SCREEN END OF BLOCK Database-selection.
    SELECTION-SCREEN BEGIN OF BLOCK BESTANDSART
    WITH FRAME TITLE TEXT-002.
    Text-002: Bestandsart
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS LGBST LIKE AM07M-LGBST RADIOBUTTON GROUP BART DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 4(50) TEXT-010 FOR FIELD LGBST.
    Text-010: Lagerort-/Chargenbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS BWBST LIKE AM07M-BWBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-011 FOR FIELD BWBST.
    Text-011: bewerteter Bestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS SBBST LIKE AM07M-SBBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-012 FOR FIELD SBBST.
    Text-012: Sonderbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BESTANDSART.
    improved definition of parameters for scope of list       "n599218
    SELECTION-SCREEN BEGIN OF BLOCK listumfang
      with frame title text-003.  "Listumfang
    the following 3 parameters became obsolete do not use     "n599218
    anymor. They are still here to inform the user about      "n599218
    that he is using old variants or SUBMIT commands          "n599218
      PARAMETERS :                                              "n599218
        XONUL  LIKE AM07M-XONUL            no-display,          "n599218
        XVBST  LIKE AM07M-XVBST            no-display,          "n599218
        XNVBST LIKE AM07M-XNVBS            no-display.          "n599218
    7 new categories for the scope of list                    "n599218
                                                              "n599218
    cat. I docs I stock on   I    I stock on I Parameter      "n599218
         I      I start date I    I end date I                "n599218
    ---+--+--------++------+--------      "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
         I      I            I    I          I                "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
                                                              "n599218
    definition of the pushbutton : show or hide the following "n599218
    parameters for the scope of list                          "n599218
      SELECTION-SCREEN PUSHBUTTON /1(20) PB_LIU                 "n599218
                                 USER-COMMAND LIU.              "n599218
                                                                "n599218
    text line : materials with movements                      "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN COMMENT 1(55) TEXT-072                 "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start = zero  =  end = zero              "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdzer    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-083 : no opening stock ; no closing stock          "n599218
        SELECTION-SCREEN COMMENT 5(70) text-083                 "n599218
                                 FOR FIELD pa_wdzer             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start = zero  =  end <> zero             "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdzew    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-084 : no opening stock ; with closing stock        "n599218
        SELECTION-SCREEN COMMENT 5(70) text-084                 "n599218
                                 FOR FIELD pa_wdzew             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / start stock <> 0 / end stock = 0         "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwiz    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-085 : with opening stock ; no closing stock        "n599218
        SELECTION-SCREEN COMMENT 5(70) text-085                 "n599218
                                 FOR FIELD pa_wdwiz             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / with start and end stocks / different    "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwuw    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; changed       "n599218
        SELECTION-SCREEN COMMENT 5(70) text-086                 "n599218
                                 FOR FIELD pa_wdwuw             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    with movements / with start and end stock / equal         "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_wdwew    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
        SELECTION-SCREEN COMMENT 5(70) text-087                 "n599218
                                 FOR FIELD pa_wdwew             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    text line : materials without movements                   "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN COMMENT 1(55) TEXT-073                 "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    materials without movements / stocks = zero               "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_ndzer    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      text-083 : no opening stock ; no closing stock          "n599218
        SELECTION-SCREEN COMMENT 5(70) text-083                 "n599218
                                 FOR FIELD pa_ndzer             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    materials without movements / with start or end stock     "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
      SELECTION-SCREEN BEGIN OF LINE.                           "n599218
        SELECTION-SCREEN POSITION 2.                            "n599218
        PARAMETERS : pa_ndsto    LIKE AM07M-MB5B_XONUL          "n599218
                                 modif id liu.                  "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
        SELECTION-SCREEN COMMENT 5(70) text-087                 "n599218
                                 FOR FIELD pa_ndsto             "n599218
                                 modif id liu.                  "n599218
      SELECTION-SCREEN END OF LINE.                             "n599218
                                                                "n599218
    SELECTION-SCREEN END OF BLOCK listumfang.
    SELECTION-SCREEN BEGIN OF BLOCK EINSTELLUNGEN
       WITH FRAME TITLE TEXT-068.  "Settings
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XSUM LIKE AM07M-XSUM.
    SELECTION-SCREEN COMMENT 4(50) TEXT-019 FOR FIELD XSUM.
    Text-019: nur Summen
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XCHAR LIKE AM07M-XCHRG.
    SELECTION-SCREEN COMMENT 4(50) TEXT-015 FOR FIELD XCHAR.
    Text-015: nur chargenpflichtige Materialien
    Das Kennzeichen 'xchar' bestimmt die Art der Listausgabe entweder
    auf Material- oder Chargenebene.
    SELECTION-SCREEN END OF LINE.
    the function "No reversal movements" is only         "n571473
    available from relaese 4.5B and higher               "n571473
    ( TEXT-026 : No reversal movements )                 "n571473
        SELECTION-SCREEN BEGIN OF LINE.                    "n571473
          SELECTION-SCREEN POSITION 1.                     "n571473
          PARAMETERS NOSTO LIKE AM07M-NOSTO.               "n571473
          SELECTION-SCREEN COMMENT 4(50) TEXT-026          "n571473
                                 FOR FIELD NOSTO.          "n571473
        SELECTION-SCREEN END OF LINE.                      "n571473
    SELECTION-SCREEN END OF BLOCK EINSTELLUNGEN.
    SELECTION-SCREEN BEGIN OF BLOCK LISTE WITH FRAME TITLE TEXT-040.
    PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK LISTE.
    *eject
    new data definitions
    working fields for reading structures from DDIC           "n599218 A
    and check whether IS-OIL is active                        "n599218 A
    types : stab_x031l           type standard table of x031l   "n599218 A
                                 with default key.              "n599218 A
                                                                "n599218 A
    data : g_s_x031l             type x031l,                    "n599218 A
           g_t_x031l             type stab_x031l.               "n599218 A
                                                                "n599218 A
    data : g_f_dcobjdef-name     like dcobjdef-name,            "n599218 A
           g_flag_is_oil_active(01)        type c,              "n599218 A
           g_cnt_is_oil          type i.                        "n599218 A
    contains the a structure with the max. number of fields of
    the database table MSEG, but those lines are comment lines
    with a '*'. The customer can achtivate those lines.
    The activated fields will be selected from the database table
    and are hidden in the list. With the settings in the display
    variant the can be shown.
    INCLUDE                      RM07MLBD_CUST_FIELDS.
    common types structure for working tables
    a) g_t_mseg_lean   results form database selection
    b) g_t_beleg       data table for ALV
    TYPES : BEGIN OF STYPE_MSEG_LEAN,
              MBLNR             LIKE      MKPF-MBLNR,
               MJAHR             LIKE      MKPF-MJAHR,
               VGART             LIKE      MKPF-VGART,
               BLART             LIKE      MKPF-BLART,
               BUDAT             LIKE      MKPF-BUDAT,
               CPUDT             LIKE      MKPF-CPUDT,
               CPUTM             LIKE      MKPF-CPUTM,
               USNAM             LIKE      MKPF-USNAM,
    process 'goods receipt/issue slip' as hidden field        "n450596
               XABLN             LIKE      MKPF-XABLN,          "n450596
               LBBSA             LIKE      T156M-LBBSA,
               BWAGR             LIKE      T156S-BWAGR,
               BUKRS             LIKE      T001-BUKRS,
               BELNR             LIKE      BKPF-BELNR,
               GJAHR             LIKE      BKPF-GJAHR,
               WAERS             LIKE      MSEG-WAERS,
               ZEILE             LIKE      MSEG-ZEILE,
               BWART             LIKE      MSEG-BWART,
               MATNR             LIKE      MSEG-MATNR,
               WERKS             LIKE      MSEG-WERKS,
               LGORT             LIKE      MSEG-LGORT,
               CHARG             LIKE      MSEG-CHARG,
               BWTAR             LIKE      MSEG-BWTAR,
               KZVBR             LIKE      MSEG-KZVBR,
               KZBEW             LIKE      MSEG-KZBEW,
               SOBKZ             LIKE      MSEG-SOBKZ,
               KZZUG             LIKE      MSEG-KZZUG,
               BUSTM             LIKE      MSEG-BUSTM,
               BUSTW             LIKE      MSEG-BUSTW,
               MENGU             LIKE      MSEG-MENGU,
               WERTU             LIKE      MSEG-WERTU,
               SHKZG             LIKE      MSEG-SHKZG,
               MENGE             LIKE      MSEG-MENGE,
               MEINS             LIKE      MSEG-MEINS,
               DMBTR             LIKE      MSEG-DMBTR,
               DMBUM             LIKE      MSEG-DMBUM,
               XAUTO             LIKE      MSEG-XAUTO,
               KZBWS             LIKE      MSEG-KZBWS,
             special flag for retail                          "n497992
               retail(01)        type c,                        "n497992
    define the fields for the IO-OIL specific functions       "n599218 A
             mseg-oiglcalc     CHAR          1                "n599218 A
             mseg-oiglsku      QUAN         13                "n599218 A
               oiglcalc(01)      type  c,                       "n599218 A
               oiglsku(07)       type  p  decimals 3,           "n599218 A
               insmk             like      mseg-insmk,          "n599218 A
    the following fields are used for the selection of
    the reversal movements
              SMBLN    LIKE      MSEG-SMBLN,    " No. doc
              SJAHR    LIKE      MSEG-SJAHR,    " Year          "n497992
              SMBLP    LIKE      MSEG-SMBLP.    " Item in doc
    additional fields : the user has the possibility to activate
    these fields in the following include report
              INCLUDE           TYPE      STYPE_MB5B_ADD.
    TYPES : END OF STYPE_MSEG_LEAN.
    TYPES: STAB_MSEG_LEAN        TYPE STANDARD TABLE OF STYPE_MSEG_LEAN
                                 WITH KEY MBLNR MJAHR.
    data tables with the results for the ALV
    TYPES : BEGIN OF STYPE_BELEGE.
              INCLUDE            TYPE      STYPE_MSEG_LEAN.
    TYPES :   FARBE TYPE SLIS_T_SPECIALCOL_ALV.
    TYPES : END OF STYPE_BELEGE.
    TYPES : STAB_BELEGE          TYPE STANDARD TABLE OF STYPE_BELEGE
                                 WITH KEY  BUDAT MBLNR ZEILE.
    DATA : G_T_BELEGE            TYPE   STAB_BELEGE WITH HEADER LINE,
           G_T_BELEGE1           TYPE   STAB_BELEGE WITH HEADER LINE.
    global working areas data from MSEG and MKPF
    FIELD-SYMBOLS :        TYPE STYPE_MSEG_LEAN.
    DATA : G_S_MSEG_LEAN         TYPE STYPE_MSEG_LEAN,
           G_S_MSEG_UPDATE       TYPE STYPE_MSEG_LEAN,          "n443935
           G_T_MSEG_LEAN         TYPE STAB_MSEG_LEAN.
    working table for the control break                       "n451923
    types : begin of stype_mseg_work.                           "n451923
              include            type      stype_mseg_lean.     "n451923
    types :    tabix             like      sy-tabix,            "n451923
            end of stype_mseg_work,                             "n451923
                                                                "n451923
            stab_mseg_work       type standard table of         "n451923
                                 stype_mseg_work                "n451923
                                 with default key.              "n451923
                                                                "n451923
    data : g_t_mseg_work         type  stab_mseg_work,          "n443935
           g_s_mseg_work         type  stype_mseg_work.         "n443935
    working table for the requested field name from MSEG and MKPF
    TYPES: BEGIN OF STYPE_FIELDS,
               FIELDNAME           TYPE      NAME_FELD,
           END OF STYPE_FIELDS.
    TYPES: STAB_FIELDS           TYPE STANDARD TABLE OF STYPE_FIELDS
                                 WITH KEY FIELDNAME.
    DATA: G_T_MSEG_FIELDS        TYPE      STAB_FIELDS,
          G_S_MSEG_FIELDS        TYPE      STYPE_FIELDS.
    working table for the requested numeric fields of MSEG
    types : begin of stype_color_fields,
               FIELDNAME           TYPE      NAME_FELD,
             type(01)            type c,
           end of stype_color_fields,
           stab_color_fields     type standard table of
                                 stype_color_fields
                                 with default key.
    data: g_t_color_fields       type      stab_color_fields
                                 with header line.
    DATA: BEGIN OF IMSWEG OCCURS 1000,
            MBLNR LIKE MSEG-MBLNR,
            MJAHR LIKE MSEG-MJAHR,
            ZEILE LIKE MSEG-ZEILE,
            MATNR LIKE MSEG-MATNR,
            CHARG LIKE MSEG-CHARG,
            BWTAR LIKE MSEG-BWTAR,
            WERKS LIKE MSEG-WERKS,
            LGORT LIKE MSEG-LGORT,
            SOBKZ LIKE MSEG-SOBKZ,
            BWART LIKE MSEG-BWART,
            SHKZG LIKE MSEG-SHKZG,
            XAUTO LIKE MSEG-XAUTO,
            MENGE LIKE MSEG-MENGE,
            MEINS LIKE MSEG-MEINS,
            DMBTR LIKE MSEG-DMBTR,
            DMBUM LIKE MSEG-DMBUM,
            BUSTM LIKE MSEG-BUSTM,
            BUSTW LIKE MSEG-BUSTW,                               "147374
    define the fields for the IO-OIL specific functions       "n599218 A
          mseg-oiglcalc        CHAR          1                "n599218 A
          mseg-oiglsku         QUAN         13                "n599218 A
            oiglcalc(01)         type  c,                       "n599218 A
            oiglsku(07)          type  p  decimals 3,           "n599218 A
            insmk                like      mseg-insmk,          "n599218 A
          END OF IMSWEG.
    User settings for the checkboxes                          "n547170
      DATA: oref_settings TYPE REF TO cl_mmim_userdefaults.     "n547170
    *eject
    HAUPTPROGRAMM *********************************
    F4-Hilfe für Reportvariante -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    "n599218
    INITIALIZATION                                            "n599218
    "n599218
                                                                "n599218
    pay attentions : this process time will not be processed  "n599218
    in the webreporting mode                                  "n599218
    INITIALIZATION.
    PERFORM APP_PROCESS USING 'ME'. "TEST
      PERFORM initialisierung.
    get the parameters from the last run                      "n547170
      perform                    esdus_get_parameters.          "n547170
    set flag when INITILIZATION is processed
      move  'X'        to  g_flag_initialization.
    "n599218
    AT SELECTION-SCREEN                                       "n599218
    "n599218
    Prüfung der eingegebenen Selektionsparameter, -
    Berechtigungsprüfung -
    AT SELECTION-SCREEN.
    the following 3 parameters XONUL, XVBST, and XNVBST       "n599218
    became obsolete; send error when they should be filled.   "n599218
    This could be possible if the user works with old         "n599218
    selection variants or this report is launched by a        "n599218
    SUBMIT command                                            "n599218
      if  XONUL  is initial  and                                "n599218
          XVBST  is initial  and                                "n599218
          XNVBST is initial.                                    "n599218
    ok, the old parameters are empty                         "n599218
      else.                                                     "n599218
      text-088 : note 599218 : obsolete parameter used        "n599218
        MESSAGE E895             with  text-088.                "n599218
      endif.
    did the user hit the pushbutton "Category" ?              "n599218
      case     SSCRFIELDS-UCOMM.                                "n599218
        when  'LIU '.                                           "n599218
        yes, the pushbutton "Category" was hit                "n599218
          IF  g_flag_status_liu  =  C_HIDE.                     "n599218
          show the 7 parameters on the selection srceen       "n599218
            MOVE  C_SHOW         TO  g_flag_status_liu.         "n599218
          ELSE.                                                 "n599218
          hide the 7 paramaters                               "n599218
            MOVE  C_HIDE         TO  g_flag_status_liu.         "n599218
          ENDIF.                                                "n599218
      ENDcase.                                                  "n599218
                                                                "n599218
    go on only if the user wants to launch this report        "n599218
      check : sy-ucomm = 'ONLI'  or                             "n599218
              sy-ucomm = 'PRIN'  or                             "n599218
              sy-ucomm = 'SJOB'.                                "n599218
      PERFORM eingaben_pruefen.
    check whether FI summarization is active and other        "n547170
    restrictions could deliver wrong results                  "n547170
      perform                    f0800_check_restrictions.      "n547170
    - the user wants to surpress the reversal movements :     "n497992
      process warning M7 392                                  "n497992
        IF NOT NOSTO IS INITIAL.                                "n497992
      emerge warning ?                                        "n497992
          CALL FUNCTION            'ME_CHECK_T160M'             "n497992
              EXPORTING                                         "n497992
                I_ARBGB          = 'M7'                         "n497992
                I_MSGNR          = '392'                        "n497992
              EXCEPTIONS                                    

    Please read the KBA document  2012912 - Changeablility of the field "material group" in purchasing documents
    It clearly says that material group can't be changed in case you will use material master in purchase order.
    So, it is clear that you can't use different material group for material master in purchase order.
    For stock report, system will only show you the material group which is assigned to the material master (MARA-MATKL). System will not look into the purchase order section (like EKPO).

  • Bussiness logic/technical flow for  report with tcode MB5B

    Guys,
    Please send me any Functional Spec or Technical Spec of the standard SAP report with tcode MB5B ( Stock as on posting date). Any document explaining logic or technical flow is very much useful to me..I need to understand the logic and what are all the underlying tables used. I will assign more points to anyone who help me.

    MB5B - Stock on posting date
    The report Stock for posting date lists a company's own stocks in a particular time period (earliest date/Time 00:00, latest date/time 24:00).
    The posting date is used for selection. Note that the posting date may be different from the entry date (date entered in the system) as well as the document date.
    Starting with the current stock balance, the report uses the material documents to calculate the stock balance for the specified posting date.
    Requirements
    You need authorization to display material documents for all chosen plants (authorization object Material documents: plant, activity 03).
    Output
    Thisreport issues a list with the following information for each material:
    Stock quantity and stock value on first date
    Total and value of all receipts
    Total and value of all issues
    Stock quantity and stock value on last date
    List of the material documents that were posted in the specified time period
    To go to the detail screen for the material document item, place the cursor on a material document and choose Goto -> Document item
    If you require more data and want a detailed evaluation, you can enhance the current layout or choose another existing layout via Settings -> Layout.
    Tables Used :
    t001; t001w; t001l; mchb, mbew,mseg.
    Thanks

  • Groupin report according to Month

    Hi Everyone
    I'm creating a report where it list out the PO value according to the created date from a ODS
    How could i change the report format to display the total PO value acording to the created month rather than created date?
    Could anyone help me
    Thank you in advance !

    Hi,
    Do you have 0calmonth in your ODS? if not, please add it and write a formula/ small abap routine in update rules to populate it with values.
    Reload the data, and then you should be able to use it for drilling down to the month level.
    Regards,
    Gili

  • Report similar to Mb5b

    Please suggest t code in which we will get Plant, SLOC, Material wise qty and stock as on date with co code prerequisite

    Hi
    You can check the report using the T.Code S_P00_07000139 - Stock Card and Inventory Material Report for better reporting perspective. This report will list the stock value per movement by Qty to Qtyt and closing stock aswell for the specified period.
    hope this will help you..

  • Highlight data in report according to search input

    Hi,
    I have SQL report and to narrow down the report I have a search region with TextField. It is working fine.
    My query here is I want to highlight the search input text wherever it appears in the report column.
    Like my search text is suppose - abc
    Report should be like this
    1. A abc gt (907-788-7887) Male
    2. Hakswq (344-345-2343) Male
    3. Kasjh abc d (343-324-3243) Female
    Please tell me how to achieve this in SQL report.
    -Smith

    on you sql report select the report tab then select any row that you want to highlight. on the "Highlight Word field under Column formatting put like this &search_input.
    replace the word search_input with the search item name. do the same on all the columns you want to be highlighted.
    take note of the ampersand(&) and period (.)
    good luck!

  • Customizing a query for a report according to login user name

    Hi, I am new to the portal, so I have a urgent question:
    In my company we have local departments who are supposed to use
    the same report but only with their own data.
    I have a table with all users and their parameters (e.g.
    username + deptno) and might be able to create a function which
    gets the username (found that in one of the standard packages)
    and retrieves the parameter from the database via SELECT. The
    function should then return the parameter to be used where ever
    needed.
    Big question: How can I use this function in a SELECT-Statement
    for my report? I guess it must be something like
    SELECT * FROM -table or view- WHERE deptno = -schema.function-
    Right? Does the function have to be part of a package?
    Thanks in advance for any help.
    Yours
    Reinhard Piper
    Munich / Germany

    the table or view is WWSEC_person this is where the users are..
    Ruud

  • Filter report according to date range

    Hi,
    I have a date type member in my planning application (11.1.2.1). I am using Financial reporting and would like to filter the records as per the year. For example, i would like to display records which are in the range of 2010 till 2014. The format is dd/mm/yyyy. Is it possible to achieve this? I am using substitution variables for previous year, current year and next two years.
    Thanks!

    As you mentioned you have date type members in planning, so try using prompt for those years (assuming that you have 2010,2011,2012... as members). For more details refer to page - 42 in http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/fr_user.pdf.

  • Update interactive report according to the filter of the user

    Hi all
    i'm working with Apex version 4.2/
    i have an interactive rport page as we know it allows the user to make filtering ans sorting
    I want to do as follow :
    i created an interactive report in table
    CREATE TABLE EMP
      EMPNO     NUMBER(4)                           NOT NULL,
      ENAME     VARCHAR2(10 BYTE),
      JOB       VARCHAR2(9 BYTE),
      MGR       NUMBER(4),
      HIREDATE  DATE,
      SAL       NUMBER(7,2),
      COMM      NUMBER(7,2),
      DEPTNO    NUMBER(2))
    ALTER TABLE EMP ADD (
      PRIMARY KEY
    (EMPNO)now i've created a new region called update_all_region with two text field items.
    p30_sal 
    p30_deptno
    and an update_all button .lets take a look at the scenario :
    lets say that the user doing sort on the IRR lets say give all the employees where the sal >10000.
    lets say that the report return 100 rows to the result , result per page : 50.
    now i'm entering in the update_all_region text field item the values :
    p30_sal : 90000
    p30_deptno : 30 and pressing the update_all button .i want that all the rows which appears in the report (total = 100) will be update.
    i've tried to do this :
    begin
    FOR i IN 1..APEX_APPLICATION.G_F02.COUNT
    LOOP
    update emp
      set salary =  :p30_salary ,
      deptno= :p30_deptno
    where employee_id  = apex_application.g_f02(i);
    END LOOP;
    commit;
    end;problem :
    this update only updates the 50 rows in the current page that i'm in it. and not the all 100 .
    question :
    is this the correct way to do this update , form whatt i've understood , i can take the object filter as a variable , and use it in order to update the table.
    please you advice
    Thanks In Advanced
    Naama

    Either write a classic report and implement your own filters, and use those on your update function, or try to retrieve the where clause Apex uses in the IR.
    This blog from Stew should help you on your way:
    http://stewstools.wordpress.com/2009/02/19/get-ir-where-clause/

  • Two query result rows in single report according to condition

    Is it possible to have a report where the first rwo of the report will display the result of query1 and second row will display the result of query2.
    The query1 and Query2 are as follows:
    SELECT BNO, DATA1 FROM TABLE1 ;
    SELECT RNO, DATA2 FROM TABLE2
    The matching condition is BNO = RNO(+)
    Kindly suggest ?
    Sanjay
    CREATE TABLE TABLE1
    BNO          NUMBER,
    DATA1        VARCHAR2(20)
    CREATE TABLE TABLE2
    RPNO           NUMBER,
    RNO         NUMBER,
    DATA2       VARCHAR2(20)
    INSERT INTO TABLE1(BNO, DATA1) VALUES(111,'200');
    INSERT INTO TABLE1(BNO, DATA1) VALUES(112,'400');
    INSERT INTO TABLE1(BNO, DATA1) VALUES(113,'500');
    INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(10,111,'100');
    INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(11,111,'100');
    INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(12,111,'100');
    INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(13,112,'400');
    INSERT INTO TABLE2(RPNO,RNO,DATA2) VALUES(14,113,'500');

    One option can be UNION ALL
    SELECT
         BNO,
         DATA1
    FROM
              SELECT
                   BNO, DATA1,rownum as rn
              FROM
                   TABLE1
              UNION ALL
              SELECT
                   t2.RNO as BNO, t2.DATA2 as DATA1, rownum as rn
              FROM
                   TABLE2 t2
              WHERE
                   EXISTS
                        SELECT
                             1
                        FROM
                             table1 t1
                        WHERE
                             t1.bno = t2.RNO
              ORDER BY
                   1,3
    BNO                    DATA1               
    111                    200                 
    111                    100                 
    111                    100                 
    111                    100                 
    112                    400                 
    112                    400                 
    113                    500                 
    113                    500                 
    8 rows selected

  • Can we disable link in a classic report according to row content?

    Hi, guys:
    I have a question: I have a classic report, which has a column of link to another page in the same application; the link shows icon of Google map, user can see a Google map of the address listed in the same row of this report by clicking this link. However, some addresses are empty, so we want to disable the link in the column whenever the address in the same row is empty. We tried with all of APEX settings regarding column, but not successful. Could anyone help us on this problem?
    so I have a further question is: is there anyway that we can manipulate APEX report content in PL/SQL code?
    Thanks.
    Sam

    Hi,Paul:
    I tried with your query:
    select distinct
    (case when (to_char(sl.ADDRESS1_LATITUDE) is null) and (to_char(sl.physical_address_latitude) is null) then null
    else '<img src="#WORKSPACE_IMAGES#location.png"\'
    end) MAP_link,
    ......and I set this column with column link text:
    #MAP_LINK#
    but it shows not the image icon (link is working though), but the text itself as
    <a href="f?p=2001:3006:1633012192639501::NO:RP:YES:28F8F2C91B88<a href="f?p=2001:3006:1633012192639501::NO:RP:YES:4B58FD640A235491C077B36E20B0409A">&lt;img src="wwv_flow_file_mgr.get_file?p_security_group_id=18568811800631432&amp;p_fname=location.png"\</a>
    {code}
    if  I use query
    {code}
    select distinct
    (case when (to_char(sl.ADDRESS1_LATITUDE) is null) and (to_char(sl.physical_address_latitude) is null) then null
    else '<img src="#WORKSPACE_IMAGES#location.png"\image>'
    end) MAP_link,
    {code}
    the column map_link is empty. I guess I do not know how to escape characters in javascript. Could you help me on this?
    Thanks.
    Sam                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I get date as calender when a user wants to select a specific date and filter the o/p of report accordingly

    Can someone help on this..?

    Thanks I missed out that i can use a date as datatype
    Thanks for pointing out ;
    Will try that
    Also can you help me with this as well
    "https://forums.oracle.com/thread/2571086"

  • To do a report with the format of MB5B

    Hi,
    I have one requirement is below, not able to get the complete logic:
    We have a Tcode MB5B,it has the selection screen criteria, Matnr, Comp Code, Sales Org and Date Range.
    if we execute, it will give the material quntity as per the above selection criteria.
    If i give low date with 15-06-2011 and high date is 05-07-2011. It will display the material qunatiry available is on the date 15-06-2011 and on the date high date 05-07-2011.(It will give only for 2 dates)
    But here what they are requesting is: they need a report with the availability material quantity on each date. means (Here low date 15-06-2011, high date is 05-07-2011),
    on 15-06-2011,16-06-2011,17-06-2011,..........05-07-2011. like this.
    Output file has should have no of columns is equal to diff between dates.
    Here the version is 4.7,
    I started to bebug it, they are using MARA, MKPF, MARD,MBEW and so on.
    Any table has the date range option to get the material quantity.any idea please.
    could please anyone give suggestions on this.
    Regards,
    Sri

    Hi
    Their is no such table available in sap
    tell me one thing is data available for every day .
    if no then try below mention.
    do one thing print report according to date wise
    display all date from date-low to date-high first
    in that pick all data available for every day and display it
    foreg: 15/06/2011 data is available then print the qty else print as 0.00
    if it is not getting send me ur code i will do changes
    T Bharat Bhushan

  • Any functional spec or technical spec for  MB5B report??

    Guys,
    Please send me any Functional Spec or Technical Spec of the standard SAP report  with tcode MB5B ( Stock as on posting date). Any document explaining logic or technical flow is very much useful to me..I need to understand the logic and what are all the underlying tables used. I will assign more points to anyone who help me.

    I got some help from the abaper.table/field details of the input screen and output screen
    input screen
    MATERIAL NUMBER       MARD     MATNR
    COMPANY CODE      T001     BUKRS
    PLANT                       T001W                    WERKS
    STORAGE LOCATION     T001L     LGORT
    BATCH     MCHB     CHARG
    VALUATION TYPE     MBEW     BWTAR
    MOVEMENT TYPE     MSEG     BWART
    SPECIAL STOCK INDICATOR     MSEG     SOBKZ
    SELECTION DATE     MKPF     BUDAT
    output screen
    STORAGE LOCATION     T001L     LGORT
    MOVEMENT                     MSEG      BWART
    MATERIAL DOCUMENT     MKPF     MBLNR
    ITEM                                      MSEG     ZEILE
    POSTING DATE                      MKPF     BUDAT
    QUANTITY                                      MSEG     MENGE
    PLANT                                       MSEG     WERKS
    MATERIAL                                    MSEG     MATNR
    In the input screen
    i have three radio buttons :
             STORAGE LOC/BATCH STOCK
              VALUATED STOCK
              SPECIAL STOCK
    and  following checkboxes
    WITH OUT OPENING STOCK,WITH OUT CLOSING STOCK(WITH MOVEMENTS)
    WITHOUT OPENING STOCK,WITH CLOSING STOCK(WITH MOVEMENTS)
    WITH OPENING STOCK, WITH OUT CLOSING STOCK(WITH MOVEMENTS)
    WITH OPENING STOCK, WITH CLOSING STOCK(WITH MOVEMENTS)
    WITH OPENING STOCK, WITH CLOSING STOCK: UNCHANGED(WITH MOVEMENTS)
    WITH OUT OPENING STOCK,WITH OUT CLOSING STOCK(WITH OUT MOVEMENTS)
    WITH OPENING STOCK,WITH CLOSING STOCK(WITH OUT MOVEMENTS)
    can you help me in understanding which field in what table should be taken
    into consideration if need to implement the above radio button or check box.
    For example if the user clicks on "WITH OPENING STOCK,WITH CLOSING STOCK(WITH OUT MOVEMENTS)"   checkbox
    what is the linking field  which i should restrict my logic to ?
    It would be helpful if you can give me atleast some information that you have ..

  • Report Similar to T.Code : MB5B

    Hi,
    Is there any Standard report that gives the same values similar to T.Code : MB5B.
    If there is no such Standard report apart from MB5B that shows stock as on a particular period with the stock movements.
    What are the tables that i can use, to build in the same logic.
    Thanks in advance!!
    Kalyan

    You can try standard information system reports like MC.B, or develop custom report based on structures.
    If you find something else, please let me know. We also have same requirement, If I find/develop something I will post as well.
    Thanks-

Maybe you are looking for

  • How can I add money to my iTunes account

    I had a gift card which is now used up but I want to add mint to my account so I don't have to pay with every purchase. Please give me some idea if this is possible.

  • How can i convert a hexidecimal image file to a bmp file

    i have an array of hex data, each of the 7707 rows has 80 characters, i want to convert this to a standard windows bmp or jpeg file, any ideas how to do it?

  • XA Exception while invoking the Web Service

    I'm getting the following exception frequently while invoking the webservice hosted in OC4J: -4972682009633467115com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Error in transaction: javax.transaction.xa.XAException: Commit

  • HR - XI - External System: one IDOC to multiple XML Files

    Hi, I have a scenario where I need, out of one HRMD_A07 IDOC send multiple XML files: The IDOC and the XML files can the Master data for many employee (IDOC has max of 200 as of SAP, external system, max of 1000). The IDOC will be generated with chan

  • Moving Object from One container to another in workOrder Dri

    Hi , I am able to Move Object from One container to another container in workOrder Driver. here is my code which i am using <do-move-src-object class-name="ValeUser"> <arg-dn> <token-local-variable name="var-str-nwoContent"/> </arg-dn> <arg-dn> <toke