How can i sort files and pick the latest among them

Hi ABAPers
I have a problem with sorting files. I have files coming from FTP into my Presentation server.Files are like
3160SNIM_2007061201090010.in
3160SNIM_2007061201190011.in
3160SNIM_2007061201290015.in
3360SNIM_2007061201490017.in
3360SNIM_2007061201390014.in
3360SNIM_2007061201490018.in
3360SNIM_2007061201190013.in
Among these files i should filter the files with 3160 and 3360. and among filtered files i should pick the most recent file of both 3160 and 3360 and put them in another internal table. I am getting stuck how to justify this requirement. Not only 3160 and 3360 i have few more like that. Please help me out.

HI,
let us  say itab contains ur files.
data : begin of jtab occurs 0,
          fnamedate(20) type c,
          time(20) type c,
          end of jtab.
data : begin of ktab occurs 0,
         filename(30) type c,
         end of ktab.
  Loop at itab.
lv_len = strlen(itab-file).
  jtab-fnamedate = itab-file+0(17).
lv_len = lv_len - 17.
jtab-time  = itab+17(lv_len).
append jtab.
  endloop.
sort jtab by fnamedate time descending.
loop at jtab.
at new jtab-fnamedate.
concatenate jtab-fnamedate jtab-time into ktab-filename.
append ktab.
endat.
endloop.
After this loop ktab will contain latest files.
Thanks
Mahesh

Similar Messages

  • My mac book startup disk is full and when I start it, it give me a blank blue screen. I have tried the shift and I started in safe mode, and it gave me the stars screen. How can I delete files to fix the problem

    My mac book startup disk is full and when I start it, it give me a blank blue screen. I have tried the shift upon start
    and I started in safe mode, and it gave me the stars screen. How can I delete files to fix the problem

    1. Start up in Safe Mode.
        http://support.apple.com/kb/PH11212
    2. Empty Trash.
        http://support.apple.com/kb/PH10677
    3. Delete "Recovered Messages", if any.
        Hold the option key down and click "Go" menu in the Finder menu bar.
        Select "Library" from the dropdown.
        Library > Mail > V2 > Mailboxes
        Delete "Recovered Messages", if any.
        Empty Trash. Restart.
    4. Delete old iOS Devices Backup.
        iTunes > Preferences > Devices
        Highlight the old Backups , press “Delete Backup” and then “OK”.
        http://support.apple.com/kb/HT4946?viewlocale=en_US&locale=en_US
    5. Re-index Macintosh HD
       System Preferences > Spotlight > Privacy
       http://support.apple.com/kb/ht2409

  • How can I sort files in a folder by name?

    How can I sort files in a folder by name? iFS first sort files that starts with upper-case letter and then files with lower-case letter.
    Like:
    A_file
    B_file
    a_file
    b_file
    I want:
    A-file
    a_file
    B_file
    b_file
    This doesn't help:
    String[] sort_attributes = {"NAME"};
    boolean [] sort_orders = {true};
    SortSpecification sort = new SortSpecification(sort_attributes, sort_orders);
    currentFolder.setSortSpecification(sort);
    Do I have to get all items in a folder and then sort them?
    /Elin

    I do not think there is a way to do that without add-ons
    There are a couple of workarounds I am aware of
    * Add the bookmarks manually in the bookmarks library and choose the position. That is using Show all bookmarks -> open required folder -> select a position and right click -> add new bookmark <br />Rather a slow and clumsy process
    * Sort a folder and copy it. If you sort the folder contents then copy and paste them they remain in that order when pasted.
    There are add-ons but I have not tried them. For example
    * https://addons.mozilla.org/firefox/addon/simplesort-bookmarks/
    * https://addons.mozilla.org/firefox/addon/auto-sort-bookmarks/
    There will be others available and take note of the advice to backup bookmarks manaully.
    * [[Restore bookmarks from backup or move them to another computer#w_manual-backup]]_manual-backup

  • How can I share files and itunes through extreme base station ??

    How can I share files and itunes music through the extreme base station. as well as locate and place files onto the external hard drive that is connected to the X.B.S. from my or other computers hooked up to it ??
    thank you in advance for your attention on this matter.
    - BrooklyNYC

    Which AirPort Extreme base station (AEBS) are you discussing? The new square 802.11b/g/n AEBS supports the direct connection of USB hard drives. The previous round 802.11b/g AEBS does not have that capability. I have a feeling that you are asking about the new one but this is the discussion area for the old one.
    The new square 802.11b/g/n AEBS allows you to share files directly from the connected USB drive. It doesn't matter what the files are so you can store your iTunes library there and get access wirelessly.
    The round 802.11b/g AEBS doesn't have this ability.

  • How can i call ajax and extract the data?

    Hi all,
    I don't know briefly about ajax..i want to learn ajax, so my question is how can i call ajax and extract the data. for ex, i have JSON file
        "mobile": [
                "Name": "Micromax",
                "Model": A310
                "Name": "samsung",
                "Model": grand 2
    for above example how can i call ajax..please anyone explain with small example because it'll help me a lot.
    Thanks & Regards,
    Palsaran

    Hi Palsaran,
    As i understood, your requirement is to POST data from UI to backend.
    The above code you given is not correct if you want to use model based implementation.
    In UI5 you don't need to do an explicit Ajax call, for which we can use Models like OData, JSON etc.
    For your JSON example, you can use like,
    var oModel = new sap.ui.model.json.JSONModel();
    var oData = "YOUR JSON DATA";
    oModel.setData(oData)
    oModel.loadData(yourURL/Entityset,"POST");
    For ref, you can use the below link
    JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.json.JSONModel
    Thanks
    Naveenraj

  • HT201272 Hello there,I delete my scruff application on the 8/05/13. Receipt N: 184052577343. And I was charged ammount of £ 16.99on the 15/05/13. I t's a Subscription Renewal. How can I stop it and get the refund of this ammount back on my account? Thank

    Hello there,I delete my scruff application on the 8/05/13. Receipt N: 184052577343. And I was charged ammount of £ 16.99on the 15/05/13. I t's a Subscription Renewal. How can I stop it and get the refund of this ammount back on my account? Thank you!!

    There are instructions on this page for managing and stopping auto-renewing subscriptions (deleting an app won't stop it) : http://support.apple.com/kb/HT4098
    In terms of a refund, what does it say on the app's description page in the store (a lot say that refunds aren't given) ? But you can try contacting iTunes Support and see if they will refund or credit you : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I have two Apple ID, how can I delete one and use the email address associates to the main one?

    I have two Apple ID, how can I delete one and use the email address associates to the main one?

    If you abandon one of the Apple IDs you will also basically be abandoning any content that you have acquired with that Apple ID. Content can only be updated and re-downloaded with the Apple ID that was used to buy it. Apple will not combine the content of Apple IDs and Apple will not transfer the content from one Apple ID to another Apple ID.

  • How can I uninstall Bootcamp and Recover the partition for the Mac HD

    How can I uninstall Bootcamp and recover the partition for the IMac HD?

    Boot into OSX.  Go back into the Bootcamp utility in the Utilities folder and re-run it.  It will give you the option to remove the Windows partition and make the OSX partition fill the whole drive again.  OSX will NOT be lost in the process.  No re-installing necessary.  Only takes a few minutes or less to complete.

  • I have recently changed to an iMac from a Windows PC. How do I delete files and format the memory card in my helmet cam?

    I have recently changed to an iMac from a Windows PC. How do I delete files and reformat the memory card in my helmetcam?

    If you return the memory card to the helmetcam, it may choose to reformat it before use; back to some FAT-16 or FAT-32 format many of these third-party cards and cameras use. Unless you were going to use it for Mac OS X and format it with HFS+ or in a partition map for Mac data, etc.
    If not, the easiest way to reformat the card may have been in the camera itself. I've formatted several kinds of camera cards, drives, USB flash drive, and others. The means varies with the intended purpose. Sometimes the default is the best; since it is platform neutral if the device is seen by both players.
    Good luck & happy computing!

  • HT2404 my hard drive crashed and nothing recoverable.  Apple installed a new drive.  How can I go back and download the apps I had purchased for my previous configuration, for instance Lion 10.7, and Photoshop Elements 10?

    My hard drive crashed and nothing recoverable, local Apple Store installed a new drive.  How can I go back and download the apps I had purchased for my previous configuration, for instance Lion 10.7, and Photoshop Elements 10?

    A blank drive needs to be formatted first, you do that hold c boot (or hold option key boot) from the 10.6 install disk (or Lion USB)
    Read how to format the drive in Disk Utility here
    https://discussions.apple.com/docs/DOC-3044
    How to install OS X
    https://discussions.apple.com/docs/DOC-3251
    Software Update fully,
    Hold the option key and click on Purchases when in MAS to download your 10.7 etc.

  • HT5312 Dear Apple , kindly i need to change my ID password but they want from me to answer two question but i forgot the answers , so i surprised that their is secure email and i didn't add it so how can change my password and change the secure email ,urg

    Dear Apple , kindly i need to change my ID password but they want from me to answer two question but i forgot the answers , so i surprised that their is secure email and i didn't add it so how can change my password and change the secure email ,urgent plz

    You a renot addressing Apple here at all.
    We are all itunes users just like you.

  • I bought the HD season version of breaking bad, however I only need the regular @ 19.95. How can I change this and get the difference refunded?

    bought the HD season version of breaking bad, however I only need the regular @ 19.95. How can I change this and get the difference refunded?

    When you purchase an HD video on a supported device or computer, only HD video will be downloaded. To download the SD version, you need to download the video again from your Purchased page. Conversely, if you purchase an HD video on an unsupported device, the SD version will be downloaded. Then, you will need to download the HD version from your Purchased page. Learn more about downloading previous purchases."
    iTunes: Purchasing and viewing HD videos

  • I am using itunes version 9.its not updating..Pls help as how can i update my itunes to the latest version??????

    i am using itunes version 9.its not updating..Pls help as how can i update my itunes to the latest version??????

    See this for Windows... http://support.apple.com/kb/TS1538
    and this for Mac OS X... http://support.apple.com/kb/TS1591

  • How can i update my iTunes to the latest version on window vista?

    how can i update my iTunes to the latest version on window vista?

    The same way it is updated on every other version of Windows, simply update the software.
    Help > Check for Updates.
    Apple Software Update > Check for Updates.
    http://www.apple.com/itunes/download then download and install the application.

  • How to read XML file and update the data in MS CRM 2011?

    Hi Folks,
    Can anyone please help me finding some references to read XML files and push the data to MS CRM 2011 preferably by using a console application.
    Please let me know if any ways of handling it in simple ways.
    Thanks,
    Sri

    HI,
    How to read XML file:
    https://social.msdn.microsoft.com/Forums/en-US/5dd7261b-86c4-4ca8-ba87-95196ef3ba50/need-to-display-xml-file-in-textboxes-edit-the-data-and-save-the-new-xml-file?forum=csharpgeneral
    How to work with CRM:
    ClientCredentials credentials = new ClientCredentials();
    credentials.Windows.ClientCredential = new System.Net.NetworkCredential("USER", "Password", "Domain");
    Uri uri = new Uri("http://server/Organization/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
    proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    IOrganizationService service = (IOrganizationService)proxy;
    //using "service" you can create, update and retrieve entities.
    More information here about service functions:
    https://msdn.microsoft.com/en-us/library/gg328198.aspx

Maybe you are looking for

  • Batch Determination with SLED Selection Using LOBM_RLZ

    Hi All, I am trying to determine Batches at the time of Goods Issue against Production Order (i.e. Movement Type 261). These are the steps I have used. 1. Created a Batch Class with Standard Characteristics LOBM_RLZ, LOBM_VFDAT, LOBM_LFDAT. 2. Assign

  • Flash Builder 4.5 for PHP trial expired in one week

    Hi, I downloaded Flash Builder 4.5 for PHP on 6th october. Due to some misunderstanding i uninstalled the Flash Builder 4.5 for PHP. Today when i installed it again, after installation i launched the flash builder and got a popup saying that the tria

  • How to assign DOT ( current context ) to a variable ?

    If i use XML dot (.) within Href , i am getting current context (http://servername/test) Like this --> <TD> <xsl:element name="a"> <xsl:attribute name="href">./</xsl:attribute> <xsl:value-of select="NAME" /> </xsl:element> </TD> But if i try to assig

  • G4's case door won't stay closed - any suggestions, please?

    Another question relating to my inherited Gigabit Ethernet G4's ongoing upgrades: I think fixing it so the blasted case door stayed shut w/o having to tape it would be a significant improvement, don't you? O.o When the computer belonged to my brother

  • S-user of customer

    Hello, Does the S-user of a customer have the right to download versions and patches of SAP business One? This S-user is used in the configuration of Remote support platform, however the software downloads fail. Thank you