Inventory optimization

Hi all,
          I need ur inputs for the following  sceanario.
Critical materials are kept in warehouses as safety stocks. Each location has its own safety stock for its own spare parts. That leads to duplicate stocking of similar materials at different locations. To optimize the inventories and reduce their costs, it is suggested to consolidate similar materials at certain locations and allow all other locations to use it. By doing so, huge cost savings can be realized.
Delays in delivery might have harmful effects on business. Assessment tool is required to find the best location to stock the consolidated safety stock considering cost of transportation, delivery time and criticalness of the location.
It is required to have a system at which locations are prioritized by some cost factor .
Another required functionality is to enable the decision of where to stock the safety stock considering the transportation cost, the delay penalty (risks) and the delivery time. Comparison of different stocking options is also required showing the cost and effect of each option. how to use the available APO functionality by enabling reporting, simulation and comparison.
regards
sankar.

Here's a link to some details about SAP Enterprise Inventory and Service-Level Optimization (SAP EIS) on the SAP website.  Inventory Management Software | Integrated Sales & Operations Planning | SAP
There is a lot of material available to explain the mathematics that looks at lead times, inventory costs, uncertainty, customer service level targets and more, to recommend optimal safety stock recommendation through your multi-echelon supply chain.  And EIS integrates with other SAP supply chain applications and has been leading the field for many years.  I am an SAP Solutions Consultant implementing SAP EIS at several SAP customers now and there are many references that have been successfully saving inventory dollars for many years with this application.

Similar Messages

  • Inventory optimization with SMARTops

    Hi all
    we are coming up soon with requirements gathering sessions for implementing inventory optimization with SMARTops.
    can anyone provide a heads up for your expereiences with SMARTops and how this new product works with SAP APO.
    we are currently on SCM7.0.
    please send some links that can direct me to case studies and information about implementing SMARTops with SAP APO.

    Ashvin, there are several ways to take the SAP EIS (formerly SmartOps) time phased safety stock output and convert that into one safety stock value for ECC.  As you pointed out, you can take the one value for the current week and use that but a less volatile idea might be to average the SS recommendations for several time periods going forward, depending on your business details.  If you have a frozen period with your factories or vendors, or if you get order lead time from customers, those parameters would impact the number of periods to average.  You could take the highest SS value over that period instead, depending on your customer service targets and if you're planning safety stocks throughout your supply chain  (multi-echelon)with EIS or just for finished goods.  As you can see, a lot goes into the decision about how to take time phased safety stock values and convert them into one value.  Many EIS customer are doing that now successfully.  I suggest reaching out to your SmartOps consultant for guidance.   I am currently working for SAP as a Solutions Consultant on the EIS application.

  • Differences listed between ASCP Optimization and Inventory Optimization ?

    Does anyone has a listed readymade document listing the differences between ASCP optimization and Inventory optimization modules.
    thx for your help.
    thx and rgds,
    Pankaj

    Hi,
    As explained IO will recommend time phased Safety stocks it also provides various constraint option, we can make use of it as per our requirement.
    In ASCP, following optimization are available:
    1. Maximize inventory turns
    2. Maximize plan profit
    3. Maximize on-time delivery
    If you want to use the same optmization in IO, we can fulfill the requirement by available IO constraints say max on-time delivery thro enforce service level constraint.
    Hope it will help u.
    Tks
    M J

  • Can I releases planned orders in planner workbench  using inventory planner responsability (IO)

    Can I releases planned orders in planner workbench using inventory planner responsability (IO), in IO manual I found following information :
    Planner Workbench
    You can use the Planner Workbench in Oracle Advanced Supply Chain Planning to act on recommendations generated by the planning process for a plan. You can implement
    planned orders as discrete jobs or purchase requisitions, maintain planned orders, reschedule scheduled receipts, and implement repetitive schedules. You can choose all
    suggestions from an MRP plan, or only those that meet a certain criteria. In Oracle Inventory Optimization, Planner Workbench is used to perform tasks such as setting up
    item attributes, setting up supply chain BOM, and analyzing time-phased safety stocks.
    my question is Oracle Inventory Optimization, Planner Workbench can´t release planned orders.
    Thanks in advance
    regards James

    Hi James,
    We cannot release planned orders from IO workbench.
    IO is for safety stock planning, not for releasing planned orders. That is done from an ASCP plan which uses the IO plan as demand schedule.
    Regards,
    Mohan Balaji
    NOTE: Please mark the post as Helpful or Answered if the update has really helped you. This would also bring the thread to logical conclusion and will be helpful for the viewers.

  • LOV validation issue: "Select a valid value"

    Hi,
    I have a lov problem in oaf: "Select a valid value".
    It is a common problem, but somehow I cannot figure it out.
    LOV
    - LovApplicationId (of type "formValue")
    - LovApplicationShortName (of type "messageStyledText")
    - LovApplicationName (of type "messageStyledText")
    (based on combination of fnd_application and fnd_application_tl)
    BASE PAGE
    Two relevant items.
    First one is "ApplicationId" of type "formValue" connected to view attribute "ApplicationId". (connected to EO attribute in VO)
    Second one is "ApplicationName" of type "MessageLovInput" connected to view attribute "ApplicationName" (calculated in VO)
    Two lovMappings.
    First mapping:
    LOV Region Item = LovApplicationName
    Return Item = ApplicationName
    Criteria Item = ApplicationName
    Use for validation = no
    Second mapping:
    LOV Region Item = LovApplicationId
    Return Item = ApplicationId
    Criteria Item = <null>
    Use for validation = yes
    For example.
    If I select "Inventory" in the LOV and click on the apply button in the base page, I am getting the error "Select a valid value".
    If I select "Inventory Optimization" in the LOV and click on the apply button in base page, no error. And when I look in database the record is saved in my custom table with the correct application_id.
    I have read many forum threads on this issue, but I cannot figure it out, what is wrong.
    Please help me out.
    Kind regards,
    Cor

    Hi Haroon,
    This doesn't solve the problem.
    It is true the exception I am getting doesn't show up anymore.
    But the application_id isn't saved to the database.
    First thing I would expect in this case, that the mappings are not set properly.
    But if I choose for the value "Inventory Optimization", the application_id is saved to the database.
    If I choose for the value "Inventory" the application_id is not saved to the database.
    So it is possible the get rid of the error in the screen, but the underlying problem is still there...
    I have checked some core pages, similar to the one I have.
    So an UPDATE page (rectification: instead of CREATE).
    I have set all attributes the same, but the problem still occurs in my case.
    Very strange.
    I would make no difference running the page from jdeveloper or put the files on the application server and run it from Oracle, would it?
    It makes no sense. But...
    Kind regards,
    Cor

  • R12.1.3 certification for JDK and other products on Oracle Linux 6

    Hello
    We are in the process of migrating R12.1.3 from Linux 5.4 (64bit) on physical server to OEL 6.5 (64bit) on Oracle VM.
    Currently running IAS 10.1.3.5 , Forms 10.1.2.3,  JDK 1.6_10 on HTTP Server Node and 1.4.2_14-b05 on Developer 10g (Forms/Reports). JRE client is 1.6_24.
    The future state is R12.1.3 on OEL 6.5 on Oracle VM with JRE 7.  
    The plan is to use Rapid Clone as we are already on 10.1.3.5 and DB 11.2.0.3.
    The uncertainty is with JDK as the certification on MOS for R12.1.3/OEL 6 indicates minimum version of JDK is 1.6_26.  
    Should I upgrade to JDK 1.6_26 as a minimum, on the apps tier 10.1.3_HOME and 10.1.2_HOME on Linux 5.4 before cloning to OEL 6.5?  Or can we continue running the current JDK apps tier versions on OEL 6.5 and only upgrade the client to JRE 7,  without updating JDK?
    Taking into account the current versions, can I use the pre-build R12.1.3 VM templates on the new hardware and then clone?
    Furthermore, I read the following comment on Steven Chan's blog,  it was in June 2012, are these products certified now?
    "there is still some unsupported products on OEL6*
      Oracle Advanced Supply Chain Planning (MSC)
      Oracle Inventory Optimization (MSR) 
      Oracle Constraint Based Optimization (MSO) 
      Oracle Work In Process (WIP) 
      Oracle Manufacturing Scheduling (WPS)"
    Any suggestions/assistance will be appreciated.
    Thanks in advance.
    Asha

    Pl do not post duplicates - R12.1.3 JDK certification for OEL 6.5

  • Urgent :IBP Supply Scenario

    Hi Gurus
    I am working on a small demo for IBP supply.
    Objective : Heuristic run in IBP
    I have some questions regarding the same.If any of you have done this already, pease provide some guidance or documentation for the same.
    What all Key figure has to be configured in the Planning Area just for a heuristics run (Not interested to run Inventory Optimization)
    Has the copy of SAP2 worked ? I am getting issues with activation after copy.
    Any prerequisites.
    Thanks, any help would be highly appreciated.
    Lavi

    Hi Lavi,
    I’m doing the same.
    I was able to copy SAP2, activate it, load some data and run heuristic.
    I suggest you copy SAP2 because to start from scratch would be very long. I copied also master data type changing the prefix from S2 to my prefix.
    Prerequisites for heuristic:
    Use attributes PRDID, CUSTID, LOCID, RESID without changing their name (if you copy SAP2, even if you change the name of the master data type while copying, the attribute names will remain the same, so you should be ok).
    Master Data needed
    Products, Customers, Locations, Resources, Resource Locations,
    Customer Source, Location Source, Production Source, Production source item (BOM), Production Resource (production cycle).
    Key figures:
    If you see in SAP2 the KF that are marked as Input and/or output for supply are those you should have.
    Input key figures should be: consensus demand, inventory target, stock on hand, and the key figures corresponding to the above master data if you load master data as time dependent.
    Output KF should be: all the dependent demand key figures (customer, location, production, dependent demand); net demand, capacity demand.
    Capacity usage, all the receipt kf (customer, production, external, transport, total), all the supply KF, projected inventory.
    Cheers,
    Patrizia

  • HP QUERY DATA ERROR((SQLER=ORA01476 divisor is equal to zero

    Experts,
    We are seeing the following error in Inventory Optimization Horizontal Plan
    HP QUERY DATA ERROR((SQLER=ORA01476 divisor is equal to zero
    Navigation
    Sign on as Inventory Planner responsibility, Inventory Plan > Workbench
    Select the plan owning org, so you can see all orgs.
    View by organizations
    Select org: <Org Code>
    Select Category <category>,
    item <Item name
    Right click, select Horizontal Plan > Default
    Can you help please.

    Well the easiest way to troubleshoot this problem would be to find the row where FBASEVOLTAGE = 0. Something like this maybe:
    SELECT BV.FBASEVOLTAGE
         , FB.FMAGNITUDE_RESULT
         , BS.IUBUSNO
    FROM                       GN
    JOIN                       GM ON  GM.IELEMENT_MAP_ID  = GN.IELEMENT_MAP_ID
    JOIN                       BS ON  GM.NPS_ELEMENT_ID   = BS.IUBUSID
                                  AND GM.NPS_ELEMENT_TYPE = 101
    JOIN   CONFIG_BASE_VOLTAGE BV ON  BS.IBASEVOLTAGEID   = BV.IBASEVOLTAGEID
    JOIN   FACT_BUS            FB ON  FB.IBUS_NO          = BS.IUBUSID
                                  AND FB.IPS_CASE_ID      = GN.IPS_CASE_ID
    WHERE BV.FBASEVOLTAGE = 0
    AND   GN.IPS_CASE_ID  = 1637
    ;

  • Safety Stock Calculation Setups

    Hi,
    Question 1:_
    I created a buy item with the safety stock details as below
    Method : MRP Planned %
    Bucket days : 2
    Percent : 100
    Also i enabled the MSO: Default Timestamp Safety Stocks to End of Day (23:59).After running the collection plan (Targeted Refresh) my msc_system_items table looks as below
    SAFETY_STOCK_CODE : 1
    SAFETY_STOCK_BUCKET_DAYS : Nill
    SAFETY_STOCK_PERCENT : Nill
    and then msc_safety_stocks is also empty.
    Please help me to solve the issue.
    Question 2:*
    what setups should i do to create the safety stock in my plan other than checking the calculate safety stock in plan option.Aslo what plan should i run (constrained or unconstrained)???
    Note : we done have inventory optimization installed.
    With Regards,
    M.Raamjee

    Hi Sandeep,
    I tried the generating safety stock.I succeeded too..Thanks for the help.But i need your help again for the analysis.
    I created a Buy item and i havent mentioned a LT for it.
    For safety stock calculation,i mentioned
    safety stock Buket days : 2
    safety stock percentage : 100
    Forecast was 100qty every day from 4/May to 9/May ..
    Output was as below
    29/Apr/2012 Forecast = 0 Saf.Stock = 76
    30/Apr/2012 Forecast =300 Saf.Stock = 100
    5/May/2012 Forecast =300 Saf.Stock = 73
    14/May/2012 Forecast = 0 Saf.Stock = 24
    As per the calculation
    ( 200/2) * 100% = 100 qty which is matching the qty in 30/Apr bucket.
    I need to know how was the other buckets got calculated.
    With Regards,
    M.Raamjee
    Edited by: Ramji on Apr 29, 2012 10:04 AM

  • Inventory Cube Optimization.

    Dear All,
    As I am having the requirement as per the following, need your inputs.
    Datamodell:
    Inventory Cube 'X1' with data from source system S1 since 2007.
    Inventory Cube 'X2' with data from source system S2 since 2007.
    Problems:
    Queries are defined on X1 and on X2. And the performance of queries are poor due to high volume of data in cubes.
    Requirements:
    1. In order to avoid the above said problem, I have to create a new cube(History) and move data from X1 and X2 to new cube
        (History) with data selection of year 2007 and 2008 and delete the respective data from X1 and X2.
    2. Is it possible to do the above said requirement? Regarding the special function of the marker update in inventory cubes and the
        calculates key figures?
    I have some ideas that we can't delete data in Inventory cube due to the market update concept.
    Any inputs and suggestions from your side will be really helupful.
    Regards,
    Kanagaraj.S

    u can archive the dormant data
    i.e u can say unused data
    create ur report
    if u again want ur data back then again reload the data from the sap work directory to the same infocube

  • Non-Cumulative vs. Cumulative KeyFigures for Inventory Cube Implementation?

    A non-cumulative is a non-aggregating key figure on the level of one or more objects, which is always displayed in relation to time. Generally speaking, in SAP BI data modeling, there are two options for non-cumulative management. First option is to use non-cumulative management with non-cumulative key figures. Second option is to use non-cumulative management with normal key figures (cumulative key figures). For SAP inventory management, 0IC_C03 is a standard business content cube based upon the option of non-cumulative management with non-Cumulative key figures. Due to specific business requirements (this cube is designed primarily for detailed inventory balance reconciliation, we have to enhance 0IC_C03 to add additional characteristics such as Doc Number, Movement type and so on. The original estimated size of the cube is about 100 million records since we are extracting all history records from ECC (inception to date). We spent a lot of time to debate on if we should use non-cumulative key figures based upon the  standard business content of 0IC_C03 cube. We understand that, by using Non-Cumulative key figures, the fact table will be smaller (potentially). But, there are some disadvantages such as following:
    (1) We cannot use the InfoCube together with another InfoCube with non-cumulative key figures in a MultiProvider.
    (2) The query runtime can be affected by the calculation of the non-cumulative.
    (3) The InfoCube cannot logically partition by time characteristics (e.g. fiscal year) which makes it difficult for future archiving.
    (4) It is more difficult to maintain non-cumulative InfoCube since we have added more granularity (more characteristics) into the cube.
    Thus, we have decided not to use the Cumulative key figures. Instead, we are using cumulative key figures such as Receipt Stock Quantity (0RECTOTSTCK) ,  Issue Stock Quantity(0ISSTOTSTCK)
    , Receipt Valuated Stock Value (0RECVS_VAL) and Issue Valuated Stock Value (0ISSVS_VAL). All of those four key figures are available in the InfoCube and are calculated during the update process. Based upon the study of reporting requirements, those four key figures seems to be sufficient to meet all reporting requirements.
    In addition, since we have decided not to use cumulative key figures, we have removed non-cumulative key figures from the 0IC_C03 InfoCube and logically partitioned the cube by fiscal year. Furthermore, those InfoCube are fiscally partitioned by fiscal year/period as well.
    To a large extent, we are going away from the standard business content cube, and we have a pretty customized cube here. We'd like to use this opportunity to seek some guidance from SAP BI experts. Specifically, we want to understand what we are losing here by not using non-cumulative key figures as provided by original 0IC_C03  business content cube. Your honest suggestions and comment are greatly appreciated!

    Hello Marc,
    Thanks for the reply.
    I work for Dongxin, and would like to add couple of points to the original question...
    Based on the requirements, we decided to add Doc Number and Movement type along few other characteristics into the InfoCube (Custom InfoCube - article movements) as once we added these characteristics the Non Cumulative keyfigures even when the marker was properly set were not handling the stock values (balance) and the movements the right way causing data inconsistency issues.
    So, we are just using the Cumulative keyfigures and have decided to do the logical partitioning on fiscal year (as posting period is used to derive the time characteristics and compared to MC.1 makes more sense for comparison between ECC and BI.
    Also, I have gone through the How to manual for Inventory and in either case the reporting requirement is Inception to date (not just weekly or monthly snapshot).
    We would like to confirm if there would be any long term issues doing so.
    To optimize the performance we are planning to create aggregates at plant level.
    Couple of other points we took into consideration for using cumulative keyfigures are:
    1. Parallel processes possible if non-cumulative keyfigures are not used.
    2. Aggregates on fixed Plant possible if non-cumulative keyfigures are not used. (This being as all plants are not active and some of them are not reported).
    So, since we are not using the stock keyfigures (non cumulative) is it ok not to use 2LIS_03_BX as this is only to bring in the stock opening balance....
    We would like to know if there would be any issue only using BF and UM and using the InfoCube as the one to capture article movements along with cumulative keyfigures.
    Once again, thanks for your input on this issue.
    Thanks
    Dharma.

  • Increase in inventory value

    Huge increase in my inventory value, what should be the solution given to the client as an MM consultant.

    you should analyze why the value increased.
    It is totally unclear if you are talking about the overall value, which could be caused by physical effects of having more stock than ever in your warehouse, so you need to optimize this case.
    But if you are talking about one material which got a huge value while the stock level did not really change on exceptional basis, then you should analyze your accpounting documents to a material and its values in MR51.
    There you should find   when it started to increase the value.
    Which may be caused by a wrong price in a PO (could have been corrected after GR, so check change history of order as well)

  • Optimize this code?

    DATA: v_title(245) TYPE c,
    v_butxt(245) TYPE c,
    v_tot_recs LIKE sy-tabix,
    v_total_pages LIKE sy-tabix,
    v_tot_qty LIKE mseg-menge.
    TABLES: mara, makt, marc, mard, mkpf, mseg, t001, t001w,t001l.
    TABLES: sscrfields.
    *TYPE_POOLS
    TYPE-POOLS: slis. "ALV Display
    TYPES : BEGIN OF stype_mseg_lean,
    mblnr LIKE mkpf-mblnr,
    mjahr LIKE mkpf-mjahr,
    budat LIKE mkpf-budat,
    xblnr LIKE mkpf-xblnr,
    bukrs LIKE t001-bukrs,
    zeile LIKE mseg-zeile,
    bwart LIKE mseg-bwart,
    matnr LIKE mseg-matnr,
    werks LIKE mseg-werks,
    lgort LIKE mseg-lgort,
    shkzg LIKE mseg-shkzg,
    menge LIKE mseg-menge,
    meins LIKE mseg-meins,
    dmbtr LIKE mseg-dmbtr,
    dmbum LIKE mseg-dmbum,
    insmk LIKE mseg-insmk,
    aufnr LIKE mseg-aufnr,
    kostl LIKE mseg-kostl,
    anln1 LIKE mseg-anln1,
    kdauf LIKE mseg-kdauf.
    TYPES : END OF stype_mseg_lean.
    TYPES: stab_mseg_lean TYPE STANDARD TABLE OF stype_mseg_lean
    WITH KEY mblnr mjahr.
    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.
    DATA: i_mseg_lean TYPE stype_mseg_lean OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF i_show OCCURS 0,
    matnr LIKE mseg-matnr,
    maktx(150) type c,
    meins LIKE mseg-meins,
    op_stock LIKE mseg-menge,
    stock_in_a_prd LIKE mseg-menge,
    stock_in_a_cstn LIKE mseg-menge,
    stock_in_b_issue LIKE mseg-menge,
    stock_in_b_trn LIKE mseg-menge,
    stock_in_r LIKE mseg-menge,
    stock_toprd LIKE mseg-menge,
    stock_out_a LIKE mseg-menge,
    stock_out_b_issue LIKE mseg-menge,
    stock_out_b_trn LIKE mseg-menge,
    stock_out_r LIKE mseg-menge,
    cl_stock LIKE mseg-menge,
    END OF i_show.
    DATA : i_show_alv LIKE i_show OCCURS 0 WITH HEADER LINE.
    types: BEGIN OF t_mseg_lean_new ,
    matnr LIKE mseg-matnr, "Material Number
    bwart LIKE mseg-bwart, "Movement Type (Inventory Management)
    dmbtr LIKE mseg-dmbtr, "Amount in Local Currency
    shkzg LIKE mseg-shkzg, "Debit/Credit Indicator
    dmbum LIKE mseg-dmbum, "Revaluation amount on back
    menge LIKE mseg-menge, "Quantity
    meins LIKE mseg-meins, "Base Unit of Measure
    insmk LIKE mseg-insmk, "Stock Type
    aufnr LIKE mseg-aufnr, "Order Number
    kostl LIKE mseg-kostl, "Cost Center
    anln1 LIKE mseg-anln1, "Main Asset Number
    lgort LIKE mseg-lgort, "Storage Location
    kdauf LIKE mseg-kdauf, "Sales Order Number
    budat LIKE mkpf-budat, "Posting Date in the Document
    xblnr LIKE mkpf-xblnr, "Reference Document Number
    END OF t_mseg_lean_new.
    DATA: i_mseg_lean_new type t_mseg_lean_new OCCURS 0
    WITH HEADER LINE.
    DATA: i_mseg_lean_cl type t_mseg_lean_new OCCURS 0
    WITH HEADER LINE.
    DATA: i_mseg_lean_cl_final type sorted table of t_mseg_lean_new
    with unique key matnr with header line.
    DATA: wa_op_stock LIKE mseg-menge,
    wa_stock_in_a LIKE mseg-menge,
    wa_stock_in_b LIKE mseg-menge,
    wa_stock_in_r LIKE mseg-menge,
    wa_stock_out_a LIKE mseg-menge,
    wa_stock_out_b LIKE mseg-menge,
    wa_stock_out_r LIKE mseg-menge,
    wa_cl_stock LIKE mseg-menge, "closing stock
    wa_stock_321s LIKE mseg-menge, "Debit
    wa_stock_321h LIKE mseg-menge. "Credit
    DATA: wa_stock_in_a_prd LIKE mseg-menge,
    wa_stock_in_a_cstn LIKE mseg-menge,
    wa_stock_in_b_issue LIKE mseg-menge,
    wa_stock_in_b_trn LIKE mseg-menge,
    wa_stock_out_b_issue LIKE mseg-menge,
    wa_stock_out_b_trn LIKE mseg-menge.
    addition ends
    types: BEGIN OF t_mard ,
    matnr LIKE mard-matnr,
    labst LIKE mard-labst, "UNRESTRICTED STOCK
    insme LIKE mard-insme, "STOCK IN QUALITY INSP
    cl_stock LIKE mseg-menge, "QTY
    END OF t_mard.
    data: i_mard type sorted table of t_mard with unique key matnr with
    header line.
    DATA: v_meins TYPE mseg-meins.
    DATA: i_tabb LIKE bdcdata OCCURS 0 WITH HEADER LINE,
    wa_options LIKE ctu_params.
    DATA: v_objnm TYPE stxh-tdname,
    v_object TYPE stxh-tdobject,
    v_objid TYPE stxh-tdid.
    DATA: n TYPE i.
    DATA : v_long_text(22) TYPE c.
    DATA : V_DESC(150) TYPE C.
    DATA : i_tline LIKE tline OCCURS 0
    WITH HEADER LINE.
    DATA : BEGIN OF i_text_tab OCCURS 0,
    out_lines(150),
    END OF i_text_tab.
    DATA : i_text_tab1 LIKE i_text_tab OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF i_tab_text OCCURS 0,
    ltext(150),
    END OF i_tab_text.
    DATA : BEGIN OF i_tab_text1 OCCURS 0,
    ltext1(100),
    END OF i_tab_text1.
    SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr FOR mara-matnr." OBLIGATORY.
    PARAMETERS: "p_bukrs LIKE t001-bukrs OBLIGATORY,
    p_werks LIKE t001w-werks OBLIGATORY.
    SELECT-OPTIONS: s_lgort FOR t001l-lgort.
    SELECT-OPTIONS: s_budat FOR mkpf-budat OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK one.
    PARAMETERS p_alv AS CHECKBOX . "For ALV
    If no date is given at all, the range is set to the maximum
    extend (1.1.0000 - 31.12.9999).
    If only s_budat-low is set, it is interpreted as the day for
    which the analysis is wanted --> s_budat-high is filled up.
    SELECTION-SCREEN FUNCTION KEY 1.
    IF s_budat-low IS INITIAL.
    s_budat-low = '00000101'.
    IF s_budat-high IS INITIAL.
    s_budat-high = '99991231'.
    ENDIF.
    ELSE.
    IF s_budat-high IS INITIAL.
    s_budat-high = s_budat-low.
    ENDIF.
    ENDIF.
    RANGES s_werks FOR t001w-werks.
    s_werks-sign = 'I'.
    s_werks-option = 'EQ'.
    s_werks-low = p_werks.
    APPEND s_werks.
    **********ALV Setting starts***************
    *ALV Data Declaration.
    DATA : i_events TYPE slis_t_event,
    i_list_top_of_page TYPE slis_t_listheader,
    g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
    i_layout TYPE slis_layout_alv,
    i_fieldcat TYPE slis_t_fieldcat_alv ,
    gs_print TYPE slis_print_alv,
    wa_fieldcat LIKE LINE OF i_fieldcat.
    DATA: v_repid TYPE sy-repid.
    DATA: gs_variant LIKE disvariant,
    first(01) TYPE c,
    g_save.
    *Initialization for ALV.
    INITIALIZATION.
    v_repid = sy-repid.
    i_layout-detail_popup = 'X'."PERFORM layout_init USING i_layout.
    PERFORM layout_init USING i_layout.
    PERFORM eventtab_build USING i_events[].
    gs_variant-report = v_repid.
    g_save = 'A'.
    *TOP-OF-PAGE, END-OF-PAGE, END-OF-LIST are called
    *dynamically due to PERFORM eventtab_build
    **********ALV Setting Ends***************
    **For Documentation
    INITIALIZATION.
    MOVE text-002 TO sscrfields-functxt_01.
    AT SELECTION-SCREEN.
    **For Documentation
    IF sscrfields-ucomm = 'FC01'.
    CALL FUNCTION 'RS_TOOL_ACCESS'
    EXPORTING
    operation = 'DOCS'
    object_name = 'ZMMR0100'
    object_type = 'PROG'
    EXCEPTIONS
    not_executed = 1
    invalid_object_type = 2
    OTHERS = 3.
    ENDIF.
    START-OF-SELECTION.
    PERFORM mkpf_mseg.
    PERFORM set_for_segregation.
    PERFORM segregation.
    PERFORM cl_stock.
    PERFORM op_stock.
    Added By Essam on 25.02.2008
    PERFORM i_show_alv_populate.
    Addition Ends
    i_show[] = i_show_alv[].
    END-OF-SELECTION.
    **ADDED BY ESSAM FOR ALV ON 23-FEB-2008
    PERFORM SHOW.
    IF p_alv = 'X'.
    PERFORM display_alv.
    ELSE.
    PERFORM display_list.
    ENDIF.
    **ADDITION ENDS FOR ALV
    SET TITLEBAR 'ZT1' WITH s_budat-low s_budat-high.
    PERFORM show.
    SET PF-STATUS 'ZP1'.
    TOP-OF-PAGE.
    PERFORM top_page.
    *AT LINE-SELECTION.
    PERFORM next_screen.
    *& Form mkpf_mseg
    text
    --> p1 text
    <-- p2 text
    FORM mkpf_mseg.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE i_mseg_lean
    FROM mkpf AS mkpf JOIN mseg AS mseg
    ON mkpfmandt = msegmandt AND
    mkpfmblnr = msegmblnr AND
    mkpfmjahr = msegmjahr
    WHERE mseg~matnr IN s_matnr
    AND mseg~werks IN s_werks
    AND mseg~lgort IN s_lgort
    AND mkpf~budat GE s_budat-low.
    AND mkpf~budat IN s_budat.
    *added by ish on 30.6.04
    BELOW CODE CHANGED BY ESSAM ON 19-FEB-2008
    SELECT msegmatnr mkpfbudat mkpfxblnr msegbwart
    msegdmbtr msegshkzg
    msegdmbum msegmenge msegwerks mseglgort
    msegmeins mseginsmk msegaufnr msegkostl mseganln1 msegmblnr
    mseg~zeile
    mseg~kdauf
    INTO CORRESPONDING FIELDS OF TABLE i_mseg_lean
    FROM mkpf AS mkpf JOIN mseg AS mseg
    ON msegmandt = mkpfmandt AND
    msegmblnr = mkpfmblnr AND
    msegmjahr = mkpfmjahr
    WHERE mseg~matnr IN s_matnr
    AND mseg~werks IN s_werks
    AND mseg~lgort IN s_lgort
    AND mkpf~budat IN s_budat.
    IF sy-subrc <> 0.
    ENDIF.
    ****testing for optimization.
    SELECT msegmatnr mkpfbudat mkpfxblnr msegbwart
    msegdmbtr msegshkzg
    msegdmbum msegmenge msegwerks mseglgort
    msegmeins mseginsmk msegaufnr msegkostl mseganln1 msegmblnr
    mseg~zeile
    mseg~kdauf
    INTO CORRESPONDING FIELDS OF TABLE i_mseg_lean
    FROM mkpf AS mkpf JOIN mseg AS mseg
    ON msegmandt = mkpfmandt AND
    msegmblnr = mkpfmblnr AND
    msegmjahr = mkpfmjahr
    WHERE mseg~matnr IN s_matnr
    AND mseg~werks IN s_werks
    AND mseg~lgort IN s_lgort
    AND mkpf~budat IN s_budat.
    IF sy-subrc <> 0.
    ENDIF.
    *adding other materials whose transaction is not made during the
    *selected period
    CLEAR: i_mseg_lean.
    SELECT matnr werks lgort FROM mard INTO CORRESPONDING FIELDS OF
    i_mseg_lean WHERE
    matnr IN s_matnr AND
    werks IN s_werks AND
    lgort IN s_lgort .
    APPEND i_mseg_lean.
    ENDSELECT.
    *addition ends
    SORT i_mseg_lean BY matnr.
    ENDFORM. " mkpf_mseg
    *& Form segregation
    text
    --> p1 text
    <-- p2 text
    FORM segregation.
    CLEAR: wa_stock_in_a_prd,wa_stock_in_a_cstn, wa_stock_in_b_issue,
    wa_stock_in_b_trn,wa_stock_out_a, wa_stock_out_b_issue,
    wa_stock_out_b_trn,wa_stock_in_r, wa_stock_out_r.
    LOOP AT i_mseg_lean_new WHERE matnr NE ''.
    xx
    **As per change log(6)
    IF ( ( i_mseg_lean_new-bwart = '101' OR
    i_mseg_lean_new-bwart = '102' ) AND i_mseg_lean_new-lgort = ''
    AND i_mseg_lean_new-kdauf NE '' ).
    do not take into consideration but display the op&cl stock
    **ends
    ****STOCK IN_A
    ELSEIF ( i_mseg_lean_new-shkzg = 'S' AND i_mseg_lean_new-aufnr CA '-'
    AND i_mseg_lean_new-bwart NE '261' AND
    i_mseg_lean_new-bwart NE '262' )
    OR ( i_mseg_lean_new-bwart = '521' AND i_mseg_lean_new-shkzg = 'S' )
    OR ( i_mseg_lean_new-bwart = '309' AND
    i_mseg_lean_new-xblnr CA '-' AND
    i_mseg_lean_new-shkzg = 'S' )
    OR ( i_mseg_lean_new-bwart = '310' AND
    i_mseg_lean_new-xblnr CA '-' AND
    i_mseg_lean_new-shkzg = 'S' )
    **adeed as per change log(5)
    OR i_mseg_lean_new-bwart = '131' OR i_mseg_lean_new-bwart = '531'.
    **ends
    wa_stock_in_a_prd = wa_stock_in_a_prd + i_mseg_lean_new-menge.
    XY
    ELSEIF
    ( i_mseg_lean_new-shkzg = 'H' AND i_mseg_lean_new-aufnr CA '-'
    AND i_mseg_lean_new-bwart NE '261' AND
    i_mseg_lean_new-bwart NE '262' )
    OR ( i_mseg_lean_new-bwart = '522' AND i_mseg_lean_new-shkzg = 'H' )
    OR ( i_mseg_lean_new-bwart = '309' AND
    i_mseg_lean_new-xblnr CA '-' AND
    i_mseg_lean_new-shkzg = 'H' )
    OR ( i_mseg_lean_new-bwart = '310' AND
    i_mseg_lean_new-xblnr CA '-' AND
    i_mseg_lean_new-shkzg = 'H' )
    **adeed as per change log(5)
    OR i_mseg_lean_new-bwart = '132' OR i_mseg_lean_new-bwart = '532'.
    **ends
    wa_stock_in_a_prd = wa_stock_in_a_prd - i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '261' AND i_mseg_lean_new-aufnr CA '-' ).
    wa_stock_in_a_cstn = wa_stock_in_a_cstn + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '262' AND i_mseg_lean_new-aufnr CA '-' ) .
    wa_stock_in_a_cstn = wa_stock_in_a_cstn - i_mseg_lean_new-menge.
    ****STOCK IN_B
    ELSEIF
    i_mseg_lean_new-bwart = '101' OR
    ( i_mseg_lean_new-bwart = '321' AND i_mseg_lean_new-shkzg = 'S' ).
    IF ( i_mseg_lean_new-bwart EQ '101' AND i_mseg_lean_new-shkzg = 'S' )
    AND ( i_mseg_lean_new-kostl NE ' ' OR
    i_mseg_lean_new-anln1 NE ' ' OR
    ( i_mseg_lean_new-aufnr NA '-' AND
    i_mseg_lean_new-aufnr NE ' ' ) ).
    wa_stock_out_b_issue = wa_stock_out_b_issue + i_mseg_lean_new-menge.
    ENDIF.
    wa_stock_in_b_issue = wa_stock_in_b_issue + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '321' AND i_mseg_lean_new-shkzg = 'H' ) OR
    i_mseg_lean_new-bwart = '102' OR
    i_mseg_lean_new-bwart = '122' OR
    i_mseg_lean_new-bwart = '922'.
    wa_stock_in_b_issue = wa_stock_in_b_issue - i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '309' AND i_mseg_lean_new-shkzg = 'S' ) OR
    ( i_mseg_lean_new-bwart = '311' AND i_mseg_lean_new-shkzg = 'S' ) OR
    ( i_mseg_lean_new-bwart = '301' AND i_mseg_lean_new-shkzg = 'S' ) OR
    i_mseg_lean_new-bwart = '701'.
    wa_stock_in_b_trn = wa_stock_in_b_trn + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '310' AND i_mseg_lean_new-shkzg = 'S' ) OR
    ( i_mseg_lean_new-bwart = '312' AND i_mseg_lean_new-shkzg = 'S' ) OR
    ( i_mseg_lean_new-bwart = '302' AND i_mseg_lean_new-shkzg = 'S' ) OR
    i_mseg_lean_new-bwart = '702'.
    wa_stock_in_b_trn = wa_stock_in_b_trn - i_mseg_lean_new-menge.
    ELSEIF
    ****STOCK OUT_A
    ( i_mseg_lean_new-bwart = '601' AND i_mseg_lean_new-shkzg = 'H' )
    OR ( i_mseg_lean_new-bwart = '654' AND i_mseg_lean_new-shkzg = 'H' )
    *As per change log(7)
    OR ( i_mseg_lean_new-bwart = '251' AND i_mseg_lean_new-shkzg = 'H' ).
    *Ends
    wa_stock_out_a = wa_stock_out_a + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '602' AND i_mseg_lean_new-shkzg = 'S' )
    OR ( i_mseg_lean_new-bwart = '653' AND i_mseg_lean_new-shkzg = 'S' )
    *As per change log(7)
    OR ( i_mseg_lean_new-bwart = '252' AND i_mseg_lean_new-shkzg = 'S' ).
    *Ends
    wa_stock_out_a = wa_stock_out_a - i_mseg_lean_new-menge.
    *****STOCK OUT_B
    ELSEIF
    ( i_mseg_lean_new-bwart = '261' OR
    i_mseg_lean_new-bwart = '241' OR
    i_mseg_lean_new-bwart = '201' ).
    wa_stock_out_b_issue = wa_stock_out_b_issue + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '202' OR
    i_mseg_lean_new-bwart = '242' OR
    i_mseg_lean_new-bwart = '262' ).
    **The following line for subtraction was missed out in the
    **original coding.
    **Added on 16.10.2005 by Firoz.
    wa_stock_out_b_issue = wa_stock_out_b_issue - i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '309' AND i_mseg_lean_new-shkzg = 'H' ) OR
    ( i_mseg_lean_new-bwart = '311' AND i_mseg_lean_new-shkzg = 'H' ) OR
    ( i_mseg_lean_new-bwart = '301' AND i_mseg_lean_new-shkzg = 'H' ).
    wa_stock_out_b_trn = wa_stock_out_b_trn + i_mseg_lean_new-menge.
    ELSEIF
    ( i_mseg_lean_new-bwart = '310' AND i_mseg_lean_new-shkzg = 'H' ) OR
    ( i_mseg_lean_new-bwart = '312' AND i_mseg_lean_new-shkzg = 'H' ) OR
    ( i_mseg_lean_new-bwart = '302' AND i_mseg_lean_new-shkzg = 'H' ).
    wa_stock_out_b_trn = wa_stock_out_b_trn - i_mseg_lean_new-menge.
    ENDIF.
    *****addition Ends
    v_meins = i_mseg_lean_new-meins.
    AT END OF matnr.
    if v_meins is initial.
    SELECT SINGLE meins FROM mara INTO i_show-meins
    WHERE matnr = i_mseg_lean_new-matnr.
    endif.
    i_show-matnr = i_mseg_lean_new-matnr.
    ****ADDED BY ESSAM ON 24-FEB-2008
    v_long_text = i_show-matnr.
    v_objnm = v_long_text.
    v_object = 'MATERIAL'.
    v_objid = 'GRUN'.
    PERFORM read_text TABLES i_tline
    USING v_objnm
    v_objid
    v_object.
    CLEAR: v_long_text.
    PERFORM split_texts TABLES i_tline i_text_tab1.
    DATA : v_lines TYPE sy-tabix,
    v_charno TYPE i.
    DESCRIBE TABLE i_text_tab1 LINES v_lines.
    IF v_lines NE 0.
    DO v_lines TIMES.
    READ TABLE i_text_tab1 INDEX sy-index.
    IF sy-subrc = 0.
    i_tab_text-ltext = i_text_tab1-out_lines.
    v_desc = i_tab_text-ltext.
    ENDIF.
    ENDDO.
    CLEAR:i_tab_text-ltext,i_tline[],v_charno,i_text_tab1[],v_lines.
    ENDIF.
    i_show-maktx = v_desc.
    i_show-stock_in_a_prd = wa_stock_in_a_prd.
    i_show-stock_in_a_cstn = wa_stock_in_a_cstn.
    i_show-stock_in_b_issue = wa_stock_in_b_issue.
    i_show-stock_in_b_trn = wa_stock_in_b_trn.
    i_show-stock_in_r = wa_stock_in_r.
    i_show-stock_toprd = wa_stock_321h - wa_stock_321s.
    i_show-stock_out_a = wa_stock_out_a.
    i_show-stock_out_b_issue = wa_stock_out_b_issue.
    i_show-stock_out_b_trn = wa_stock_out_b_trn.
    i_show-stock_out_r = wa_stock_out_r.
    APPEND i_show.
    CLEAR: wa_stock_in_a_prd,wa_stock_in_a_cstn,
    wa_stock_in_b_issue,wa_stock_in_b_trn,
    wa_stock_out_a,
    wa_stock_out_b_issue, wa_stock_out_b_trn,
    wa_stock_in_r, wa_stock_out_r,
    wa_stock_321s, wa_stock_321h.
    ENDAT.
    ENDLOOP.
    ENDFORM. " segregation
    *& Form set_for_segregation
    text
    --> p1 text
    <-- p2 text
    FORM set_for_segregation.
    *i_mseg_lean_new[] = i_mseg_lean[] .
    LOOP AT i_mseg_lean .
    i_mseg_lean_new-matnr = i_mseg_lean-matnr.
    i_mseg_lean_new-budat = i_mseg_lean-budat.
    i_mseg_lean_new-bwart = i_mseg_lean-bwart.
    i_mseg_lean_new-dmbtr = i_mseg_lean-dmbtr.
    i_mseg_lean_new-shkzg = i_mseg_lean-shkzg.
    i_mseg_lean_new-dmbum = i_mseg_lean-dmbum.
    i_mseg_lean_new-menge = i_mseg_lean-menge.
    i_mseg_lean_new-meins = i_mseg_lean-meins.
    i_mseg_lean_new-insmk = i_mseg_lean-insmk.
    i_mseg_lean_new-aufnr = i_mseg_lean-aufnr.
    i_mseg_lean_new-xblnr = i_mseg_lean-xblnr.
    i_mseg_lean_new-kostl = i_mseg_lean-kostl.
    i_mseg_lean_new-anln1 = i_mseg_lean-anln1.
    i_mseg_lean_new-kdauf = i_mseg_lean-kdauf.
    i_mseg_lean_new-lgort = i_mseg_lean-lgort.
    APPEND i_mseg_lean_new.
    ENDLOOP.
    ENDFORM. " set_for_segregation
    *& Form display_list
    text
    --> p1 text
    <-- p2 text
    FORM display_list.
    DATA: v_count TYPE i,
    v_div TYPE i,
    v_op_stock TYPE mseg-menge,
    v_in_a TYPE mseg-menge,
    v_in_b TYPE mseg-menge,
    v_in_r TYPE mseg-menge,
    v_out_a TYPE mseg-menge,
    v_out_b TYPE mseg-menge,
    v_out_r TYPE mseg-menge,
    v_cl_stock TYPE mseg-menge,
    v_toprd TYPE mseg-menge.
    DATA: v_in_a_prd TYPE mseg-menge,
    v_in_a_cstn TYPE mseg-menge,
    v_in_b_issue TYPE mseg-menge,
    v_in_b_trn TYPE mseg-menge,
    v_out_b_issue TYPE mseg-menge,
    v_out_b_trn TYPE mseg-menge.
    LOOP AT i_show.
    IF NOT i_show-op_stock IS INITIAL OR
    NOT i_show-cl_stock IS INITIAL OR
    NOT i_show-stock_in_a_prd IS INITIAL OR
    NOT i_show-stock_in_a_cstn IS INITIAL OR
    NOT i_show-stock_in_b_issue IS INITIAL OR
    NOT i_show-stock_in_b_trn IS INITIAL OR
    NOT i_show-stock_out_a IS INITIAL OR
    NOT i_show-stock_out_b_issue IS INITIAL OR
    NOT i_show-stock_out_b_trn IS INITIAL.
    v_tot_recs = v_tot_recs + 1.
    ENDIF.
    ENDLOOP.
    IF s_lgort-low IS INITIAL AND s_lgort-high IS INITIAL.
    v_tot_recs = v_tot_recs + 3.
    v_tot_qty = v_tot_recs MOD 51.
    IF v_tot_qty NE '0'.
    CLEAR v_tot_qty.
    v_tot_qty = v_tot_recs / 51.
    v_total_pages = v_tot_qty.
    IF v_total_pages GT v_tot_qty.
    v_total_pages = v_total_pages - 1.
    ENDIF.
    v_total_pages = v_total_pages + 1.
    ELSE.
    CLEAR v_tot_qty.
    v_total_pages = v_tot_recs / 51.
    ENDIF.
    ELSE.
    v_tot_recs = v_tot_recs + 3.
    v_tot_qty = v_tot_recs MOD 50.
    IF v_tot_qty NE '0'.
    CLEAR v_tot_qty.
    v_tot_qty = v_tot_recs / 50.
    v_total_pages = v_tot_qty.
    IF v_total_pages GT v_tot_qty.
    v_total_pages = v_total_pages - 1.
    ENDIF.
    v_total_pages = v_total_pages + 1.
    ELSE.
    CLEAR v_tot_qty.
    v_total_pages = v_tot_recs / 50.
    ENDIF.
    ENDIF.
    LOOP AT i_show.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    WRITE:/ '|'.
    pstl 15 i_show-matnr. HIDE i_show-matnr.
    pstl 1 '|'. pstl 150 i_show-maktx.
    pstl 1 '|'.pstl 5 i_show-meins.
    pstl 1 '|'.pstr 16 i_show-op_stock.
    pstl 1 '|'.pstr 16 i_show-stock_in_a_prd.
    pstl 1 '|'.pstr 16 i_show-stock_in_a_cstn.
    pstl 1 '|'.pstr 16 i_show-stock_in_b_issue.
    pstl 1 '|'.pstr 16 i_show-stock_in_b_trn.
    pstl 1 '|'.pstr 16 i_show-stock_out_a.
    pstl 1 '|'.pstr 16 i_show-stock_out_b_issue.
    pstl 1 '|'.pstr 16 i_show-stock_out_b_trn.
    pstl 1 '|'.pstr 16 i_show-cl_stock.
    pstl 1 '|'.
    v_count = v_count + 1.
    v_op_stock = v_op_stock + i_show-op_stock.
    v_in_a_prd = v_in_a_prd + i_show-stock_in_a_prd.
    v_in_a_cstn = v_in_a_cstn + i_show-stock_in_a_cstn.
    v_in_b_issue = v_in_b_issue + i_show-stock_in_b_issue.
    v_in_b_trn = v_in_b_trn + i_show-stock_in_b_trn.
    v_in_r = v_in_r + i_show-stock_in_r.
    v_toprd = v_toprd + i_show-stock_toprd.
    v_out_a = v_out_a + i_show-stock_out_a.
    v_out_b_issue = v_out_b_issue + i_show-stock_out_b_issue.
    v_out_b_trn = v_out_b_trn + i_show-stock_out_b_trn.
    v_out_r = v_out_r + i_show-stock_out_r.
    v_cl_stock = v_cl_stock + i_show-cl_stock.
    ENDLOOP.
    ULINE AT (351).
    FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
    WRITE:/ '|'.
    pstl 15 'Totals:'. pstl 152 ''.
    pstl 1 '|'.pstl 5 ''.
    pstl 1 '|'.pstr 16 v_op_stock.
    pstl 1 '|'.pstr 16 v_in_a_prd.
    pstl 1 '|'.pstr 16 v_in_a_cstn.
    pstl 1 '|'.pstr 16 v_in_b_issue.
    pstl 1 '|'.pstr 16 v_in_b_trn.
    pstl 1 '|'.pstr 16 v_out_a.
    pstl 1 '|'.pstr 16 v_out_b_issue.
    pstl 1 '|'.pstr 16 v_out_b_trn.
    pstl 1 '|'.pstr 16 v_cl_stock.
    pstl 1 '|'.
    ULINE AT (351).
    FORMAT COLOR OFF.
    ENDFORM. " show
    *& Form cl_stock
    text
    --> p1 text
    <-- p2 text
    FORM cl_stock.
    op (1 a add)
    *selecting the current availabe stock in the system for requested
    materials
    SELECT matnr sum( labst ) sum( insme ) FROM mard INTO TABLE i_mard
    WHERE matnr in s_matnr and
    werks IN s_werks AND
    lgort IN s_lgort group by matnr.
    op (1 z add)
    IF s_budat-high NE '99991231' AND s_budat-high NE s_budat-low.
    *added on 25.01.2004
    IF s_budat-high NE '99991231' AND s_budat-high NE sy-datum.
    PERFORM mkpf_mseg_closing.
    ELSE.
    *added on 08.02.2004
    LOOP AT i_show.
    i_mseg_lean_cl_final-matnr = i_show-matnr.
    APPEND i_mseg_lean_cl_final.
    CLEAR i_mseg_lean_cl_final.
    ENDLOOP.
    *addition ends
    ENDIF.
    CLEAR: wa_cl_stock, v_meins.
    IF NOT i_mseg_lean_cl[] IS INITIAL.

    You should use SE30 or ST05 to find the problem area before posting this.
    Rob

  • Wm physical inventory

    Hi,
    please send a detailed information with T.codes regarding warehouse management manual physical inventory process.
    naveen

    Hi,
    T codes
    LCO1 Set Up Warehouse Co/Material Docs.
    LCO2 Set Up Warehouse Co/Transport Orders
    LL01 Warehouse Activity Monitor
    LS01 Create Warehouse Master Record
    LS01N Create Warehouse Master Record
    LS02 Change Warehouse Master Record
    LS02N Change Warehouse Master Record
    LS03 Display Warehouse Master Record
    LS03N Display Warehouse Master Record
    LS26 Warehouse stocks per material
    MB52 List of Warehouse Stocks on Hand
    OLML IMG structure Warehouse Management
    OMLN Warehouse Control Link
    OMMF Number Ranges per Warehouse
    OMMP Decentralized Warehouse Management
    OMNG Queues Warehouse Management System
    OMNH APPC Interface per Warehouse Number
    OMNI Print Program per Warehouse Number
    OMNJ Link to Warehouse Control Unit
    OMNL Warehouse Number Maint./Inventory
    EC09 Org.Object Copier: Warehouse Number
    FMFG_WAREHOUSE Warehouse Report Transaction
    J1A5 MM Warehouse stock report (Arg.)
    LI20 Clear Inventory Differences WM
    LLVS WM Menu
    LN07 Number Ranges for WM Communic.Rec.
    LP11 WM staging of crate parts
    LP11W WM Staging for Crate Parts (IAC)
    LP12 Staging release order parts (WM-PP)
    LP21 WM replenishment for fixed bins
    LP24 WM Replenishment for Random Whse
    LPIN Info: Material Stock WM-PP
    LPK1 Create Control Cycle for WM
    LPK2 Change Control Cycle for WM
    LPK3 Display Control Cycle for WM
    LS51 Create Batch Search Strategy - WM
    LS52 Change Batch Search Strategie - WM
    LS53 Display Batch Search Strategy - WM
    LX23 Stock comparison IM - WM
    LX26 Inventory in WM via cycle counting
    LX30 Overview of WM messages ext.system
    LX41 Bin Status Report WM/PP Interface
    LX42 Evaluation PP Order from WM View
    LX46 Transmission WM perform. data to HR
    MCL1 WMS: Stck Placemt.+Remov. Selection
    MCL5 WMS: Flow of Quantities Selection
    MCL9 WM: Material Plcmt/Removal:Selection
    MCLD WM: Material Flow - Selection
    MCLH WM: Movement Types - Selection
    OMCR Inventory Sampling: St.Mgmt Lvl: WM
    OMK3 Conditions: field catalog (WM)
    OMK4 CondTable: Create (Batches, WM)
    OMK5 CondTable: Change (Batches, WM)
    MCL1 WMS: Stck Placemt.+Remov. Selection
    MCL5 WMS: Flow of Quantities Selection
    MCL9 WM: Material Plcmt/Removal:Selection
    MCLD WM: Material Flow - Selection
    MCLH WM: Movement Types - Selection
    OMCR Inventory Sampling: St.Mgmt Lvl: WM
    OMK3 Conditions: field catalog (WM)
    OMK4 CondTable: Create (Batches, WM)
    OMK5 CondTable: Change (Batches, WM)
    OMK6 CondTable: Display (Batches, WM)
    OMK7 Batch WM..... (will be deleted)
    OMKR Search Types: Optimize Access WM
    OMKT Strategy Types: Batch Determin.WM
    OMKU Access: Maintain Batch Determin.WM
    OMKV Batch Determination: Proced.for WM
    OMLL WM Movement Type: Clear Invent.Diff.
    OMLR WM Interface to Inventory Management
    OMMC Printer Assignment per WM Mov.Type
    OMMO Consistency Check for MM-WM Tables
    OMMZ Spool Parameters for WM Print Ctrl
    OMN0 Control of Transaction Codes (MM-WM)
    OMNE Control of Transactions in MM-WM
    OMNZ Parameters for Activity in WM
    WM movement types
    711 Inventory differences in unrestricted-use stock (LE-WM)
    This movement is generated automatically when you post inventory differences in the Warehouse Management System.
    Possible special stock indicators:
    E, K, M, Q
    713 Inventory differences in quality inspection stock (LE-WM)
    This movement is generated automatically when you post inventory differences in the Warehouse Management System.
    Possible special stock indicators:
    E, K, M, Q
    715 Inventory differences in blocked stock returns (LE-WM)
    This movement is generated automatically when you post inventory differences in the Warehouse Management System.
    Possible special stock indicators:
    None
    717 Inventory differences in blocked stock (LE-WM)
    This movement is generated automatically when you post inventory differences in the Warehouse Management System.
    Possible special stock indicators:
    E, K, M, Q
    319 Split structured material into components (Retail)
    You can enter the splitting of a structured material manually using movement type 319.
    You can configure Customizing so that a structured material (for example, asset, prepack, or display is automatically split into its components at goods receipt. The system posts the split using movement type 319. In this process, the BOM header material is posted and each of the component stocks are increased. You can also use this function if you use the Warehouse Management System (LE-WM).
    Possible special stock indicators:
    None
    Example:
    A box of the structured material S contains 3 pieces of the component K1 and 4 pieces of the component K2. The following material document items result after the material is split at goods receipt:
    Qty Unit Material Movement type
    1 box S 101 +
    1 box S 319 -
    4 piece K1 319 +
    5 piece K2 319 +
    Assign Points Lft hand side

  • Excess inventory issue in Deployment

    Hello Everyone,
    We are currently implementing Deployment optimizer for our client and we are now stuck up with a Excess inventory issue.
    The issue is Deployment Optimizer is deploying the Deployment Purch Reqs in proportional to the demand when we have ATD stock less than the Demand at the DC's, but when we have excess inventory as ATD stock its not following the Demand proportions of the DC's.
    Has anyone ever faced this issue in the past, If so then please let me know how did you resolve the issue.
    We are currently using SCM 5.0 version and ECC 6.0.
    Best Regards,
    Chandrakanth Tatavarthi
    Consultant-Supply Chain Planning,
    Member-SCN Focus group,
    Hotline:+ 917-475-5664,
    Mobile:+91 9959816699.

    Hi Chandrakanth,
    For surplus ATD stocks than the demands situation, we have 3 possible rules to be set in the SNP deployment profile, which system considers in deployment optimizer run. We define costs and constraints inside the SNP deployment optimization profile and the SNP cost profile.
    1.   Distribution Based on Lowest Costs
    2. Push Distribution by Demand
    3.  Earliest Delivery
    Please check if these setting are maintained appropriately.
    The objective of the deployment optimizer is to determine distribution plan with overall  lowest costs.  In your situation, we can conclude that, system keeps excess inventories instead of deploying the same, because it finds  overall costs lower, in keeping rather than deploying.
    The deployment optimizer considers the following costs defined in the supply chain model:
    u2022        Storage and transportation costs
    u2022        Costs for increasing storage, transportation and handling capacity
    u2022        Safety stock penalty
    u2022        Late delivery penalty
    u2022        Non-delivery penalty
    Please review these costs. For example if you increase the storage costs, then, system will
    Deploy more ( as keeping stocks will cost more).
      I do not know  your SCM 5.0 system current Service pack
    If it lower than SP 15, then please check if the note 1266418( Deployment Optimizer : Incorrect fair share results) is applicable.
    In summary , you will have to check the SNP deployment optimization profile and the SNP cost profile settings. With the given costs, try to interpret the deployment results.
    I hope this helps you.
    Regards
    Datta
    Edited by: Datta  Kadam on Apr 7, 2010 7:19 PM

Maybe you are looking for

  • Oracle Validated RPM - Which to download?

    I'm preparing a couple Linux x86_64 servers for building a RAC cluster and thought I'd give the Oracle Validated RPM a try. The specifics - Red Hat Linux RHEL 5.5 (kernel level 2.6.18-194) Oracle Grid Infrastructure release 11.2.0.2.2 Oracle Database

  • Voiceover with PDF files

    Has anyone yet figured out a way to get Voiceover to read PDF files properly? When I open a PDF in preview, it starts reading, but as soon as I use any of the detailed reading commands -- read all, read a sentence etc -- VoiceOver starts chopping off

  • Avoiding 100% CPU Usage

    Hi, I don't know too much about concurrency but I thought I had the general idea (obviously not) so I would appreciate it if someone could point me in the right direction here. I have a program with a class called Client, which has a Queue of Events

  • IDoc acknowledgement again :)

    Hi Expers i am realy strugling with IDOC acknowledgement!! i am following the Howtodo doc https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/903a0abc-e56e-2910-51a8-9dc616df56eb.. According to this document page no 3(scenario 2. Exte

  • How to use "keytool" generated certificates in B2B

    Hi, I have generated few certificate stores(files containing private key and trust certificate) in ".jks" format and exported client certificate from them in ".der" format using "keytool" commands in java. Now I want to use them for SSL authenticatio