Problem in Stock Report

Dear Sir,
I am facing problem in MB5B, two months before i use this TCode and report are like this
Opening Stock              27,179.437  MT                59,705,114.71  INR
total value of Receipts 65,473.815  MT               132,382,668.98  INR
total value of Issues    53,774.361- MT               108,659,912.15- INR
Closing stock               38,878.891  MT                83,427,871.54  INR
and now again today i am checking the report are changed, the report are like this
Opening Stock              27,179.437  MT                60,007,580.64  INR
total value of Receipts 65,473.815  MT               132,382,668.98  INR
total value of Issues    53,774.361- MT               108,659,912.15- INR
Closing stock               38,878.891  MT                83,730,337.47  INR
Why the value changed, i am not able to getting it where does the problem. I am new to MM field. Anybody any idea about this. I want to sort out this issues as soon as possible.
Please help.

some problems can only be solved with OSS notes. if you someone who has to solve SAP issues, then you need access to OSS yourself, or you need one in your organisation who can lookup and implement SAP notes for you.
Ask your basis team, they can grant you access to SAP Marketplace to search for OSS notes.
In general you should differentiate with data that is audit relevant and non-audit relevant data like statistical data.
MC.9 is statistical data, certainly not that important like audit relevant data in MB5B.
if you see a difference, then just assume that the audit relevant data is okay, and the statistic may be wrong.
Do not assume that the statistic has the right information and you need to adjust the audit relevant data, as this is certainly a wrong approach.
when you post a movement then you create audit relevant and statistic relevant data. this does not happen in the same LUW, it is decoupled. if something is wrong and the audit relevant data cannot be posted to the database, then the whole data is rolled back and nothing is posted to any table.
but if something is wrong with the statistic data, then the statistic data posting fails, but the audit relevant part is not rolled back, hence you get this kind of inconsistencies.
(this is just one example how such inconsistencies can arise, there are more reasons which you can learn by reading OSS notes)

Similar Messages

  • Problem in the stock report

    Hi all,
    We have stock report.There is one problem in the report.We are using
    "2LIS_03_BF" and " 2LIS_03_UM " as data source and " 0AFMM_C02" as info source.
    When i run the report with material as row its giving me the correct result.But when i pass plant into row then it shows me only few plants. Only option to check the stock at plant level is that i have to select all the records. this is working in the development server but not in produciton... as there are many records... in the production...
    i am not able to understand what is the logic behind it... its happening even if i create a new query....
    Can you suggest me any option ...
    Regards,
    Viren.

    No Solution

  • Performance problem in Zstick report...

    Hi Experts,
    I am facing performance problem in Custoom Stock report of Material Management.
    In this report i am fetching all the materials with its batches to get the desired output, at a time this report executes 36,000 plus unique combination of material and batch.
    This report takes around 30 mins to execute. And this report is to be viewed regularly in every 2 hours.
    To read the batch characteristics value I am using FM -> '/SAPMP/CE1_BATCH_GET_DETAIL'
    Is there any way out to increase the performance of this report, the output of the report is in ALV.
    May i have any refresh button in the report so that data may get refreshed automatically without executing it again. or is there any cache memory concept.
    Note: I have declared all the itabs with type sorted, all the select queries are fetched with key and index.
    Thanks
    Rohit Gharwar

    Hello,
    SE30 is old. Switch on trace on ST12 while running this progarm and identify where exactly most of the time is being spent. If you see high CPU time this problem with the ABAP code. You can exactly figure out the program/function module from ST12 trace where exactly time is being spent. If you see high database time in ST12, problem is with database related issue. So basically you have to analyze sql statement from performance traces in ST12. These could resolve your issue.
    Yours Sincerely
    Dileep

  • Stock report on the basis of valcation class

    hi expert
    My abaper have create a stock report on the valuation class the report contain opening balance, inward stock, outward stock, clossing stock.i have done with the report the problem which i am getting in some of the valuation class i am getting the wrong all the figure
    Please guide me for to fetch proper field and table.
    regard
    nabil

    Hi jayant
    i dont want MB5W because its analysis reprot. i want to get report on the basis of monthly, in which valuation class- opening balance, inward movement (value), outward movement (value), clossing balance.
    regard
    nabil

  • Project Stock report using QBEW and QBEWH tables

    Dear All,
    First of all Happy New Year to all of you.
    Here is my question: I want to build a ABAP report for stock situation for project stock. The report demands the stock by closing month. Suppose I run the report for month 11/2010, it should show the closing stock at the end of the month 11/2010.
    Now I am using the values from table QBEW for this purpose.But QBEW table shows only current entries. If a material stock is changed or value is changed, it goes into history table QBEWH.
    Now problem is that if I try to make sum of QBEW and QBEWH, the stock value is excessive. Now I am not sure which entries I should consider from QBEWH table for this purpose.
    Has anybody worked on similar requirement?
    Thanks in advance!
    Regards,
    Mahendra Dighe

    Hi,
    Please try the report S_P00_07000140 - Inventory and Raw material for special stock report.
    Thanks.
    abdul

  • Stock report Question

    I am trying to wright a simple Stock report and i am running into difficulties - any expert advice would be appreciated:
    The report should have the following fileds:
    Item Group, Item Code, Item Description, In Stock Quantity, Stock Value.
    The report should summarise by Item Group with Sub Totals.
    I have tried several methods and I failed with all of them:
    A Using Report Composer, I managed to Place the first 3 Fields and checked that this worked OK, and then converted this to an XL Reportt Definition. But, this Definition did not give any results when I ran it.
    B. I started a new XL Definition using the Advanced Formula builder and managed to place all the fields but was not able to Group the records by using the XL Sub Total function.- this gave me only a total for all the records. I think I have done the procedure correctly but for some reason the SubTotal function within XL reporter does not give the expected result.
    C. I have used the Grouping function within the Advanced Formula Builder but this did not work either
    I wonder if anybody else experienced this type of problem because I suspect that something is wrong with the XL reporter?
    Thank you
    Robert

    Hi Gordon
    The reason I say that it might be a bug is the fact that when I get the #N/A in the cell I can go to another cell that has the COLUMN TOTAL formula and copy and paste and it seems to work OK.  Also, I can put  in the Formula manually (if I remember the syntax correctly...)
    The frustration I have with the XL reporter is in the fact that it is a good product but to get the right result you need to "Experiment and guess" as to what the result will be. It is more of an "Art" then a preciese "Science". I can now write reports but I still do not understand when and why the report works. Perhaps SAP should give some guidlines of what "Kind" of combination may or may not work.
    I do fully understand the construction of relational database tables and the links between them, but the XL reporter does not seem to have a logical approach for the end user to help construct a report so the only practical approach seems to be "trial and error"
    One basic helpful hint seems to be that you need to have a Light Dimention Value field in order for a report to work - but I am not sure why this is the case.
    Thanks for your remrks, they certaily point me in the right direction
    Robert

  • Stock Report in Sap ecc6

    Dear Team,
    I was previously using Russian J3RFLVMOBVED in Sap ecc6. It was working fine for the last two years for stock valuation quantity & Value wise. From Jan 2012 this report is showing Negative Stock  in the report.  For this i consulted ABAP for the check the values source (from which table these  negative values are arising)   in table MBEW & BSIM. These values also didn't existed in the Table mentioned above. Can any one advice me for this problem?
    Also can any one provide me alternative report in sap ecc-6 for Stock quantities & Values on specified dates along with the sub locations.
    Secondly is there any standard report for Material Aging?
    M.Yousuf

    Hi,
    I have checked mb5b its not addressing my issue as its showing valuated stock  without location & Batches. I have checked S_POO_07000139, ITS ALSO SHOWING Valuated Stock without Batch Plant & Location wherease MC.1 & other MC Tcodes. They are showing valuated stock without batches material code & Description in a summarized form.
    I need this stock report for the stock count on month End in a summarized form.
    Please advice any other solution.
    M.Yousuf

  • MC50 - Dead Stock Report

    Good day to all.
    We use the MC50 report to identify obsolete stock. We use a one plant system with various storage locations dispersed throughout the geographical area of our company. The problem we have is that the MC50 report as input parameters requires the plant and cannot be run per storage location, thus identifying obsolete stock per such location.
    We are considering a customization but have been advised that the development will require extensive development as result of the main program having several includes which contain SAP standard function modules.
    We are attempting to establish if there are other SAP users who encountered the same scenario  and if so if there is not perhaps a simplified solution to extract the obsolete stock report per storage location as opposed to plant level.
    Best Regards
    Mike Olwagen
    Manager SAP Solution Support
    City Power Johannesburg (Pty) Ltd

    Hi,
    In this regard to my understanding, we may use BI reports to extract the Dead Stock per storage location.
    The Plant having the SLoc data can be pooled in the BI Interface, wherein selection criteria will be there to select respective SLoc having the Dead Stocks. The tables can be customized according to the requirement of the user in BI reports.
    Regards,
    Dhrubajit

  • How to get Opening Balance for Stock Report in Crystal Report?

    Dear Experts,
    I am using SAP B1 8.82.
    I am new to crystal report and now trying to do a monthly stock report with the following format:
    Species  BatchNum   OpeningBal   QtyInKD    QtyInRD    QtyInCD   Adj    ClosingBal
    ABC       T1234          17.43           10.16         17.43        0.00         0.00   10.16
    ClosingBal = OpeningBal + QtyInKD - QtyInRD - QtyInCD + Adj
    Parameters:
    - DateFrom
    - DateTo
    - WarehouseFrom
    - WarehouseTo
    I am having problem in defining formula to get the opening balance for each item. The report is grouped by species, whscode & batchNum.
    Anyone please share with me how to write the formula for opening balance in stock report.
    Thanks.
    Best Regards,
    Leng

    Hi
    Check the below discussion it may helps you
    Opening Stock Batchwise
    With Regards
    Balaji Sampath

  • Closing stock report with GRPO

    Hai all
      Please help me to write this query,
    For example
    I have  query to take closing stock report ,but my requirement is ,i want split up for Closing stock and closingvalue
    like, if i have 40 closing stock means i want details how 40 is arrived
    for example i run closing stock report as on 2009-03-31
    means i want this format
    Itemcode ClosingStock Closing value
    ITM001         40                460
    ITM002         20                210.......
    ItemCode GRPOno. VendorCode quantity Rate  GRPO Date
    ITM001        10001          V0001      10       10      2009-02-01
    ITM001        10002          V0002      20       11     2009-03-15
    ITM001        10003          V0003      10       14    2009-03-31
    ITM002        10021          V0011      10       10      2009-02-11
    ITM002        10022          V0015      10       11     2009-03-14

    Hai Jeyakanthan A 
      I want small change in your query
    SELECT T0.ItemCode,T0.TransType, SUM(T0.InQty)-SUM(T0.OutQty) AS 'Closing Stock',SUM(T0.OpenValue) as 'Balance' FROM OINM T0
    *where docdate <= '[%0]'*
    GROUP BY T0.ItemCode,T0.TransType
    Having
    T0.TransType = 20 ORDER BY T0.ItemCode,T0.TransType
    I tried this query for taking closing stock for given date, its giving me correct result
    SELECT T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate FROM OINM T0 WHERE T0.TransType = 20 AND
    (T0.DocDate >= '[%0]' AND
    T0.DocDate <= '[%1]') ORDER BY T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate
    In this query i want only the GRPO no,date,price.... for closing stock quantity
    Edited by: Prasanna s on May 14, 2009 12:39 PM

  • Stock Report Date Wise

    Dear All
            I am devlop new Stock Report Date wise
    my output follows
    Material    Plant   Storagelocaton   Saleorder OPenning stock     Closing Stock     Total
    Which Table stored that details?
    how will calculated?
    Thanks and Regards
    Suresh

    hey
    i think the following tables
    will be helpful for the report:-
    1>MARA
    2>MBEWH
    3>MSEG
    4>VBRP
    hope this will help
    good luck
    harry.

  • 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).

  • Problem in ALV report

    Hi Friends,
    I have the following 2 problems in ALV report
    1) Logo is not getting displayed in the report.
    2) When i click on the Purchase order number in the report  the interactive report is not working,i am not able to see report of First interactive level.
    can you help it out friends.
    Thanks and regards
    Dinesh
    REPORT  YSDBALV1
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv  WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line .
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
          ebeln like ekko-ebeln ,           "Purchasing Document No.
          bedat like ekko-bedat ,           "Purchasing Document Date
          matnr like ekpo-matnr ,           "Material No.
          netwr like ekpo-netwr ,         "Net Order Value in PO Currancy
          meins like ekpo-meins ,           "UOM
          chk(1) ,
          light(1) ,
          change like ekpo-menge ,
          end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln  .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
       message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
           EKKO~BEDAT
           EKPO~EBELP
           EKPO~MATNR
           EKPO~NETWR
           EKPO~MEINS
           EKPO~MENGE
           EKPO~BPRME
           INTO CORRESPONDING FIELDS OF  table IT_FINAL
           FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
           WHERE EKKO~EBELN IN S_EBELN.
           APPEND IT_FINAL.
    endform.                    " get_data
    *Getting the Event for Top of Page display.
    *&      Form  event
          text
         -->P_I_event[]  text
    form event  using    p_i_event type slis_t_event.
      clear p_i_event .
      refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = p_i_event
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    read table p_i_event with key name = slis_ev_top_of_page into i_event.
          if sy-subrc = 0.
                 move 'TOP_OF_PAGE_PO' to i_event-form.
                 modify p_i_event from i_event index sy-tabix transporting form.
          endif.
          clear i_event.
    endform.                    " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
           clear i_header .
           refresh i_header .
           write sy-datum to text.
           i_header-typ = 'H'.
           i_header-info = 'PURCHASE OREDER DETAILS'.
           append i_header.
          *Logo Display
          CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
                 EXPORTING
                     it_list_commentary       = i_header[]
                     I_LOGO                   = 'ENJOYSAPLOGO'.
    endform .
    *Field Catalog Append
    *&      Form  field
          text
         -->P_fieldCATALOG[]  text
    form field using  p_fieldcatalog type slis_t_fieldcat_alv.
         clear fieldcatalog.
          fieldcatalog-fieldname   = 'EBELN'.
          fieldcatalog-seltext_m   = 'Purchase Order No'.
          fieldcatalog-col_pos     = 1.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'BEDAT'.
          fieldcatalog-seltext_m   = 'PO Date'.
          fieldcatalog-col_pos     = 2.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MATNR'.
          fieldcatalog-seltext_m   = 'Material No'.
          fieldcatalog-col_pos     = 4.
          fieldcatalog-outputlen   = 20.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'NETWR'.
          fieldcatalog-seltext_m   = 'Net Value '.
          fieldcatalog-col_pos     = 5.
          fieldcatalog-outputlen   = 20.
          fieldcatalog-do_sum = 'X'.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MEINS'.
          fieldcatalog-seltext_m   = 'Units'.
          fieldcatalog-col_pos     = 6.
          fieldcatalog-outputlen   = 4.
          append fieldcatalog .
          clear fieldcatalog.
    endform.                    " field
    *&      Form  layout
          text
    form layout  using    p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra  = 'X'.
        i_layout-lights_fieldname = 'LIGHT'.
        i_layout-lights_tabname = 'IT_FINAL'.
        i_layout-box_fieldname = 'CHK'.
        i_layout-box_tabname  = 'IT_FINAL'.
        i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING  P_I_EXTAB TYPE
                     SLIS_T_EXTAB.
                     SET PF-STATUS 'MENUPO'.
      ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND  using r_ucomm like sy-ucomm
                             rs_selfield type slis_selfield .
      if r_ucomm = '&IC1'.
      READ TABLE IT_FINAL  index   rs_selfield-tabindex.
      write:/ IT_FINAL-ebeln.
      endif.
    endform .
    *Parameters of FM  REUSE_ALV_GRID_DISPLAY
    *&      Form  grid_display
          text
    -->  p1        text
    <--  p2        text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PO_PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = I_LAYOUT
        IT_FIELDCAT                       = FIELDCATALOG[]
        IT_EVENTS                         = I_EVENT[]
      TABLES
        t_outtab                          = IT_FINAL.
    endform.                    " grid_display

    *& Report  YSDBALV1
    REPORT  YSDBALV1.
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line ,
         wa_event type line of slis_t_event.
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
    ebeln like ekko-ebeln , "Purchasing Document No.
    bedat like ekko-bedat , "Purchasing Document Date
    matnr like ekpo-matnr , "Material No.
    netwr like ekpo-netwr , "Net Order Value in PO Currancy
    meins like ekpo-meins , "UOM
    chk(1) ,
    light(1) ,
    change like ekpo-menge ,
    end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
    message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
    EKKO~BEDAT
    EKPO~EBELP
    EKPO~MATNR
    EKPO~NETWR
    EKPO~MEINS
    EKPO~MENGE
    EKPO~BPRME
    INTO CORRESPONDING FIELDS OF table IT_FINAL
    FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
    WHERE EKKO~EBELN IN S_EBELN.
    APPEND IT_FINAL.
    endform. " get_data
    *Getting the Event for Top of Page display.
    *& Form event
    text
    -->P_I_event[] text
    form event using p_i_event type slis_t_event.
    clear p_i_event .
    refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = p_i_event.
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    read table p_i_event with key name = slis_ev_top_of_page into wa_event.
    if sy-subrc = 0.
    move 'TOP_OF_PAGE_PO' to i_event-form.
    modify p_i_event from i_event index sy-tabix transporting form.
    endif.
    clear i_event.
    endform. " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
    clear i_header .
    refresh i_header .
    write sy-datum to text.
    i_header-typ = 'H'.
    i_header-info = 'PURCHASE OREDER DETAILS'.
    append i_header.
    *Logo Display
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = i_header[]
    I_LOGO = 'ENJOYSAP_LOGO'.
    endform .
    *Field Catalog Append
    *& Form field
    text
    -->P_fieldCATALOG[] text
    form field using p_fieldcatalog type slis_t_fieldcat_alv.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order No'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'BEDAT'.
    fieldcatalog-seltext_m = 'PO Date'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material No'.
    fieldcatalog-col_pos = 4.
    fieldcatalog-outputlen = 20.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETWR'.
    fieldcatalog-seltext_m = 'Net Value '.
    fieldcatalog-col_pos = 5.
    fieldcatalog-outputlen = 20.
    fieldcatalog-do_sum = 'X'.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Units'.
    fieldcatalog-col_pos = 6.
    fieldcatalog-outputlen = 4.
    append fieldcatalog .
    clear fieldcatalog.
    endform. " field
    *& Form layout
    text
    form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra = 'X'.
    i_layout-lights_fieldname = 'LIGHT'.
    i_layout-lights_tabname = 'IT_FINAL'.
    i_layout-box_fieldname = 'CHK'.
    i_layout-box_tabname = 'IT_FINAL'.
    i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
    SLIS_T_EXTAB.
    SET PF-STATUS 'MENUPO'.
    ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield .
    if r_ucomm = '&IC1'.
    READ TABLE IT_FINAL index rs_selfield-tabindex.
    set parameter id 'VL1' field it_final-ebeln.
    call transaction 'ME23N'.
    endif.
    endform .
    *Parameters of FM REUSE_ALV_GRID_DISPLAY
    *& Form grid_display
    text
    --> p1 text
    <-- p2 text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IS_LAYOUT = I_LAYOUT
    IT_FIELDCAT = FIELDCATALOG[]
    IT_EVENTS = I_EVENT[]
    TABLES
    t_outtab = IT_FINAL.
    endform. " grid_display
    Regards,
    Rusidar S.

  • Stock Report for Variant configuration

    Hi Experts,
    Request your help to get the following information.
    We have a material which are packed in to multiple packing modes. Inorder to ease the selection of packing mode in sales order, we are thinking of introducing variant configuration. I.e all the packed materials will be created as variants in SAP and the sales order will be created for the configurable material. When the proper characteristic is selected the material will be automatically replaced by the variant.
    But the requirement is to see the stocks of all the varaints along with the configurable materials as the header. For eg. Material A is having variants A1, A2 & A3. The sales quantites are 25, 30 and 35 respectively.
    In any of the standard report, can I see the sales of these along with the total sales of config mtl A as 90
    Please guide.
    Thanks & Regards
    Prathib

    Hi Prathib,
    On my last project, we define material code with the same code at the beginning like you do A1 A2 A3 (for variants) and AC for example for configurable material. Then for stock report you can use MB52, in material field just write A* it will show you stock from material start with code A. But make sure you define material type and material group for selection wisely. It works for me. Now depends on how well you define your structure.
    Regards,
    Arman

  • Stock report for cross-company sales

    Dear all,
    We are using for our Saudi Arabia company the cross-company sales process with sourcing unit in another country.
    There is a Legal requirement in Saudi to provide a Stock report (with "stock in", "stock out" quantities and values).
    But with the cross-company sales process the stock movements are not visible in Saudi.
    Any advice ? Is there a report in SAP for this legal reqirement in Saudi Arabia ?
    Best regards

    Hi,
    Try to use t-code MB51, will give you a list with the relevant movement types!
    Good luck
    Tao

Maybe you are looking for