Get list with max no

hi all,
I want to get max changenr from cdhdr for each and every object id . if i write for all entries iam getting an error . how can i get the list with max change number for each and every material?
SELECT * FROM CDPOS INTO TABLE T_CDPOS FOR ALL
          ENTRIES IN T_ZWPBPH WHERE OBJECTCLAS ='MATERIAL'
          AND OBJECTID = T_ZWPBPH-PBPINO AND FNAME = 'SPART'.
    SELECT * FROM CDHDR INTO TABLE T_CDHDR FOR ALL
    ENTRIES IN  T_CDPOS WHERE OBJECTCLAS ='MATERIAL' AND
    OBJECTID = T_CDPOS-OBJECTID AND CHANGENR =  T_CDPOS-CHANGENR => this statement
Message was edited by:
        priya katragadda

can this help u out ..
SELECT CDHDROBJECTID  CDHDROBJECTCLASS 
        <b> MAX( CDHDR~CHNAGENR )</b>        INTO (V_ID, V_OBJCLASS , V_NUMBER)
       FROM
          CDHDR INNER JOIN CDPOS AS A ON
"COMMON KEYS       
         ON SCUSTOMID = SBOOKCUSTOMID
       WHERE
          WHERE OBJECTCLAS ='MATERIAL'
AND OBJECTID = T_ZWPBPH-PBPINO AND FNAME = 'SPART'
       GROUP BY  CDHDROBJECTID  CDHDROBJECTCLASS 
       ORDER BY  CDHDR~OBJECTID  .
  WRITE: / V_ID, V_OBJCLASS , V_NUMBER.
ENDSELECT.
regards,
vijay

Similar Messages

  • Query to get row with max values for distinct

    I have a table test with ID, ADID, MTMST columns.
    ID     ----ADID----     MTMST
    1     ----100----     24-MAR-12 08.17.09.000000 PM
    1     ----101----     24-MAR-12 08.18.15.000000 PM
    1     ----102----     24-MAR-12 08.18.56.000000 PM
    2     ----103----     24-MAR-12 08.19.21.000000 PM
    2     ----104----     24-MAR-12 08.19.36.000000 PM
    2     ----105----     24-MAR-12 08.19.46.000000 PM
    3     ----99----      22-MAR-12 09.48.22.000000 PM
    I need the rows with max ADID for each ID.
    I used the following query but it provided max ADID of the table but not the distinct ID
    select * from test where ADID in (select max(ADID) from test where id in (select distinct(id) from test where mtmst > sysdate -1))
    Result:*
    ID     ----ADID----     MTMST
    2     ----105----     24-MAR-12 08.19.46.000000 PM
    Expected result:*
    ID     ----ADID----     MTMST
    1     ----102----     24-MAR-12 08.18.56.000000 PM
    2     ----105----     24-MAR-12 08.19.46.000000 PM
    Thanks,
    Dheepan
    Edited by: Dheepan on Mar 24, 2012 9:53 AM

    select id, adid, mtmst from test where (id, adid) in (select id, max(adid) from test group by id) and MTMST>sysdate-1
    is the answer.

  • Get articles with max date only

    Hello Everyone
    I've got a little problem with a sql query. I got two tables and a lot of articles. The articles are listed multiple times and got different dates. I want to select the following rows:
    p.productname
    i.amount
    i.date
    The problem is, that every product only should be listed one time (something like UNIC or DISTINCT). And it should be the product with the highest date. Is there something like MAX(date) that I can use?
    What I already have is...
    SELECT
        p.productname,
        i.amount,
        i.date
    FROM op_inventory i
    LEFT JOIN products p
    ON p.ItemID = i.fk_article
    Now, how can I solve my problem above?...
    Greets Dollique

    Hmm, thx but, that didn't solve my problem.
    I've just found a german website with a detailed explantion of the solution that mack gave me.
    I used that one and it seems to work quite fine, expects from I somehow can't use GROUP BY. Every time I use it, it returns a Executing DB error (like before)...
    I'll see if I can solve that problem...
    Thx you anyway!
    Toby
    PS:
    My code now is
    SELECT
        i.id,
        i.amount,
        i.date,
        p.productname
    FROM op_inventory i
    LEFT JOIN products p
    ON p.ItemID = i.fk_article
    <!---JOIN (
        SELECT
            id id_m,
            MAX(date) maxdate
        FROM op_inventory
        GROUP BY id_m
    ) temp
    ON i.id = temp.id_m AND i.date = temp.maxdate--->
    <cfoutput>#gi_where#</cfoutput>
    i.date = (
        SELECT MAX(o.date)
        FROM op_inventory o
        WHERE o.fk_article = i.fk_article
    <!---GROUP BY i.id--->
    And the content of #gi_where# is:
    WHERE p.category = #lb_group# AND

  • Getting started with MAX

    I am trying to import signal from the fieldpoint modules and I have gone to the web for help. I have fieldpoint working. The web says assumes that I have MAX working but i can't get it to work. in MAX when i do the getting started help configuration, it gives me this error...
    One or more missing GPIB interfaces.
    There are several reasons why you might encounter this problem:
    Reason: Your GPIB interface is incorrectly installed.
    Solution: Please verify that your GPIB interface is correctly installed and rerun the NI-488.2 Troubleshooting Wizard.
    Reason: You are using a non-Plug-and-Play interface (e.g., AT-GPIB/TNT, PC/104-GPIB, PXI-8156) and you did not use the Add New Hardware Wizard to add the interface to your system properly.
    Solution: Click the Add Hardware button and the Add GPIB Hardware wizard will guide you through the process of adding GPIB hardware.
    We have simply hooked our FP-1000 up to our computer via a RS-232 cable and it says that we are missing hardware or something. do you have any ideas for me?
    Thanks so much for your help
    Dave
    Reason: For the PCMCIA-GPIB and PCMCIA-GPIB+, the PCMCIA host controller must be working properly in order to use the GPIB interface.
    Solution: Use the Windows Device Manager to verify that your PCMCIA host controller is functioning correctly. Start the control panel by selecting "Start>>Settings>>Control Panel", open the System icon, select the Hardware tab and click on the Device Manager button. If you select "View>>Devices by type", you can look at the PCMCIA adapter properties to ensure it is correctly enabled.

    Dave,
    It looks like you've been running the NI 488.2 Getting Started Wizard. That's why all the errors refer to GPIB Hardware.
    What you need to do is look for your FieldPoint device under the Remote Systems section on the left side of the window. It should be auto-detected. Then right-click and select Find Devices, to detect the modules installed in your FieldPoint bank.
    That should get you started. Let us know if you have any further issues getting set up in MAX.

  • How do you isolate an album or artist in the new iTunes? (12.0) It is really frustrating when trying to listen to one album and I get the album in the list with all 1,025 other albums in my library.

    How do you isolate an album or artist in the new iTunes? (12.0) It is really frustrating when trying to listen to one album and I get the album in the list with all 1,025 other albums in my library. Same with the artist.

    Welcome to the  Discussion Forums
    ... I assumed that if I played the 1st track, it would continue to play the rest of the album (as iTunes does on my Macs and PCs),...
    You assumed correctly, and it should continue to play the rest of the album in order. Does this happen to all your albums. Have you tried restarting the tv.

  • How to get Network logins shown as a list with photos!

    A long time ago, some one posted a tip here on how to set this up for Panther Server (that is to be able to view the list of network login accounts as a scrolling list with different pictures [photos] for each user).
    I myself was able to follow the instructions and get it working in Panther.
    Later someone else said it no longer worked using Tiger Server.
    A while I go I did set this up (again) using Tiger Server and therefore I can confirm it does still work. (Although I am only now getting round to letting anyone else know.)
    If anyone is interested I can help you through the process.
    In theory the same pictures can be used in other places as well, for example in Apple AddressBook (works for me as well). Its a shame Apple broke MailPictures in Tiger though. See http://www.nikwest.de/Software/
    Despite what the above website implies, it DOES NOT work properly in Mail in Tiger (although the Panther version does work in Panther Client).
    PS. I did get an equivalent to work in Mozilla Thunderbird 1.5 in Tiger.

    Unfortunately it doesn't work. @List requires members names so I can't provide a member set as an argument :(^^^Are you sure? Take a look at the below example from the Tech Ref. That sure looks like @LANCESTORS and @LIST is accepting more than just member names.
    FIX(@LANCESTORS(@LIST(@ATTRIBUTE(Caffeinated_True),@ATTRIBUTE(Ounces_12),"200-40")))Also note this:
    If the @LANCESTORS function is used alone (not within a FIX statement), you must use the @LIST function and specify member names. So you DO have to use @LIST if @LANCESTORS is to be used to do an aggregation. Or so it appears.
    Regards,
    Cameron Lackpour

  • How to get TDS Vendors list with name

    Hellow Friends,
         I want to get only TDS vendors list with Respective names.I have used Table LFBW.There i am getting only TDS Vendor codes list not comming with names.
    Is there any Table or T.Code or Report to get TDS Vendors list with names?
    Please Advice me.
    Thanks&Regards
    Kumar

    Develop a query joining table LFA1 & LFBW on primary key as LIFNR. in the out put have the TDS Vendors with name and TDS Code
    Assign points if useful
    Regards

  • When usung google search I get a listing but when I click on it gets replace with spam

    When usung google search I get a listing but when I click on a link it gets replace with spam. I notice a half blue spiral in front of the link that pops up.
    == This happened ==
    Every time Firefox opened
    == every time I use use the Google Search in firefox

    This seems to be going around. I haven't studied it in detail, but here is an example of a removal guide:
    http://malwaretips.com/blogs/trovi-com-removal/
    ''There are many other removal guide sites, but often they are designed to confuse you so you purchase paid support services. Most likely you won't need to do that in this case.''
    Please also see our support article on cleaning up malware, and the specialized forums listed toward the end: [[Troubleshoot Firefox issues caused by malware]].
    In the short run, assuming an extension is to blame, you may want to use Firefox in its Safe Mode. That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    Not all add-ons are disabled: Flash and other plugins still run
    After Firefox shuts down, a small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).

  • [svn:bz-4.0.0_fixes] 20451: backporting bug fix BLZ-570/ BLZ-620 Double linked list with lot of objects result in BlazeDS Error deserializing error  : StackOverflowError  We put hard limit to the max object nest level to prevent StackOverFlowError .

    Revision: 20451
    Revision: 20451
    Author:   [email protected]
    Date:     2011-02-24 08:33:31 -0800 (Thu, 24 Feb 2011)
    Log Message:
    backporting bug fix BLZ-570/BLZ-620 Double linked list with lot of objects result in BlazeDS Error deserializing error : StackOverflowError  We put hard limit to the max object nest level to prevent StackOverFlowError. the default max object nest level is 1024 and it can be configured in the endpoint/serialziation section in service-config.xml. This needs documentation.  Checkintests pass
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-570
        http://bugs.adobe.com/jira/browse/BLZ-620
    Modified Paths:
        blazeds/branches/4.0.0_fixes/modules/common/src/flex/messaging/errors.properties
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/endpoints/AbstractEndpoint.j ava
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/SerializationContext.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf0Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/Amf3Input.java
        blazeds/branches/4.0.0_fixes/modules/core/src/flex/messaging/io/amf/AmfIO.java

    Dear Pallavi,
    Very useful post!
    I am looking for similar accelerators for
    Software Inventory Accelerator
    Hardware Inventory Accelerator
    Interfaces Inventory
    Customization Assessment Accelerator
    Sizing Tool
    Which helps us to come up with the relevant Bill of Matetials for every area mentioned above, and the ones which I dont know...
    Request help on such accelerators... Any clues?
    Any reply, help is highly appreciated.
    Regards
    Manish Madhav

  • [svn:bz-3.x] 20443: back porting bug fix BLZ-570/ BLZ-620 Double linked list with lot of objects result in BlazeDS Error deserializing error  : StackOverflowError  We put hard limit to the max object nest level to prevent StackOverFlowError .

    Revision: 20443
    Revision: 20443
    Author:   [email protected]
    Date:     2011-02-23 21:19:22 -0800 (Wed, 23 Feb 2011)
    Log Message:
    back porting bug fix BLZ-570/BLZ-620 Double linked list with lot of objects result in BlazeDS Error deserializing error : StackOverflowError  We put hard limit to the max object nest level to prevent StackOverFlowError. the default max object nest level is 1024 and it can be configured in the endpoint/serialziation section in service-config.xml. This needs documentation.  Checkintests pass
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-570
        http://bugs.adobe.com/jira/browse/BLZ-620
    Modified Paths:
        blazeds/branches/3.x/modules/common/src/java/flex/messaging/errors.properties
        blazeds/branches/3.x/modules/core/src/java/flex/messaging/endpoints/AbstractEndpoint.java
        blazeds/branches/3.x/modules/core/src/java/flex/messaging/io/SerializationContext.java
        blazeds/branches/3.x/modules/core/src/java/flex/messaging/io/amf/Amf0Input.java
        blazeds/branches/3.x/modules/core/src/java/flex/messaging/io/amf/Amf3Input.java
        blazeds/branches/3.x/modules/core/src/java/flex/messaging/io/amf/AmfIO.java

  • How to get list of company codes with current period not opened?

    Hi,
    How to get list of company codes with current period not opened?
    Is there any way we can check whether the current period is opened for all company codes.
    If not how, can we generate a report which having information of period and company code. Also please tell me, which table will have info on posting periods and company codes.
    Thanks
    Vineeth Varghese

    Hi,
    The MM periods details can be viewed In Table MARV . On the selection screen you have the option of entering the company codes , current period, year current period etc. so make the required entries and you get the all details relevant to MM periods. Also it can be downloaded as a report.Thanks

  • To get list of permissions for iview/apps with the help of API (UME API?)

    hello all
    who can answer how to get list of permissions (list of roles or users) for iview or other application with the help of API (UME API ?)
    thanx!

    if anybody whant to know
    https://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/ume/com/sap/security/api/acl/IAclManager.html#getAcl(java.lang.String)
    https://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/ume/com/sap/security/api/IRole.html

  • How to get list of active users with the details like samaccountname, name, department, job tittle, email in active directoy?

    how to get list of active users with the details like samaccountname, name, department, job tittle, email in active directoy?

    You can use third party software True Last Logon 2.9.You can export the file in excel for report creation.You can use the trial version this will achieve what you are looking for.
    True Last Logon displays the following Active Directory information:
    --Users real name and logon name
    --Detailed account status
    --Last Logon Date & Time
    --Last Logon Timestamp (Replicated value)
    --Account Expiry Date & Time
    --Enabled or Disabled Account
    --Locked Accounts
    --Password Expires
    --Password Last Set Date & Time
    --Logon Count
    --Bad Password Count
    --Expiry Date
    --You can also query for any other attribute (Example: Description, telephone Number, custom attibutes etc)
    Refer the below link for trial version:
    http://www.dovestones.com/products/True_Last_Logon.asp
    Best Regards,
    Sandesh Dubey.
    MCSE|MCSA:Messaging|MCTS|MCITP:Enterprise Adminitrator |
    My Blog
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Me and my dad share an iTunes account and all of his music he has purchased on ITunes shows up on my songs list with a cloud icon next to it. How do I get rid of these from my songs list? Cuz it's doing the same thing on my iPhone

    Me and my dad share an iTunes account and all of his music he has purchased on ITunes shows up on my songs list with a cloud icon next to it. How do I get rid of these from my songs list? Cuz it's doing the same thing on my iPhone.

    Go to Edit > Preferences > Store, and uncheck the box for "Show iTunes in the Cloud purchases."

  • How to get PO list with mark archived or not?

    Hi experts,
    I have a list of POs from both database and archive server using standard report ME2N but I can't distinguish between archived PO or not.
    Actually if I checked the detail PO I could see if it was from archive or not, but this way takes time.
    Please advise how to get list of PO with mark from archive or database.
    Thanks.
    rob

    hi
    u can use me82
    or in me2n us the scope as ARCHIV
    regards
    kunal

Maybe you are looking for

  • Help needed with FormCalc scripting in LiveCylce 8.0

    I am new to the whole form design functionality in Adobe.  I have a form that I have created that has multiple fields calculating off each other.  I have managed to get all the fields to calculate correctly, but I'm having trouble figuring out the co

  • Icloud not activated

    I am new to Icloud, I activate it two weeks ago on my macbook air and my Imac 27. , but nothing happens. In the system preferences panel, My Icloud storage indicator doesn't move ( 15Gb of 15 Gb available ). I suppose I miss something, but what ? Tha

  • CHARM and Digital signatures

    Hi SAP Solman Gurus, I have configured CHARM in solman 4 system its working perfectly fine, Now I wanted know if there is anyway by which you can integrate digital signatures with CHARM I want system to prompt for digital signature verification while

  • I still see javaw.exe in Task Manager after I close app !

    javaw.exe seems to like to hang around (45 mb in memory) after I close the app. I'm running JWS 1.4.2. I thought maybe it was because I wasn't doing the System.exit(0) on WindowClosed, but that doesn't seem to kill javaw.exe. Unsolved mystery.

  • USB transfers stop after ~400 MB

    I have a Mac Mini I use as a home theater computer. Connected to it are 3 separate RAID sets (Set1, Set2, and Set3). All 3 sets are mirrored (RAID1), so there are 6 total hard drives -- Set1 is composed of 2x 2TB Hitachi HDDs, Set2 is 2x 2TB Seagates