Inactive materials tables

Hi,
i need to find out the materials that has no movement for a long time, time determined by user,
and i went to the mkpf-mseg tables.
However i have to select the data based on the bwart field's values.
For example if mseg~bwart is not eq to '261' 262,601,602,201,202,543,544 etc then it is an inactive material for us.
But my query is not working:
select mseg~matnr mseg~werks mseg~bwart from mseg
      inner join mkpf on mseg~mblnr eq mkpf~mblnr
      and mseg~mjahr eq mkpf~mjahr
      into corresponding fields of table itab
      for all entries in mat
where
      mkpf~budat le so_budat and
      mseg~matnr eq mat-matnr
      and mseg~bwart ne '261'
      and mseg~bwart ne '262'
      and mseg~bwart ne '601'
      and mseg~bwart ne '602'
      and mseg~bwart ne '201'
      and mseg~bwart ne '202'
      and mseg~bwart ne '543'
      and mseg~bwart ne '544'  .

Hello.
You need to do something like that:
REPORT  zdave_inactive_materials.
TYPE-POOLS: slis.
DATA: BEGIN OF tg_mkpf_mseg OCCURS 0,
                 bwart  LIKE mseg-bwart,
                matnr  LIKE mseg-matnr,
                werks  LIKE mseg-werks,
                budat  LIKE mkpf-budat,
           END OF tg_mkpf_mseg,
          rg_bwart    TYPE RANGE OF bwart,
         sg_bwart   LIKE LINE  OF rg_bwart,
         tg_fcat        TYPE slis_t_fieldcat_alv,
         vg_repid    TYPE sy-repid.
START-OF-SELECTION.
***Here I create a list with all movements will be excluded
  sg_bwart-sign   = 'E'. "Means exclude
  sg_bwart-option = 'EQ'.
  sg_bwart-low    = '601'.
  APPEND sg_bwart TO rg_bwart.
  CLEAR sg_bwart.
  sg_bwart-sign   = 'E'.
  sg_bwart-option = 'EQ'.
  sg_bwart-low    = '602'.
  APPEND sg_bwart TO rg_bwart.
***I created a view zmkpf_mseg but is the same if you use a INNER JOIN
  SELECT * INTO TABLE tg_mkpf_mseg
    FROM zmkpf_mseg
   WHERE bwart IN rg_bwart
     AND budat LE sy-datum.
***From this line on it is only for ilustrative purposes
  IF sy-subrc EQ 0.
    DELETE tg_mkpf_mseg WHERE matnr IS INITIAL.
    vg_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = vg_repid
        i_internal_tabname     = 'TG_MKPF_MSEG'
        i_inclname             = vg_repid
      CHANGING
        ct_fieldcat            = tg_fcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    IF sy-subrc <> 0.
      WRITE: / 'Error:',sy-subrc,
      'When Create Field Catalog'.
      EXIT.
    ENDIF.
Call ALV List Display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = vg_repid
        it_fieldcat        = tg_fcat
      TABLES
        t_outtab           = tg_mkpf_mseg
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
      WRITE: / 'Error:',sy-subrc,
      'When Call ALV List Display'.
      EXIT.
    ENDIF.
  ENDIF.
END-OF-SELECTION.
By the other hand, I highly recommend don't use "FOR ALL ENTRIES" because it cause poor performance. Is better if you have a internal table with the data structure that you want store

Similar Messages

  • Required to know the fields which can be filter inactive materials.

    Dear experts,
    I am loading data for  0Material  from the R/3 system.
    As per customer requirement I need to filter inactive Materials while loading the data.
    Do you know any field or flag to filter the inactive Materials  in the Data source fields?
    Thanks in advance.

    Hi Kavitha,
    "Inactive Materials"  means those materials, marked for deletion ?
    if yes then there is a field in MARA table MARA-LVORM.
    you can use start routine in transformation to delete material where MARA-LVORM = 'D', while data loading.
    Check your data source (0MATERIAL_ATTR) in RSA6, if LVORM is hidden then unhide.
    Hope this will halp to solve your problem.
    Regards,
    Kiran

  • How to delete/destroy an inactive transparent table ?

    Hello everybody,
    I would like to destroy (data + structure) the inactive ZT100 table on my system. First of all, I wanted to use the SE14 transaction but I can't since the action buttons are grayed (as shown on this screen shot : http://img384.imageshack.us/img384/7805/se14screenshotzt1000td.jpg).
    Does anybody has a clue to help me achieve the deletion of that table?
    Thanks a lot,
    Daniel

    Thanks for your answer but unfortunately this doesn't seem to solve the problem.
    - When I try to enter the change mode in SE11 (Database table : ZT100 + Change button), the message "ZT100 does not exist. Check name" is displayed.
    - When I enter ZT100 in SE11 and follow the Utilities/Database utility option, the "ABAP Dictionary: Database utility" screen is displayed but only with the "Edit" button.
    FYI, the table is already empty.
    Message was edited by: Daniel

  • How to make few columns of single record inactive in Table conrol?

    Hi all,
    Scenario is like this : i have one table control , it is displaying 10 records , in that first four columns are editable. Now my requirement is, whenever record having intial values( suppose one record having initial values among ten) except key field , we need to deactive that particular  record , now table control  should contain ten records , but nine records are in editable state and one record in non editable state .
    How to make few columns of single record inactive in Table conrol?
    Thanks in advance.

    hi there...
    select the column that u want to convert to non editable mode in the screen layout. then double click on it. go to the attributes tab and uncheck the input chk box. the check box will become disabled for input. u can do this for any number of columns.
    if u want to do it dyanamically, loop at screen. check for the screen element's name. when itmatches the column u want to disable, simply set the input value as 0.
    dont forget to modify sscreen after setting the attribute values.
    i hope this helps.
    do reward if helpful.

  • The project contains inactive include tables during activating the project

    Hi experts,
    I created the project in cmod using enhancement MM06E005. After created i got the issue The project contains inactive include tables CI_EKKODB  & CI_EKPODB during activating the project. I want to move my project to production. please guide me to solve this issue...

    Hi,
    You need to activate the structures CI_EKKODB & CI_EkpoDb. After this, you need to activate the standard table EKKO & EKPO.
    Then, you need to adjust the tables in SE14.
    Regards
    Senthil

  • MF50 for inactive materials

    Hi,
    Because I have a lot of materials with inactive status, and the productions engineers didn't change the BOM's, at the running of MF50, I have a lot of information messages concerning these materials and I spend a lot of time to accept each mesage.
    I tried to set materialul status in OMS4 but the messages still appear.
    It is possible to make other settings so the messages don't appear when I use MF50?
    Many thanks for your help!
    Regards,
    Marian

    Hi,
    If you don't want the inactive materials in MF50 list, then set the MRP type for all the materials as ND, then in the MF50screen  under MRP controller field click detailed view and in the restrictions enter the MRP type ND, so the materials with ND will not appear in the MF50 screen.
    thanks,
    JK

  • Inactive Dimension Tables for Cube

    Hi Gurus ,
               I am transporting a cube from one system to another and the transport fails becasue the dimension tables are in active in the target system. Now since this system is read only I cannot manually activate it , last resort I even trioed opening the system and activating it and re transported the transport. I get the same error saying that table /BIC/ZXXXXX is inactive.
    Can anyone help....please....

    hi Sanjeev,
    did you change any dimensions in dev ?
    like delete some characteristics from existing dimension,
    or add new characteristic or move from one to another
    dimension ?
    if so, you may need to delete production data first,
    to avoid this, please change back characteristics to previous dimension, and create a new dimension and add new characteristic to the new create dimension.
    another possibility is database problem, try to search oss note for infocube dimension inactive.
    hope this helps.

  • Where is the Bill of Materials table?

    Which table is the Bill of Materials?  I found this page that lists the SAP B1 tables:
    http://wiki.sdn.sap.com/wiki/display/B1/SAPBusinessOne+Tables
    But Bill of Materials isn't mentioned.  Which table is it?
    Thanks!

    Hi,
    The BOM tables are
    ProductTrees_Lines Product tree - child ITT1
    ProductTrees Product tree OITT
    Regards,
    Rakesh N

  • How to avoid material master data migration of inactive materials to SRM

    We are replicating material master from R3 4.6b to SRM 5.0 system.  Under COMMPR01 , we can see the product status as deleted or locked .
    How we can avoid the master data replication of  materials which are already flagged as inactive (deletion) in R3.
    Pls suggest.
    Regards,
    Avinash

    Hi
    Please try this ->
    1) It is possible to use product_id without needing to replicate material masters from R/3 to SRM. For this to work you have to set the flag "Do not check product" in customizing
    (see SRM Server > Master Data > Define External Web Services).
    We do it like that and it works perfect for us. Only annoyance is, that we have to put leading zeroes in the product_id field.
    "Do not check product" is used to avoid product check in SRM (to avoid replicating products into SRM), so they are not checked against SRM product master.
    But this is not related to R/3 check.
    In a classic or extended classic scenario, SRM will check that this material exists in the backend, especially for the current plant (location), before creating follow on doc.
    As you created your catalog item without zeros, I guess SRM is sending this material to R/3 that does not recognize it.
    Then you have this error message. Adapt your product IDs to be aligned with R/3 material master.
    2) Try to run the report BBP_PRODUCT_SETTINGS_MW, there you select user as SRM instead of CRM and select service product active
    3) Did you already checked OSS note 722600 and 366135 ? Also, Check the SAP OSS Notes -  786345, OSS Note 456753. It talks abt the internal and external representation of product ID in catalog and R3 system.
    Related useful pointers ->
    Product xx does not exist in plant xx or it has been flagged for deletion
    Stock reservation movement (field XWAOK) is not flagged in ECC ??
    Product XXX  does not exist in plant YYY or it has been flagged for delete.
    material deletion flag
    Product XXX does not exist in plant YYY or it has been flagged for deletion
    Hope this will help. Do let me know.
    Regards
    - Atul

  • Inactive Insert table button

    Hiya! My Insert table button is greyed out & unusable. My
    cursor is in the code view underneath the first <body> tag.
    The Table option is also greyed out in the Insert menu. Does anyone
    have any ideas as to what the problem is? Anybody? (wah)
    janet

    Problem solved! Saw a past post. I needed to be in Standard
    view under view menu while cursor was in design screen.
    Cheers
    janet

  • TDMS transfers Materials, but MARC table is empty

    After creating an empty shell using cleint copy, we are trying to copy Materials from one client to another using TDMS. Interestingly, it succeeds in copying all the Materials Tables like MARA,MAKT,MARD etc but the Plant level table MARC is empty even though there are several thousand records that need to be copied over.
    We repeated the experiment twice and we get the same results.
    Also interestingly, other lower Plant level data like Batches, Variants are copied over successfully. This is surpising as the Plant Level table MARC is empty and my expectations are that  the dependent next  plant level tables should be empty.
    Did anyone run into this problem before? If so what was the solution?
    Thanks in advance.
    Vikram Reddy

    Hi,
    If you are using a TDMDC package - Master data and customizing , then the table MARC table will not be transferred. However, IF you want to transfer this via TDMDC package then you have to run the activity 'Maintain classification
    manually' and select the table for transfers.

  • How can I retrieve data from one table to another automatic in SQL?

    Hi, everione,
    I am having a big problem, trying to create datebase.
    I have 3 tables: SUPERAVATAR, MASTERAVATAR, MEGAAVATAR.
    - SuperAvatars are heroes in an online role playing gaming. They have an ID, ‘superavatarID’ which contain an UNIQUE NUMBER NOT NULL PRIMARY KEY to identify them.
    A wisdom – ‘trickster’,’conjuror’,’magician’, etc..
    A current owner… who is the user or player of the game and has that Super Avatar– we associate the link to USERID to know the person.
    SuperAvatars can be fathers or mothers of Mega Avatars.
    -MegaAvatars are the children of SuperAvatars…. They also have an ID UNIQUE NUMBER NOT NULL PRIMARY KEY to indentify them.
    A magic power – it can be a ‘Leader’ or ‘Sheep’…
    A ‘parent’ – parent is the number identifying to know to who Super Avatar belongs.
    e.g.
    SUPERAVAT WISD CURRENTOWNER FATHEROF MOTHEROF
    1 Thick 3 1
    2 Mentally Ch. 11 3
    3 Smart 9 2
    4 Genius 16 4
    5 Thick 19
    MEGAAVATARID MAGICPOWER PARENT
    1 MAGICIAN 1
    2 WIZARD 3
    3 SORCERER 2
    4 MAGICIAN 4
    -We see that MEGAAVATAR 1 has a magic power as Magician and his father is ‘1’. ‘1’ identifies the SUPERAVATAR.
    We see SUPERAVATARID…. who has the number ‘1’? the first in the row… who has wisdom – thick and he belongs to the USER with ID number 3.
    -We see MEGAAVATARID… we choose the number 2…. His magic power is as WIZARD… and his father is the number 3.
    We see SUPERAVATARID now… we look up the SuperavatarID 3…. We can see he has a wisdom – GENIUS… who belongs to the USERID 16 and he is father of MEGAAVATAR number 2.
    The list can carry on and never stop.
    I have this Problems:
    We create in this example 3 tables: Users, SuperAvatar, MegaAvatar
    SQL
    CREATE TABLE users(userID NUMBER CONSTRAINT pk_user PRIMARY KEY,email VARCHAR2(50) NOT NULL UNIQUE,password VARCHAR2(15) NOT NULL UNIQUE,subscription CHAR(8) NOT NULL CHECK (subscription IN('ACTIVE' , 'INACTIVE' ) ) );
    CREATE TABLE superavatar(superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')), currentOwner NUMBER NOT NULL, fatherOf NUMBER,motherOf NUMBER);
    CREATE TABLE megaavatar (megaavatarID NUMBER CONSTRAINT pk_megaavatar PRIMARY KEY, magicPower VARCHAR2(12) NOT NULL CHECK (magicPower IN('TRICKSTER','CONJUROR','MAGICIAN','WIZARD','SORCERER')), parent NUMBER);
    Now, the 3 tables are created…..
    What happen when we try to insert values to this table?
    In this case we insert to User Table some examples:
    INSERT INTO users VALUES('3','[email protected]','great78','ACTIVE');
    INSERT INTO users VALUES('9','[email protected]','chrisandra)','ACTIVE');
    Now, we insert to SuperAvatar some examples;
    INSERT INTO superavatar VALUES('1','THICK','3','1','');
    INSERT INTO superavatar VALUES('3','SMART','9','3','');
    |
    |
    ‘9’ is the UserID that we already insert to the User table
    What’s the problem?
    We have to insert manually the data from USERID to CURRENTOWNER as we didn’t match or link CURRENTOWNER from SUPERAVATAR Table to USERID from USER Table with a SQL CODE.
    What happen if we have thousands of USERS that they register to this game…? We will never know to how belongs that SUPERAVATAR but if someone do it manually can spend a year.
    I am trying to fix this problem …. I add in SUPERAVATAR TABLE ‘CHECK’ in currentOwner..
    SQL> CREATE TABLE superavatar
    (superavatarID NUMBER CONSTRAINT pk_superavatar PRIMARY KEY, wisdom VARCHAR2(19) NOT NULL CHECK (wisdom IN ('THICK', 'MENTALLY CHALLENGED', 'AWAKE', 'SMART', 'GENIUS')),
    currentOwner NUMBER NOT NULL CHECK (currentOwner IN(SELECT userID FROM users)),
    fatherOf NUMBER,
    motherOf NUMBER);
    ERROR:
    ORA-02251: subquery not allowed here
    It doesn’t work.
    Please HELP, I have exam tomorrow
    thank you
    Desy

    Hallo,
    you can use trigger on table USER and fill the userid in AVATAR.currentowner,
    but i don't understand, how you join these tables ?
    Which user id must come in which column currentowner ?
    Design problem ?
    Regards
    Dmytro

  • How do you select data from tables not in the Properties table list?

    Hi I am new to SAP B1.
    I am amending the production order and wish to add fields from the Bill of Materials table Itt1.  However this table is not in the list of tables for this report.
    1. Do I have to redo the whole report in Crystal or is there a way of using the PLD report?
    2. This table join needs to have 2 fields in the join the father and the child item codes.  How many joins can the PLD report look after?  I assume that Relate to is the first join and next segment is a second join.  Am I right or not as I have been unable to find any reasonable documentation on creating and maintaining PLD reports.
    3. Where can I find information if any on System Variables and what data they represent?
    Thanks
    Chris

    Hi Cris,
    welcome to Sdn forum!
    For question 1, i think you can do this using pld.
    For question 2, to be able to view other tables, you will need to hold the ALT button and press the database table(Properties section on the lower right portion of the PLD screen), you can now view other tables. then to join other tables you will need to RELATE to and Next Segment, you can also find this under Properties and go to Content Tab.
    for question 3, you will need to create a query that will lead you to the exact field name, say for example SELECT Price from POR1, this price is actually variable 81 from purchase order line and the equivalent value is the por1.price..
    Regards,
    Darius Gragasin

  • Update system status in JEST table

    Hi Experts,
    I need to update the system status TECO as inactive in table JEST based on some condition from program manually. It might not be suggested to directly modify the database table. I got one BAPI function module BAPI_ALM_ORDER_MAINTAIN, but could not find how to use it.
    Can you please let me know whether there are any BADIs or BAPIs to update the system status in JEST table.
    Thanks in advance for you help.
    regards,
    Lakshmi.

    Hi ,,
    Thank you for your suggestion. but I got a FM which exactly updates the system status in JEST and JCDS tables.
    The function module STATUS_CHANGE_INTERN and can be used as follows. We always need to follow one condition that, when the system status TECO is changing to inactive the REL status should be made Active.
        DATA: i_stat TYPE STANDARD TABLE OF jstat.
        DATA: wa_stat TYPE jstat.
        wa_stat-stat = 'I0045'.
        wa_stat-inact = 'X'.
        APPEND wa_stat TO i_stat.
        wa_stat-stat = 'I0002'.
        wa_stat-inact = ' '.
        APPEND wa_stat TO i_stat.
        CALL FUNCTION 'STATUS_CHANGE_INTERN'
          EXPORTING
            client              = sy-mandt
            objnr               = lv_objnr
          TABLES
            status              = i_stat
          EXCEPTIONS
            object_not_found    = 1
            status_inconsistent = 2
            status_not_allowed  = 3
            OTHERS              = 4.
    COMMIT WORK.

  • How to Export Materials from ERP to MDM 7.1 via MDMGX?

    Hello MDM-Experts,
    as described in the Scenario Configuration Guide for MDM 7.1, we want to initialize our MDM repository with reference data (material) using XML-Files. Therefore, we have imported the fiel "71110_MATERIAL.a2a" in our repository. Now we want to fill it with the materials from out ERP-System without using PI/Xi.
    We tested the transaction MDMGX in our ERP-System and are able to extract products and articles, but not materials (table mara). We also checked the document "How to configure MDM Reference Data Extraction", but found no solution for material. Could anyoune help?
    Thanks & best regards
    Matthias

    Hi Matthias,
    we recommend using PI as we have some XSLT mappings running on PI that you cannot use (easily) w/o PI. Additionally PI takes care of the correct routing from ERP to MDM.
    Nevertheless a possible (but not recommended) way w/o PI would be via ALE and XML files. You can configure an ALE port in a way that it creates an XML file using the IDoc structure (see [SAP Help|http://help.sap.com/saphelp_erp60_sp/helpdata/EN/3f/faa288bb7911d2897f0000e8216438/content.htm]. ALE then places the file in the file directory of the application server instead of sending it via the IDoc Adapter to PI.
    Best regards
    Michael

Maybe you are looking for

  • Display multiple desktops on one monitor

    I have a 32 inch Hannspree HDTV connected to my Mac Mini via HDMI. I would like to create four quadrants on my screen and display a different desktop in each quadrant. I know how to create the multiple desktops in mission control, what I don't know i

  • The version of this vi downloaded on the target does not match the version you have in the project

    I am using Labview 8.6 and field point cFP-2220 I have a project that have some VIs running on the development computer and some VIs running on the field point (one top level VI and a few sub Vis). When I run the program every thing is working, I dis

  • Migration from of database and app from SQL server 2005 to Oracle 10g

    Hello Every body, Lately, I have been requested to migrate one inhouse developed hub application from SQL server 2005 to Oracle 10g. The objective is to move application and also the database to Oracel 10g. Here is the current platform: OS Win 2008 6

  • Problem with OSS note 1529649 - Factory calendar expires 2010

    Hi Experts, I found a OSS note that is telling that calendar validity ends in 2010. For the moment in my system factory calendar for all my sites is valid till 2020. My question is that doesn't matter what date i have now in the system the validity w

  • Issues with Numbers Download

    App Support my numbers was acting up so I wen to take it off then reinstall it now it wont download at all I will say that I was working for apple when I purchased it so I used a redemption code so MAC support couldn't do anything to help