Requirement to select material and plant ?

Hi,
i have below requirement .
I have selection screen ..in which material number as selections option and plant as parameters.
when ever user executes report i have store the material , plant , stlal(this field is in MAST table ) which are in selection screen in to one  internal table based on following conditions.
stlan = 1 (BOM usage - in table MAST)
mtart = AA or UT (In Mara table)
stlal which is having minimum value.
I think i have to use inner join on these tables ...
please give me sample code ..please help...
thanks
satish

Check the sample program :
REPORT  ZTEST_AMEM1.
tables : lfa1.
data : begin of i_lfa1 occurs 0 ,
       lifnr like lfa1-lifnr,
       name1 like lfa1-name1,
       land1 like lfa1-land1,
       end of i_lfa1.
start-of-selection.
select lifnr
       name1
       land1 from lfa1
       into table i_lfa1 up to 100 rows.
Export
export i_lfa1 to memory id 'SAP'.
submit ztest_amem2 and return.
write:/ 'hello'.
*& Report  ZTEST_AMEM2
REPORT  ZTEST_AMEM2.
data : begin of j_lfa1 occurs 0,
       lifnr like lfa1-lifnr,
       name1 like lfa1-name1,
       land1 like lfa1-land1,
       end of j_lfa1.
start-of-selection.
import i_lfa1 to j_lfa1 from memory id 'SAP'.
loop at j_lfa1.
write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.
endloop.
Use submit command ,please press f1 on submit ,you get good documentation.
Thanks
Seshu

Similar Messages

  • User Exit to check whether chapter id for Material and Plant combination is maintained while creating sales order

    Hello all,
    my requirement is, system should give error message while creating sales order, if chapter ID is not maintained for a material and plant combination.
    please suggest the user exit.

    Hi
    CASE 1 : All Plants are excisable.
    In Material master , Foreign Trade data tab-  mentioned Control code field mandatory. ( i.e nothing but Chapter ID)
    CASE 2 : Few Plants are excisable
    In the Case 2 you need to go for Enhancement
    Program Name : MV45AFZB 
    User Exit:            USEREXIT_CHECK_VBAP ( Item Level Check )
    By using above user exit you write a logic with the help of ABAPer
    Plant and Chapter ID combination table : J_1IMTCHID

  • Need help on enhancement of 0CO_OM_OPA_1 with Material and Plant

    Hi,
    I have a requirement that need to build a BW report which shows Actual costs and Planned Costs of Service Orders. We are getting Actual costs from 0CO_OM_OPA_6 and now i am getting planned costs from 0CO_OM_OPA_1. For actual costs we are getting Service Orders, Material and plant from Satandard DS 0CO_OM_OPA_6. Where as For Planned Costs standard data source 0CO_OM_OPA_1 is not having Material and Plant information. For this we decided to enhance 0CO_OM_OPA_1 with Material and Plant.
    But we are not sure the source tables for material and plant and the logic to extract these data from the tables. Can anybody please help me out.
    Thanks for your supprt in advance.

    It's possible you may need to use a CO-PA (profitability analysis) datasource instead of 0CO_OM_OPA_6.  0CO_OM_OPA_6 extracts data from CO tables. 
    Based on the path you provided "...Profit. segment...", the requested data might exist with CO-PA.
    If you determine the required data resides in CO-PA, you'll have to create a datasource based on the operating concern.  You can perform a search within the online docs for steps to create this datasource.
    Hope this helps.
    Rod

  • Transaction code to display exception messages by material and plant

    Hi,
    Is there a transaction code or standard report in SAP  to display exception messages by material and plant? I see the exception messages by individual material and plant in MD04 but I need to see a collective view. I tried Collective access in MD04 and MD46 but they are not giving me exception groups but I need exceptions listed out by material and plant.
    Thanks.

    Visu,
    I have never seen such a report.
    MD06 does support fine tuning the output display, once the list has been generated.  If you use this feature, the resulting display is the entire list as created by selecting the initial parameters (such as exception group), but with the specific items that contain your selected message highlighted.  If you are addressing the messages interactively, you can select the review (glasses)  screens, and scroll through just the ones which contain your  selected exception message(s).
    To try this, execute MD06.  Select the groups as necessary.  Execute.  Wait for the list.  Now, immediately, select 'search' (binoculars).  Experiment with the output.
    As mentioned in the previous post, if MD06 does not meet your needs, you will need to have a custom report written.
    Rgds,
    DB49

  • Plannning Material and Plant for MRP Run

    Hi,
    If I have a material (01) extended on 2 plants, on one plant (A) we have production and planning/MRP + stock and on the other one (B), just stocking and transfer. B's requirements are to be entered and planned at A. I also want stock at B to be considered with stock at A when MRP runs at A. In the material master, I have some settings. I want to know if these would be any good:
    Material 01 on Plant A:
    MRP PD
    Strategy 40
    Lot size EX
    Coverage profile applied
    Material 01 on Plant B:
    MRP ND/PD tried both
    Strategy 40
    Lot size EX
    Coverage profile applied (same)
    Planning material: Material 01 itself
    Planning plant: Plant A
    I particularly want to know about points 5 and 6. Will they make any difference if I run MRP on scope of planning(all plants) or just plant A? Will stock at B be considered? What difference does that setting make in my case? Please help!
    Thanks!

    No sales on Plant A. Only transfers and STO's. Stock is STO'd to Plant B (and other Plants, as well)
    Plant B sells the stock.
    Yes, I want to load the forecast in Plant A (COPA to SOP to DM to MRP). What do I do in this case?
    I tried another case, as well. In that I put a special procurement on the material in Plant B view and marked it as external procurement. (the planning material and plant were there, didn't remove)
    Then I entered the forecast in both plants separately (PIRs for both Plants) The requirements from Plant B made STPO Planned orders in Plant B and STCK Planned orders in Plant A. I am using coverage profiles (period is month, standard length 25 days, target 10 days for 1st period for 2 months, target 10 days for 2nd period  for 1 month, target 10 days for the rest of the horizon) Not using any consumption modes.
    The results I am getting don't make sense to me. I have attached screen shots for both plants MD04 and the MRP + work scheduling views

  • Characteristics values for material and plant

    Hi Experts,
    I need to fetch characterstic values from a class Y-xx . I belive badi BAPI_CLASS_GET_characteristics
    will give the result but my problem is in selection screen I am passing material no and plant
    for this material and plant i need to fetch the characteristics values from the Y_xx class
    Could any one suggest the BADI or FM or tables to fetch the results
    Thanks in advance

    Hi,
    Go to MEK2, here enter the freight condition type, go to the output screen as pr the access maintained and select the line item and click on "Scales" button to see the from and to value.
    Also you can check the same in "Conditions" button in Purchase Info record.

  • Outbound delivery allows only the unrestricted stock for particular material and plant

    Hi,
    In STO I have an problem the outbound delivery creations allows all stocks under unrestricted, Quality inspection, Block stock.
    I want the outbound delivery creation of a particular material and  plant it allows only the stock under the unrestricted only. It doesn't allows the stocks under the Quality inspection and Block stocks.
    I need to know how to configure this or how to solve my requirements.
    Regards,
    Ramesh N

    Dear Mohammed ,
    as per your scenario , there is two movement type has to trigger in the Delivery level according to the plant and material combination .
    as per my knowledge it will not configurable in standard process . this will possible with user exit logic only .
    follow the below logic to achieve your issue .
    you have to create two item categories and two schedule lines with (655 &653) , that means your movement type has to trigger at sales order level only . write a logic in the user exit - MV45AFZZ -USEREXIT_MOVE_FIELD_TO_VBAP , if this combination matches then automatically item category has to over write other wise it will copy the existing item category .at delivery level you can see two movement types in item level.
    wait for other experts solution , if any standard is possible or not  .
    Regards,
    C.B Reddy.

  • How to get material and plant by providing control key as input ?

    How to get the material and plant info based on control key values using a function module?
    kindly help..

    Hi,
    Check the FM
    K_VALID_PLANTS_OF_MATERIAL.
    Sandeep Kaushik

  • FM / BAPI to update STEUC field in marc Table basing on material and plant

    Hi,
    I need to to update STEUC field in marc Table basing on material and plant. please suggest FM / BAPI.
    Thanks.
    raviraj.

    Hi
    Try this BAPI function module:
    " BAPI_MATERIAL_MAINTAINDATA_RT "
    Data: LS_HEADDATA TYPE BAPIE1MATHEAD,
             LS_RETURN TYPE BAPIRETURN1,
              LT_PLANT TYPE TABLE OF BAPIE1MARCRT,          LS_PLANT TYPE BAPIE1MARCRT,
              LS_PLANTX TYPE BAPIE1MARCRTX,          LT_PLANTX TYPE TABLE OF BAPIE1MARCRTX.
            CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
                   EXPORTING
                       HEADDATA   = LS_HEADDATA
                   IMPORTING
                       RETURN     = LS_RETURN
                   TABLES
                       PLANTDATA  = LT_PLANT
                       PLANTDATAX = LT_PLANTX.
    Check the PLANTDATA in the above fm in which pass your ''STEUC'' to BAPIE1MARCRT-CTRL_CODE......
    Hope this works.....

  • Any ideas why placing Material and Plant in same DIMENSION is a bad idea?

    Hi,
    I place Material and Plant in the same dimension and a colleague argued that it is a bad combination in the same dimension although he did not explain.
    Can you provide some examples to explain to me why  this is a good or bad combination?
    What are the rules in making decisions on which characteristics go into the same dimension?
    Thanks

    1.
    m:n relation
    If I place a Material and Plant in a dimension, let's say 5 plants and 1000 materials, then there will be 5 x 1000 = 5000 material-plant combinations.
    1. Is this 5000 material-plant combination taking place in the Dimension or in the cube?
    In the dimension table.
    Remember we are trying to see that the size of the dimension table is lot smaller than the size of the fact table.
    m:1 relation
    Similarly, if I place a Material and in a dimension, let's say 5 Material Groups and 1000 Materials, then there will be 5 x 1000 = 5000 Material-Material-Group combinations.
    2. What is the difference between the
    5000 Material-Material-Group combinations &
    5000 Material-Plant combinations ?
    Here the example is wrong. Imagine if 200 materials each fall under one material group, then there are not 5000 combinations but only 5 material groups with 200 each.
    3. And why does one improves performance over the other
    i.e. why is the
    5000 Material-Material-Group combinations better than that of 5000 Material-Plant combinations
    In the second case the dimension table is lot smaller and improves performance.

  • Characteristic values for the material and plant combination...

    Hi Friends,
    I would like to know how can we maintain the characteristic values for the combination of Material and Plant though the material is not batch managed?
    Thanks in advance,
    Ram

    Hi Rajendra,
    Thanks for quick reply. I am maintaining under classification view but it does not ask plant any where. So the value will be same across all the plants but i want to maintain characteristic values separately under each plant for same material.
    Regards,
    Ram

  • Inforecord with Vendor, Material and Plant combination information.

    Hi All,
    I Want to extract Info records with the combination of Material, Vendor and plant.
    As i tried in a017, EINE and EINA.
    Thanks a lot.
    Warm Regrds,
    Syam Kumar
    Edited by: Syam Kumar Dodda on Oct 6, 2011 10:28 PM

    ME1M can be used.
    If your writing query using A017, the system won't let you do that due to performance issue of select statement for pooled tables, you need use a different approach using ABAP program.
    Look at the note [856193|https://service.sap.com/sap/support/notes/856193]
    Edited by: Jeevan Sagar on Oct 6, 2011 4:38 PM

  • Optimize Performance in getting Quantity of Open PO per Material and Plant

    Hi,
    Recently I have a project that requires me to get the quantity of the open Purchase Orders (no Goods Reciept yet). The current code I have to get this are as follows (with some alterations):
    <b>select MATNR WERKS MENGE
    from EKPO into table i_purchase
    for all entries in i_tab
    where MATNR = i_tab-MATNR
       and WERKS = i_tab-WERKS
       and ELIKZ = space.
    loop at i_tab.
           loop at i_purchase where matnr = i_tab-matnr
                                          and werks = i_tab-werks.
               i_tab-menge = i_tab-menge + i_purchase-menge.
           endloop.
    modify i_tab.
    clear i_tab.
    endloop.</b>
    Now there is nothing wrong with the program here its just that the user I know would tend to proccess a large number of materials per report and would cause a <b>Time Out</b> because of the data being proccessed. It also needs to be run online so background processing is out of the question.
    Question is, is there a better way where I can get the same results with a better performance and possible avoiding the same time out again (i.e. other database tables, improved logic, coding impmlementation, etc.) ?
    Hope to hear from you soon.
    Take care and good day.

    Hi,
    Try this:
    IN select stmt:
    1.  use select statement validating i_tab. like:
    if i_tab is not initial.
    select MATNR WERKS MENGE
    from EKPO into table i_purchase
    for all entries in i_tab
    where MATNR = i_tab-MATNR
    and WERKS = i_tab-WERKS
    and ELIKZ = space.
    endif.
    2. Chk this possiblility:  do not add elikz = space condition into wyhere clause of select stmt and remove unwated entries from i_tab using DELETE i_tab where elikz =ne space. this will surely improve performance of select stmt as elikz is not a key field.  but this chk once.
    In LOOP:
    1. donot use loop stmt insterasd use read table stmt for that sort itab with fields MATNR WERKS. and then use BINARY SEARCH in thi s clause. using bs will improver ur prg perfromance drastically.
    2. instead of loop at itab use field symbol this is also very help ful. but try above oprtion and then go for it... any way loop with fs is better than loop at itab .
    Hope this will help u.
    Jogdand M B

  • Production Order on basis of Material and Plant

    Hi,
    I want to know the table name from which i can get the Production Order on the basis of Material No and Plant no

    Hi,
      Production Order Header Table -
    >AFKO
      Field Name :     
      Order Number      --- AUFNR
      Production Order Item Table   -
    >AFPO
      Field Name:
      Order Item Number       -
    POSNR
      Material Number         -
    MATNR
      Plant                   -
    DWERK
    Regards,
    nandha

  • Dispaly  range of material and plant

    hi,
    firends i want the code for the display of ranges between two number of material, date and plant on that base i have to get data for plant, date of posting, customer
    like that
    ie if i give material 400000004 to 400000007
                  plant      dp01 to dp02
    date 13.04.2006 to 30.1.2007
    on this information i have to get values for material docu number date of posting , customer
    i am geting for single value now i want for multiply values
    thanks and regards
    shafeeq ahmed

    select material docu number date of posting , customer from XXXX into table itab where material in s_material and plat in s_plant and date in s_date.
    loop at itab.
    write: / itab-material docu number date of posting , customer.
    endloop.
    Cheers

Maybe you are looking for

  • Creating a Dynamic Update Statement based on Select

    hi, i'm trying to create a dynamic update statement based on select statement my requirment is to query a joint tables and get the results then based on the results i need to copy all the data and create an update statement for each row for ex the up

  • Can't Delete First Page

    Have a 400-page document in Pages and need to delete the blank page at the beginning, but it won't let me!  I have "show invisibles" displayed but nothing is on that page.  I have tried deleting it by viewing the thumbnails but that is wanting to del

  • Release 9.02 vs 1.0.2.2.2a

    Hello, Can someone please tell me the difference between releases 9.02 vs. 1.0.2.2.2a? They are both Oracle 9i Application Server, so I am a little confused. Could someone please clear this up for me? Thanks! Ariel

  • Not Enough Storage !!!

    Hi all, I keep getting this message on my iphone (ios8) but I have the 20gb plan and icloud is showing I have 8.48gb free...... Any ideas? Thanks.

  • Preview pdf problem in Bridge CS4

    Hello, When I want to make preview prints from PDF files sometimes I see double pages, and I think one is a low resolution file and the other is a high resolution file. So I have a problem to make previews of these double pages in Bridge CS4. Does an