Help In Last 5 latest POs For A Given Material

Hi,
     Please Help in query,To fetch  last 5 latest  Pos for  a given Material  , what Might be wrong in  the query
    SELECT  ekkobedat ekkolifnr ekpoebeln ekpomatnr ekpoebelp ekpomenge
    ekpomeins ekponetpr  FROM ekko AS ekko INNER JOIN ekpo AS ekpo ON ekkoebeln EQ ekpoebeln
    INTO CORRESPONDING FIELDS OF TABLE t_ekko  UP TO 5 ROWS    WHERE ekpo~matnr EQ V_value AND
      ekko~bstyp = 'F' AND
      ekko~LOEKZ = space
    ORDER BY ekko~bedat DESCENDING.
Regards
ASHOK K

Hi,
Select * from ekk0 into table it_ekpo where ebeln = pa_ebeln and matnr = pa_matnr.
If sy-subrc EQ 0.
SORT it_ekpo by ebeln  erdat desending.
Loop at it_ekpo into wa_ekpo.
lv_index = lv_index + 1.
if iv_index LE 5.
append wa_ekpo to it_ekpo1.
ENDIF.
endloop.
ENDIF.
Edited by: Rasheed salman on Jan 22, 2010 8:26 AM

Similar Messages

  • How to find latest Purchase Order  for a given material

    Hi
      I need to generate a report on purchasing ODS ,My requirement is in this report I need to display all the latest Purchase order's  for a given material.
    Thanks
    Jay

    You seem to need a kind of list why don't you go to table ekpo in R/3.
    Regards
    Boujema

  • Daresbury purchase price will be variable for a given material from one sal

    HI
    This is the Issue came from my client
    Daresbury purchase price will be variable for a given material from one sales order to another. System currently allows manual enter prices on purchase req in relation to selling price. Price in Pur Info Req has price of 0.01, Purchase order takes price of

    I probably have at least over 2000 songs in my iTunes, plus a couple of videos. Though since I can always still use my desktop for anything else, maybe it is better I take the 256 over the 128. I had read a lot of other topics on this with a lot of people saying it is better to go with the 8GB memory and I would buy that also if I could, but I can't and of course I want this laptop to last me a while.
    Thanks for your help I think I'll go for the 256 + 4 instead, and I presume I can always get other external drives to store anything if I really need to down the road.

  • Get the Stock for a given Material no

    Hi,
         I'm an ABAP consultant, new to MM.
         I have a requirement - For a given Production Order I have to find the Material and respective BOM Explosion. Once that is done I have to get the Stock for those Materials [Child Materials].
    I have used AUFK and AFPO to get the material from the Production Order and Used MAST table to get the other details and passed it to FM - 'CS_BOM_EXPL_MAT_V2' - This gives me the Child materials.
    Now I want to know how can I find the Stock for a given Material. I want to get the Overall Unrestricted stock. Which Table do I have to use. Is there any standard Function Module [FM] or BAPI to get it.
    Please help.
    Thanks & Regards,
    Ashish

    I have gone through  the MARD table. I want to confirm - for a Material no there are more than 1 plant and for each plant there are more than storage location. So I have to add the Unrestricted Stock of all those to get the Full Unrestricted Stock.
    Please refer Transaction MMBE - I have to use that output.

  • Projected Stock for a given Material and Location (System: SCM-APO)

    Hello Experts,
    Appreciate, if anybody can help me in getting a time-series key-figure data (Stock-On-Hand for a given Material and Location) for a given period.
    I am working on a report to display the projected stock (Material & Location are known) for a given period (1 month).
    I am able to view the above data in my planning book.
    Thanks in advance.
    Regards,
    Prasanna
    Edited by: Prasanna Gunji on Apr 9, 2010 3:42 PM

    Hi Prasanna,
    9ASOQMQTY - Stock in quality inspection
    9ASOTRSQTY - Stock in transit
    9AAVLSTCK - Projected Stock
    Hope this helps
    Regards
    R. Senthil Mareeswaran.

  • How to get classification for a given material and material type in MM

    Hello Friends,
    One of my developer colleagues is struggling to find out : how to get classification for a given material and material type in MM?
    He is looking for probable table and table fields to Select from.
    I would appreciate seriously any help in this regard.
    ~Yours Sincerely

    Hi
    Below given the flow and table details for a given class and class type.
    - Table KLAH --> This contains the "Internal class no" [ for the given Class & Class type ]
    - Table KSML --> This contains the " internal character numbers " [ nothing but characteristics attached to the class ] , which can be fetched with the above fetched internal class no
    - Table AUSP --> This table contains the objects ( material ) attached to the internal characters of that class
    - Table CABNT --> This table contains the "Description" for the internal character numbers.
    - award points if this is ok

  • FM/Class to find the class and characterstics for a given material

    Hi All,
    Is there any Class/FM to find the class and characterstics for a given material.I tried some BAPI_OBJCL* BAPI's but lot of the BAPI's need classnum as input parameter. But i need a BAPI or tables or class which can give the class and its characterstic values for a given material.

    Hi Ben
             Try ..
    BAPI_OBJCL_GETCLASSES
    BAPI_OBJCL_CREATE

  • Need Multiple Units of Measure for a given material due to multiple vendors

    Hello,
    We have a requirement where we must have multiple units of measue (each, box, case, pallet) for a given material.
    Background:
    We have multiple vendors for one SAP material number. We need to store 4 levels of units of measure for each vendor+material combination.
    Unit of Meaure levels
    1. Each
    2. Innerpack (ex: 12 each = 1 innerpack)
    3. Box (ex: 36 eaches = 1 box)
    4. Pallet (ex: 100 eaches = 1 pallet)
    Standard SAP allows in MM01 additional data --> Units of Measure only 1 Ea, Box, Plt, etc.
    Our requirement is to allow multiple Units of Measure due to multiple vendors providing the same material.
    So, our unique combination is by a Material+Vendor.
    We are considering adding the vendor name and vendor number to the material master --> additional data --> Units of Measure tab.
    Does this seem like a good solution? What impacts do you foresee with approach?
    Any alternatve solutions?
    We thought we could enhance the purchasing info records to allow multiple units of measure too but then we need to also add many fields to hold the weight, lenght, height, width, volume, country of origin, etc.
    Please recommend a best practice or solution to handle this requirement.
    Thanks in advance!!!

    Hi,
    Maintain the alternative units in Material Master in Additional Data -> Units of Measure section with proper conversion factors.
    Create individual info-records i.e. per mtl-vendor combination & in the info-record maintain the order unit, along with other details as required.
    Now when you create a PO, the details will be read from the info-record. To test the same, create them in your sandbox & see if it meets your requirement.
    Hope the above clarifies your query.
    Regards,
    Vivek

  • Last Record Values for a given Date Range

    Hi, I have a unique requirement to process/report only the values of the last record found in a date range for a given set of characteristics.  The order would be by FISCPER.
    For example:  I have some data with 3 characteristics.
    STORE001 MATN001 2004001 100 PCS
    STORE001 MATN001 2004005 75  PCS
    STORE001 MATN001 2004006 80  PCS
    STORE002 MATN002 2003008 10  PCS
    STORE002 MATN002 2004001 15  PCS
    STORE002 MATN002 2004004 40  PCS
    A selected date range of 2003008 to 2004001 would result in the following records being processed.
    STORE001 MATN001 2004001 100  PCS
    STORE002 MATN002 2004001 15   PCS
    A selected date range of 2004002 to 2004006 would result in the following records being processed.
    STORE001 MATN001 2004006 80  PCS
    STORE002 MATN002 2004004 40  PCS
    How can I accomplish this at runtime?  Any ideas?

    Nope, it's not an inventory scenario.  It could be say the last status of a gas meter within a selected date range. 
    Any other ideas? 
    I've considered using VKF, but haven't figured out how this would work yet.  If I could modify the selected query data prior to query processing I might be able to number the records and then filter on that.....  Anyway I'm open to any suggestions or leads!
    I won't forget the points for anyone with a solution!
    Thanks!

  • Table name for Sales Org/Plant combination for a given material?

    Hi Experts,
    I hv to find out that, weather the given material(actually, item of a sales order) have not been extended to the Sales Organisation / Plant on the sales order? or not?
    So, in this context am looking A555 table......but, here I found 300 entries, where as MARA does hv tonns of materails!!
    (A152, A153 tables do not hv any entry).
    1 - So, am I lookimg the correct table? or is there any other good table?
    2 - Is there any alternative(like FM) to validate the given materail againmst above said condition?
    thanq

    MVKE is the best table, the Sales view displayed in MM03 is referenced from this table.
    data: t_mvke like mvke.
      SELECT *
             INTO TABLE t_mvke
             FROM mvke
             WHERE matnr = p_matnr
             AND   lvorm <> 'X'
             AND   dwerk = p_werks.
    Hope this helps, if not let us know your requirement.
    Thanks,
    Sudhir.

  • How to find latest child for a given parent in same table?

    More details:
    Here I am giving an example -
    Orig_ID     Chg_to_ID
    A     B
    B     C
    C     D
    D     Null
    From source I use to get Orig_ID values, using Orig_ID value have to find latest Child(Chg_to_ID) to that at any level.
    Latest child identify by Null value in the column "Chg_to_ID".
    If I get B --> need to replace B with D. I may get any value A or B or C or D -- but at an end I have to replace those values with 'D', since it is latest for any of those parents.
    I tried to use "Connect By Prior", but it is tooo slow ofcourse query not returned after 10min also. Plz advise.

    First time every employee will be assingend an ID and may changed/merged to another ID basing on some other conditins. So, any time first assigned ID may changed to new ID and will be updated to another column "Chg_to_ID" as winner ID and at the same time one more records will be created with new ID as ID and Null in "Chg_to_ID".
    In my first post, given an example, here pasting again:
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->C
    C-------------->D
    D-------------->Null
    In detail: One employee first assigned ID as "A" after wards changed to "B". At that time data would be like below
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->Null
    After that B change to C, now it looks like this:
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->C
    C-------------> Null
    For each change one record will be inserted.
    My requirement is -- Orig_ID may get A or B or C, but I need to replace those with "C", since it is latest child. For latest child "Chg_to_ID" is NULL.
    Plz let me know for any clarifications.

  • Help on the "latest" content for APEX presentation

    Tyler Muth here. It's been way too long since I've been on this forum. Unfortunately my current role doesn't allow much time for APEX projects (all Exadata, all the time). I have to give an apex talk in two days and would love some pointers to the latest "best solution" for a few key topics. The apex community has always been one of it's greatest strengths and I'm hoping for some pointers to community content or just built-in functionality that I may not be aware of. The audience are experienced apex developers (and really sound like they know what they're doing) so their questions are beyond the "spreadsheet to app" demo.
    Here it goes:
    <li>Deployment in general. Specifically moving the full app vs 1 page. (not sure much has changed here)
    <li>Efficient use of Page Zero such as dynamic actions or dynamic tabs
    <li>Source code control best practices. I'm pretty comfortable wit this one but happy to see new and creative solutions.
    <li>AJAX: They did a lot of their own AJAX code before apex included jQuery. I think they're looking for more use of the built-in APIs
    <li>More details on the "Shuttle". Examples or modifications perhaps?
    <li>Customized success messages, such as "Record for Melissa updated".
    <li>Not interested in mobile at this time.
    <li>Charting and any custom examples.
    <li>Calendar examples beyond what's in the doc. Possibly updating entries inline.
    <li>Recent improvements in built-in tabular forms
    What I'm looking for are just links to blog posts or other content on these topics if possible. Yes, I can (and will) google them, but the active people in the apex community probably have a good idea where solutions to some of these topics are. Thanks in advance for any help you can provide and I hope to rejoin this community in the near future as I have a few projects where APEX would be a good fit.
    Regards,
    Tyler
    http://tylermuth.wordpress.com

    Hi Tyler,
    I’m apologizing in advanced for the short response but I have to go out soon.
    Two days seems like a short time to really learn new stuff, but as your audience are experience APEX developers, they might find some of the followings interesting:
    *) Deployment – APEX 4.0 introduced the APEX_APPLICATION_INSTALL API (http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_app_inst.htm#CHDIEDJH), which allows you to deploy new applications usinging a command line utility, but still enjoy all the options that were only available in the GUI mechanism (e.g. changing the deployed application ID, default schema, etc.).
    *) Error handling – APEX 4.1 introduced some new ways of intercepting and dealing with APEX errors. Patrick wrote two Blog entries on it.
    *) Tabular Forms – this feature has considerably changed in 4.x. Adding the option of built-in tabular forms validations (without losing changes in case of validation error) and the option to process the tabular form data per row without resorting to the G_Fxx arrays. Also the Add Row functionality has become a client side operation (important for those who upgrade from pre-4.1 versions). You should search the forum for the combination of marc && tabular && form. He has several threads on the subject.
    *) Globalization – if this is an issue with your audience, there were some major enhancement of the translation mechanism. Search Joel’s blog.
    That’s all for now. Good luck with the presentation.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • How to calculate the next incoming PO for a given material/plant in an elegant way

    Hi experts,
    Given a material and a plant i want to find out when the next PO is arriving. Is there a function module to calculate it?
    This is the values i want to retrieve, but this method is not very optimized and can have performance issues:
    "Entry un EKPO with material (MATNR), plant (WERKS), and Delivery Completed Indicator (ELIKZ) = blank, select the PO
    numbers.
    For all the POs, sort in EKET for the field ‘Delivery Date’ (EINDT) to get the next delivery date being
    EINDT ≥ Todays day
    Take the next PO to be received. Do the calculation (MENGE – WEMNG) for the item
    The result of the calculation is the amount still open and that is supposed to be received. "

    Hi,
       You can use the FM: MD_STOCK_REQUIREMENTS_LIST_API. Execute the FM with plant and material number in selection. Now, check the structure: MDEZX which will give you all the requirements for the item. You can filter the items in the structure where MDEZX - DE = BE which will give you only the purchase orders. Also, the items will be sorted automatically based on the date.
        Please check the same and revert back.
    Regards,
    AKPT

  • Need field and table for spare part material and price for a given material

    Hi,
          In need to create a report with following fields:-
           Customer           Material          spare part material            spare part description             price                   currency.
    From which table and field I can get all this information.Please guide me.
    Hint.  cl30n transaction for material managemant.
             vk13 transaction for price maintenace.
    Regards.

    CL30N is a general transaction that can be used for any classification, but material master maintenance is usually MM01/MM02 or MM41/MM42
    Material description can be taken from table MAKT
    customer from table KNA1
    The question is what you are going to analyse? where do material and customer tie together? do you do the analysis on sales orders VBAK and VBAP ? or invoices  VBRK and VBRP? or customer material info record KNMT? 
    or do you capture this info in classification? then you get the values from AUSP
    Edited by: Jürgen L. on Aug 3, 2010 9:42 AM

  • Material document ,quantity and stock location for a given material

    hello all,
    i have a requirement like this.
    in the selection screen i have,
    material.....
    plant....
    posting document date.....
    i need to get material document number,quantity,units and stock location for the above mentioned selection criteria...
    what tables do i need to use..
    do i need to use any BAPI or Function module..
    thanks in advance...

    Hi Vinay ,
    Look into table MKPF & MSEG for material document
    anf for quantity in MARD
    Regards
    Yogendra Bhaskar

Maybe you are looking for

  • Using cable modem with blu-ray player

    I just had FiOS installed.  I have a Samsung blu-ray player that's too far away such that wi-fi is not reliable. Can I use a cable modem to gain access hard-wired?  Since the STB has an IP address I take it I should be able to split the coax, feed it

  • Requisition quantity against contract

    Hi SAP gurus, We have a problem with the following scenario: A purchase requisition is created, after that a contract referenced to this requisition is created. The problem ocurrs when a purchase order is created referenced to the requisition and oth

  • Transport request is not generating in Development

    Hi Friends , Transport request is not geting generated in develpment system........so what could be the problem.... RB

  • IPhone Loses Reception every time I touch it

    My new iPhone 4 loses its reception every time I touch it. I have avoided the left corner but every time I touch it it loses reception. Today however my sisters ATT phone had bad reception. I cannot tell if it is my phones fault or the cell towers in

  • Shockwave Flash player may be busy....

    So troubled by this product it keeps freezing & halting; well over a year now. So I removed it.Now I can't seem to get it reloaded again; after talking to my provider and finding it's safe. Why????