Sorting of an Extract

I am sorting an extract using a field-group already defined in the extract. I am adding a field to the field-group at the end. But the extract is not getting sorted by that field. If I insert the field at the beginning of the field group all the subsequent AT NEW statements in the LOOP-ENDLOOP are getting executed as the field has different values for different records. This is logical to insert the feidl at the end only.
The field is also defined in HEADER of the extract. Thsi is regarding 'Cheque Printing' in ABAP. I also tried to add sort by the particular field statement after already inserting sort statement. The entire logic is going for toss in that case. Thsi is regardign a field-group AVIS if anybody knows about Cheque Printing.
please adise me how to achieve this? I want to sort the cheques as per line items in each cheque. the feild for line items is REGUH-RPOST

When you use INSERT statement, modify as follows
INSERT: REGUH-FIELD1 <b>'A'</b> REGUH-RPOST REGUH-FIELD3
        INTO header.

Similar Messages

  • Targeted Sorting and Page Extraction

    I am a teacher that regularly scans student assignments into PDF files. These files are randomly sorted pages that consist of the entire class' work. The goal is to sort the PDF document according to some tag that identifies individual page(s) as belonging to a particular student. Currently the only way I know to "tag" the pages is to manually create bookmarks named for the student but, there seems no way to sort the pages by bookmark. Can this be done with Javascript? The ultimate goal is to be able to automate the process of sorting the pages by student (once they are tagged) and extract each student's work and finally save those individual files into the student's folder. Is this possible?
    I'm currently using Acrobat X Pro on a Mac with OS X 10.8.

    I'm not sure what "experience in the field" means. If I list what my past experience is perhaps you can tell me if that qualifies. In a former life I programmed in ANSI C, ARexx, Perl, PerlTK, Visual Basic, Java, Javascript, Actionscript, and currently use XOJO as a cross-platform development environment. I used to write many in-house file parsing and batch graphics manipulation applications to process many thousands of files on Unix, Amiga, Mac, and Windows machines. So, I guess the question is – does the problem center around an understanding of programming fundamentals or are there some idiosynchratic details of Acrobat that are difficult to get around.
    Also, unfortunately, these pages would not benefit from OCR scanning. Manually tagging them is not a problem, in fact, setting bookmarks is quite easy. I wonder though, between bookmarks and other options like annotations, which are the easiest to access and manipulate programatically? And can they be used to sort the pages?

  • Extract audio ?

    Will someone please explain Extract Audio, Scroll to Playhead, Paste Over at Playhead, and Lock Audio at Playhead for me? When I don't understand a menu Option I am afraid to use it and have never tried any of them. I sort of understand Extract Audio but not Scroll to, Paste Over at, or Lock Audio at Playhead.
    Can audio be separated from picture and shifted in time? If so is it done by the clip or all clips in the timeline at one time?

    Hi Arthur!
    I cheated...I copied from the Help Section of iMovie ...
    Extracting the sound from a video clip
    Sometimes you may want to separate the audio track from a video clip. This is a good idea if you want to copy the audio to another location in your movie, or crop out any sounds. This technique is also useful if you recorded narration using your video camera and don't want to use the video.
    To extract sound from a video clip:
    Click the Timeline Viewer button (shown above).
    Select the video clip or clips whose audio you want to extract.
    Choose Advanced > Extract Audio.
    The extracted audio appears as a separate clip in audio track 1 of the timeline viewer.
    You can also adjust the volume of an extracted audio clip, move or copy it to a new location, change its length, and more.
    Cutting, copying, and pasting clips
    To copy or move your video and audio clips, you can use the Copy, Cut, and Paste commands, much as you do to edit text in a word-processing application. For example, you can use this technique to copy or move clips from the Clips pane to your movie, or to move clips around within a movie. You can also copy a video or audio clip from a different project into the one you're working on.
    To copy or move a clip:
    Select the clip or the part of it you want to cut or copy.
    To learn how to select part of a video clip, see Related Topics below.
    Do one of the following:
    To move the clip, choose Edit > Cut.
    To copy the clip, choose Edit > Copy.
    To paste the clip in your movie, move the playhead (shown below) where you want the clip to appear.
    Tip: If you want to paste the clip immediately after a specific clip in your movie or the Clips pane, select the clip you want it to appear after.
    Choose Edit > Paste.
    Note: When you position the playhead within a clip in your movie and choose Paste, the clip in your movie is split at the playhead and the pasted video (along with its soundtrack) or audio is inserted at that point. (Any video or audio that appears after the playhead is moved to the right in the clip or timeline viewer.)
    If you want to paste over existing video or audio in your movie, choose Advanced > "Paste Over at Playhead." The pasted clip replaces the existing video or audio to the right of the playhead instead of moving it to the right.
    Locking audio clips to video
    You can lock an audio clip to a particular point in a video clip so that when you move the video clip, the audio moves with it. This is useful if you want a sound effect, narration, or a song to always accompany a specific part of your movie.
    To lock an audio clip to video:
    If necessary, choose iMovie HD > Preferences, click General, and select the "Snap to items in Timeline" checkbox.
    Click the Timeline Viewer button (A, shown above).
    Drag the playhead (B, shown above) to the frame where you want the the audio to start.
    Tip: To precisely adjust the playhead position, press the Left or Right Arrow key to move the playhead one frame at a time. To move the playhead in ten-frame increments, hold down the Shift key while pressing the arrow key.
    Drag the audio clip so that its starting point lines up with the "ghosted" playhead (shown below).
    A yellow line appears and the edge of the clip automatically "snaps" against the edge of the "ghosted playhead" when you reach the frame you selected in step 3.
    Choose Advanced > "Lock Audio Clip at Playhead."
    Yellow "push pins" indicate that the audio is locked to the video.
    To unlock the audio, select the clip and choose Advanced > Unlock Audio Clip.
    Note: You can still change the location of a locked audio clip by dragging it. However, the video clip does not move with it, and iMovie automatically locks the audio clip to its new location.
    :)Sue
    iMac ppcG5 1.8 GHz 20FP & (2)iMac G4 800MHz 17FP   Mac OS X (10.3.9)   OS X 10.4.6 / iLife 4,5,6 Superdrives & 1 G RAM / QT6 pro

  • Coldfusion 64 bit windows installer stops working after recent microsoft update

    Coldfusion 64 bit windows installation stops working after recent microsoft updates and how I worked around it.
    My question is at the end.
    Trying to deploy coldfusion 9 enterprise 64 bit trial  version onto a Windows 2003 64 bit datacenter OS with all OS updates from MS (as of 4-7-2011).
    Steps taken (remember, this is all 64 bit):
    1. Installed the base OS which was slipstreamed with SP2.
    2. Checked w/ microsoft and installed 63 OS updates.
    3. Launch the CF9 trial exe.
    4. As soon as the first screen finishes (the one that looks like  it is extracting files) then the second screen pops up (the one that  simply says CF Adobe Coldfusion 9) and the progress bar quickly moves  95% to the right and the install application quits. No error, no nothing. No log file either.
    5. After a moment of incredulous silence (and retrying/rebooting,  etc), I started to google it. I found nothing. However, I did find a  post (thanks dspent!) that was helpful in that it told how he was able  to get at a log file of sorts, by pre-extracting the  coldfusion_9_WWE_win64.exe file and launching the adobe_cf.exe by hand.  (Dspent's install snafu was different than mine, but his post was very  valuable and got me started in the right direction.)
    6. Got a copy of rarunzipper and extracted the coldfusion_9_WWE_win64.exe file.
    7. From the windows directory created by step 6, I launched adobe_cf.exe.
    8. Same thing (the install application quits. No error, no nothing. No log file either.).
    9. I examine the hs_err_pidxxxx.log file (where the xxxx is a number).
    10. I see inside that file an ominous message: "A fatal error has been detected by the Java Runtime" then "Problematic frame ntdll.dll" and then "The crash happened outside the Java Virtual Machine in native code".
    11. OK, so now I am thinking ntdll.dll !! Native code !! It is like Java is telling me that for some reason it can't dance with the OS.
    12. On a hunch, I decided to test a CF install again on a server with just the base install of W3K3 64 SP2 (ie: skipping step 2 above this time).
    13. Bingo! That install works.
    14. Therefore, one of the 63 patches I had downloaded from MS had triggered a problem with the CF installer.
    15. Back on the first server (the one with the MS security  patches installed and the one that CF won't install on). In the CF file  adobe_cf.lax (one of the files extracted in step 6) there is a line that  mentions where the install gets it's java. Find that file, and check java version installer is using. It is using 1.6.0_14-b08.
    16. Off to the Java website, and there is a newer version of java (1.6.0_24-b07). Downloaded and installed it.
    17. Modify a line in adobe_cf.lax :
       before
         lax.nl.current.vm=resource\\jre\\bin\\java.exe
       after
         lax.nl.current.vm=C:\\program files\\java\\jre6\\bin\\java.exe
    (that assumes that you let step 16 install to the default location)
    Save the file.
    18. Run the install ... ** IT WORKS ** !
    Obviously, the built in java provided with the CF installer is  no longer compatible with some change introduced by some recent MS  update on the W2K3 64b SP2 platform.
    And now the interesting part. Although I forced the installer to used the new java, it did not incorporate it into the cf build (ie: in jvm.config, you still see c:/coldfusion9/runtime/jre AND the  version of java.exe that is in that directory is the original version,  not the newer version I forced the installer to use).
    On the surface, CF seems to run OK, but I have not done any application testing yet.
    And finally my
    ** QUESTION **
    Would it be appropriate to simply point the java.home var to the new java directory? I see that the directory structures and files are not exactly the same  (close though) so I certainly don't want to break things by doing this,  but instinct tells me that if the installer broke using the older  version, then something else is gonna break down the road if I don't use  the new version. On the other hand, the differences in the  directories and files is enough that it makes me very nervous, with my  limitied java skill set, to make this decision. 
    Thanks in advance!!
    Byron

    Hi Byron,
    Wow great post no doubt much of the information will be useful for those on Win03 SP2 +. Have to say not come across similar problem on Win08 r2 SP1 +.
    So to your question. Adobe security bulletin (http://kb2.adobe.com/cps/894/cpsid_89440.html) recommends running CF8 and CF9 with JVM 1.6.0_24. The bulletin does not say how to do that. I take you installed JDK and not just JRE 1.6.0_24? Post install of JDK follow these steps:
    Stop CF - SERVICES.msc stop "ColdFusion 9 Application Server".
    Take a copy of CF\runtime\bin\jvm.config - so you got a backup.
    Edit CF\runtime\bin\jvm.config find line "java.home=" and comment it out eg:
    #java.home=C:/ColdFusion9/runtime/jre
    Add new line like so and save jvm.config:
    java.home=C:/Program Files/Java/jdk1.6.0_24/jre
    Note  there the slashes and the location of the JRE (runtime) - you need to  point to the one in JDK because the other JRE in C:\Program  Files\Java\jre6 will be missing a DLL.
    Start CF via SERVICES.msc.
    HTH, Carl.

  • At new and at end of statement

    how to use AT NEW and AT END OF
    efficiently,kindly give some solid examples.
    thanks!!

    Now say, u have internal table with mateirals....there are 100 records with 10 mterials...
    loop at it_matnr.
      at new matnr.
        <b>write code</b>
      endat.
      <b>write code.</b>
      at end of matnr.
         <b>write code</b>
      endat.
    endloop.
    Check this which is explained...
    Control Level Processing
    When you perform a sort using the SORTstatement, control levels are defined in the extract dataset. For general information about control levels, refer to Processing Internal Tables in Loops The control level hierarchy of an extract dataset corresponds to the sequence of the fields in the header field group. After sorting, you can use the ATstatement within a LOOP loop to program statement blocks that the system processes only when the control level changes.
    AT NEW f | AT END OF f.
    ENDAT.
    A control break occurs when the value of the field f or a superior field in the current record has a different value from the previous record (AT NEW) or the subsequent record (AT END). Field f must be part of the header field group.
    If the extract dataset is not sorted, the AT - ENDAT block is never executed. Furthermore, all extract records with the value HEX null in the field f are ignored when the control breaks are determined.
    The AT... ENDAT blocks in a loop are processed in the order in which they occur. This sequence should be the same as the sort sequence. This sequence must not necessarily be the sequence of the fields in the header field group, but can also be the one determined in the SORT statement.
    If you have sorted an extract dataset by the fields f1, f2, …, the processing of the control levels should be written between the other control statements in the LOOP loop as follows:
    LOOP.
      AT FIRST.... ENDAT.
        AT NEW f1....... ENDAT.
          AT NEW f2....... ENDAT.
              AT fgi..... ENDAT.
              Single record processing without control statement
          AT END OF f2.... ENDAT.
        AT END OF f1.... ENDAT.
      AT LAST..... ENDAT.
    ENDLOOP.
    You do not have to use all of the statement blocks listed here, but only the ones you require.
    REPORT demo_extract_at_new.
    DATA: t1(4) TYPE c, t2 TYPE i.
    FIELD-GROUPS: header.
    INSERT t2 t1 INTO header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 2. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 2. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 1. EXTRACT header.
    t1 ='AAAA'. t2 = 3. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    SORT BY t1 t2.
    LOOP.
      AT FIRST.
        WRITE 'Start of LOOP'.
        ULINE.
      ENDAT.
      AT NEW t1.
        WRITE / '   New T1:'.
      ENDAT.
      AT NEW t2.
        WRITE / '   New T2:'.
      ENDAT.
      WRITE: /14 t1, t2.
      AT END OF t2.
        WRITE / 'End of T2'.
      ENDAT.
      AT END OF t1.
        WRITE / 'End of T1'.
      ENDAT.
      AT LAST.
        ULINE.
      ENDAT.
    ENDLOOP.
    This program creates a sample extract, containing the fields of the header field group only. After the sorting process, the extract dataset has several control breaks for the control levels T1 and T2, which are indicated in the following figure:
    In the LOOP loop, the system displays the contents of the dataset and the control breaks it recognized as follows:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9f1f35c111d1829f0000e829fbfe/frameset.htm

  • Export command to back up data

    Dear All
    I am developing a system for a store system, and I want to use the export command to let the user back up the data , but I have those four questions:-
    1. Is using the export command a good practice for doing the back up process?
    2. At what time in the day the customer should do the back up for his system?
    3. let say he will do the back up at the end of each working day , then could he only back up the new data that have not been backed up before, or he always should back up all the data in the database regardless if this data were backed up before.
    4. And if the user do a back up for his work at the end of each day then what will happen if the system crashed during a working day, will he lose the data that have been updated and not backed up before?

    An export backs up the data, not the database. That's the fundamental difference between a 'logical' and a 'physical' export. Instead of copying files (from disk to disk or disk to tape), you are selecting out the data that has been previously inserted into the database.
    There's nothing wrong with that as such, but it doesn't scale: selecting out 100 million rows is going to take about 100 times as long as selection out just 1 million. That's why you heard that export was OK as a backup mechanism for small databases: for large databases, it's a non-starter, simply because it would take days to select all the data out (and even longer to insert it all back again). On the other hand, physical backups do scale to a certain extent, because a lot of data files are mostly empty space for a lot of the time. So a 100GB database could probably be storing 1 million rows or 10 million rows or even (at a pinch) 100 million rows: data files don't grow every time you insert a new row, in other words. So almost regardless of how much data you are storing in the database, the time taken to back it up isn't going to vary that much. (There will be periodic points, of course, where you fill all available space and make the database jump in size by an increment... but between two of those points, you can keep piling the records in and the database size won't change).
    So that's one thing: export doesn't scale.
    Second big thing is that once you start dealing with rows of data, you've completely lost the ability to recover things using Oracle's entirely physical recovery mechanism. That is, with a physical backup of a datafile made on Sunday night, and a record of all the changes done to data on Monday, Tuesday and Wednesday (called redo), if I lose a datafile on Thursday morning, I can restore that one file from Sunday's backup, replay all the data changes in the redo stream and get my entire database back up and running exactly at the point it had gotten to when the datafile was damaged. That's called a complete recovery and it is such a reliable and robust mechanism that you are guaranteed not to lose any committed data using it: you get everything back (so long as you keep all your redo since your last backup).
    But that guarantee only applies when you are taking physical copies of data files and storing redo in physical redo logs. If, instead, you are storing rows of data in export dump files, then that mechanism doesn't apply to you at all.
    So, if you export a big table on Sunday, do lots of transactions to it on Monday, Tuesday and Wednesday, and then accidentally drop or damage the table on Thursday, the best you can do is import the table from Sunday's export... and that is it. You cannot apply the Monday, Tuesday and Wednesday redo to that restored table data. You cannot roll the table forward in time. Therefore, you lose all the committed data that was entered into that table on those three days.
    Export is, in other words, a snapshot technology: you have replicas of your data as they were at some point in the past. You can always "restore" that snapshot, but that is as good as the recovery gets.
    That's a big issue. It means that if you care about your data at all, or at least value it enough not to want to lose any of it, you cannot rely on export as a way of backing it up. If export is your only backup mechanism, you will lose data. That's a promise, incidentally: it absolutely will happen one day. It's not a 'maybe', just a question of time.
    If you only did physical file copies, though, you would not lose data (again, always assuming you look after that stream of redo).
    On the other hand, there are times when you positively want to extract data out of one database and re-insert it into another -such as when you decide your database was created using the wrong block size, for example. In those circumstances, physical backups don't help (because they simply copy the 'wrong' block size around the place). But an export does exactly what's required: separating the data from the physical files its normally stored in, and so is very handy for that sort of situation. Similarly, if I need to preserve one table for audit purposes, copying the entire 16GB data file in which it's 1000 records are stored is not a very efficient way of doing that! The fact that export works on an object-by-object basis, rather than a file-by-file one, means it's perfect for that sort of data extraction job.
    Think of export, therefore, more as a system utility that happens to involve copying data. Yes, a copy can come in handy when disaster strikes and all else fails, but that's not its principle purpose. It might be sufficient functionality to provide the level of data protection you need, but it doesn't and cannot provide complete data protection, because it lacks that essential 'roll-forwardability' that physical backups (datafile copies) have.

  • Developing a Sales Forecasting Report

    Hi BI Gurus,
    I am an basically an ABAP consultant and recently moved into BI Team.
    I have got an requirement of developing an Sales Forecating report in BI.
    The Report will be based on Regions and Front end units we need to display estimated Sales value for that month and the Key Figures will be:
    1. Month to Date Gross Sales (in SAP  VBAK-NETWR).
    2. Sales value of Orders which are Shipped & Not Invoiced
    3. Sales value of Orders with Planned GI and Not Shipped.
    4.Sales Value of Open Orders which have Promised Dates within this month.
    Please help me to get these field values on my report. I checked a couple of Infoproviders: ZSD_002 & ZSD_019 but could not find them all.
    Regards,
    Daniel

    Daniel-
    That sounds like a custom requirement, and your ABAP development skillset will help you significantly. Most analyses of this sort involve 'snapshot' extraction programs in R/3 that are executed ever night and write to a Z table in R/3. Once the data is provided, THEN the BW magic takes place.
    You'll need to learn how to use SBIW to develop a datasource from your Z Table.
    You'll then need to replicate the datasource to your BW system, create an infosource, then create an appropriate data transformation process, create an info cube or DSO(depending on data volume and requirements), and then, and only then, can you think about creating a query (Not a 'report'... BW is not a 'Reporting Tool', it's an Analytic tool).
    Now... there might be a similar infoprovider already in your BW system. Look around and ask around (sounds like you already have, but check again.) There also might be a bit of SAP Business Content that fits your needs, but probably not. Most companies have configured and customized their business processes rather extensively, and most SAP Business content doesn't fit the various exceptions and exits.
    Of course, SAP has some excellent classes. BW310 comes to mind at this point.
    Good luck !

  • Descending sortation in a planning book

    Hello,
    I have one question concerning handling of the planning book:
    Is it possible to get a sortation with a descending amount of the key figures in the data view of a planning book?
    What sorting options are there in a planning book?
    Thanks for answering!
    Kind regards
    Heinz

    Hello Heinz,
    As Rishi already mentioned, it's not possible to do a sorting of data in planning views.
    I can think of following options if you want to see sorted data:
    1) You could download the data to excel and do this manually.
    2) Through a custom report you could read/display the KF data using function modules, and then sort it as per your requirement.
    3) It would also be possible to do sorting when you extract this data in some BW report. Bw report would allow you to do sorting.
    4) If you have a backup cube, then you can display backup data in the cube and do a sorting as per your requirement.
    Hope this helps.
    Regards - Pawan

  • Upgraded to Windows 8.1 broke Flash/AIR/ANEs

    Here is the problem, been using Flash/AIR for years to build AIR powered apps. Recently built a new system running Windows 8.1
    I transfer all my work over from the old Windows 7 machine and open up the .fla files, fix the links and test the file, here is the error.
    The content cannot be loaded because there was a problem loading an extension: Error: Requested extension com.distriqt.Camera could not be found.
    XPath error : Invalid expression
    /userSettings/victims/*[exact_name='adl.exe']/(null)[1]/*[1]
                                                  ^
    XPath error : Invalid expression
    /userSettings/victims/*[exact_name='adl.exe']/(null)[1]/*[1]
                                                  ^
    XPath error : Invalid expression
    /userSettings/victims/*[exact_name='flash.exe']/(null)[1]/*[1]
                                                    ^
    XPath error : Invalid expression
    /userSettings/victims/*[exact_name='flash.exe']/(null)[1]/*[1]
                                                    ^
    XPath error : Invalid expression
    /userSettings/default/(null)[1]/*[1]
                          ^
    XPath error : Invalid expression
    /userSettings/default/(null)[1]/*[1]
    So seems like the .ane files are breaking the file somehow. So I make a blank file with nothing on it and it runs. Then I just add the .ane file into the publish settings and that breaks the app.
    Anyone have any clue what is causing this. Is there some inherent incompatibility between AIR or ANEs and Windows 8.1? BTW I tested with the latest SDK 15.0.0.302 both in CC and CC2014.

    Well switched back to Windows 7 and all seems to be working but had the same issue at first. My guess is that it was caused by the old files looking for something from the OLD machine in the C:\Users\UserName\AppData\Local\Temp folder. When this error originally came I up I went and found the files it was asking for on the old machine and copied to the new. This I believe is where the error above started causing issues, the .fla was looking for some sort of old extracted versions of the file which it was not finding due to new drive paths and only when I switched to 7 and instead of copying old files over, I deleted the folder it was looking for, did I resolve this although I am still not 100% certain that was the case. I also had issues with Flash not recognizing plugged in devices when trying to publish to device and going back to 7 solved this as well so I think Ill stick to 7 for now till 10 comes out but I wrote this up in case someone one day runs int this problem.

  • Extracting and Sorting a Number in a Text field

    Hi everybody,
    I have a column in LOAN_DTL Table as LOAN_DESC which contains data like this:
       CUSTOMER LOAN A/C : CAR  10.00%
       CUSTOMER LOAN A/C : CAR 11
       CUSTOMER LOAN A/C - HOUSE 15.5%
       CUSTOMER LOAN ACCOUNT - CAR 5.50%
       CUSTOMER LOAN A/C - CAR 9%
       CUSTOMER LOAN ACCOUNT : HOUSE 10%
       CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
       CUSTOMER LOAN ACCOUNT : HOUSE 7.75
       CUSTOMER LOAN A/C : HOUSE 6.00
    From the above data, I need to extract the Group i.e. CAR, HOUSE etc. and sort the Group on Rate of Interest order as below :
              CUSTOMER LOAN ACCOUNT - CAR 5.50%
              CUSTOMER LOAN A/C - CAR 9%
              CUSTOMER LOAN A/C : CAR  10.00%
              CUSTOMER LOAN A/C : CAR 11
              CUSTOMER LOAN A/C : HOUSE 6.00
              CUSTOMER LOAN ACCOUNT : HOUSE 7.75
              CUSTOMER LOAN ACCOUNT : HOUSE 10%
              CUSTOMER LOAN A/C - HOUSE 15.5%
              CUSTOMER LOAN A/C : PERSONAL LOAN 8.50
    How to go about the above ?

    Like this?
    SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
    FROM loan_dtl
    ORDER BY 1,
             DECODE(loan_desc,
                    loan_desc,
                    TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
    Message was edited by: 000000

  • Sort a Table with data extracted form Another table

    I have a MAster Table that consist of many columns of data. I have extracted data (rows) from the table to another table for a list. I used vlookup to get the extracted data. In my new table everything is list ed out perfectly. I want to sort the table using one of the columns. I tried the reorganize button and just sorting on that one column and it won't sort. I know I'm doing something wrong whether the way I am extracting the data,or something else. Do I use lookup and large or small function to list and sort it from the main table? I stumped. Anybody have sugestions?

    Hi tj,
    "The Master file is the second image. I have extracted the data for the second table(second image). "
    Hmmm...
    Both tables are the second image. Good trick!
    Good thing you included the description.
    The (modified) Master table is Table 1 on Sheet 15. From this, you are extracting the participants for "R & B Winter Sk8 Jam. You want the extracted rows to be displayed on the Contestant Sheet table sorted by Division.
    I see two possible lines of attack here:
    The simplest might be to presort the Master table on Division, then within that sort, on last name, then on first name. With the Master table in that order, extracting the data using the index you are currently using should pull the rows in the desired order.
    Construct an index of numerical values constructed from the sum of:
    -- a very large number corresponding to the event, pulled from a Lookup table.
    -- a large numbers corresponding to the division, pulled from a second Lookup table.
    -- a small number corresponding to he count (from the top of the main tale to the current row) of Sk8ers entered in each event. (This, I think, would be the same as the count in your Index column.)
    Retrieval would be done using RANK to determine the smallest and largest index values to retrieve, and SMALL to collect data from the rows with index values within that range.
    No. 2 is at the concept stage, and is open to anyone wanting to give it a go.
    Regards,
    Barry

  • [Mostly Sorted] Extracting tags - regexp_substr and count help needed!

    My original query got sorted, but additional regexp_substr and count help is required further on down!
    Hi,
    I have a table on a 10.2.0.3 database which contains a clob field (sql_stmt), with contents that look something like:
    SELECT <COB_DATE>, col2, .... coln
    FROM   tab1, tab2, ...., tabn
    WHERE tab1.run_id = <RUNID>
    AND    tab2.other_col = '<OTHER TAG>'(That's a highly simplified sql_stmt example, of course - if they were all that small we'd not be needing a clob field!).
    I wanted to extract all the tags from the sql_stmt field for a given row, so I can get my (well not "mine" - I'd never have designed something like this, but hey, it works, sorta, and I'm improving it as and where I can!) pl/sql to replace the tags with the correct values. A tag is anything that's in triangular brackets (eg. <RUNID> from the above example)
    So, I did this:
    SELECT     SUBSTR (sql_stmt,
                       INSTR (sql_stmt, '<', 1, LEVEL),
                       INSTR (substr(sql_stmt, INSTR (sql_stmt, '<', 1, LEVEL)), '>', 1, 1)
                       ) tag
    FROM       export_jobs
    WHERE      exp_id =  p_exp_id
    CONNECT BY LEVEL <= (LENGTH (sql_stmt) - LENGTH (REPLACE (sql_stmt, '<')))Which I thought would be fine (having tested it on a text column). However, it runs very poorly against a clob column, for some reason (probably doesn't like the substr, instr, etc on the clob, at a guess) - the waits show "direct path read".
    When I cast the sql_stmt as a varchar2 like so:
    with my_tab as (select cast(substr(sql_stmt, instr(sql_stmt, '<', 1), instr(sql_stmt, '>', -1) - instr(sql_stmt, '<', 1) + 1) as varchar2(4000)) sql_stmt
                    from export_jobs
                    WHERE      exp_id = p_exp_id)
    SELECT     SUBSTR (sql_stmt,
                       INSTR (sql_stmt, '<', 1, LEVEL),
                       INSTR (substr(sql_stmt, INSTR (sql_stmt, '<', 1, LEVEL)), '>', 1, 1)
                       ) tag
    FROM       my_tab
    CONNECT BY LEVEL <= (LENGTH (sql_stmt) - LENGTH (REPLACE (sql_stmt, '<')))it runs blisteringly fast in comparison, except when the substr'd sql_stmt is over 4000 chars, of course! Using dbms_lob instr and substr etc doesn't help either.
    So, I thought maybe I could find an xml related method, and from this link:get xml node name in loop , I tried:
    select t.column_value.getrootelement() node
      from (select sql_stmt xml from export_jobs where exp_id = 28) xml,
    table (xmlsequence(xml.xml.extract('//*'))) tBut I get this error: ORA-22806: not an object or REF. (It might not be the way to go after all, as it's not proper xml, being as there are no corresponding close tags, but I was trying to think outside the box. I've not needed to use xml stuff before, so I'm a bit clueless about it, really!)
    I tried casting sql_stmt into an xmltype, but I got: ORA-22907: invalid CAST to a type that is not a nested table or VARRAY
    Is anyone able to suggest a better method of trying to extract my tags from the clob column, please?
    Message was edited by:
    Boneist

    I don't know if it may work for you, but I had a similar activity where I defined sql statements with bind variables (:var_name) and then I simply looked for witch variables to bind in that statement through this query.
    with x as (
         select ':var1
         /*a block comment
         :varname_dontcatch
         select hello, --line comment :var_no
              ''a string with double quote '''' and a :variable '',  --:variable
              :var3,
              :var2, '':var1'''':varno'',
         from dual'     as string
         from dual
    ), fil as (
         select string,
              regexp_replace(string,'(/\*[^*]*\*/)'||'|'||'(--.*)'||'|'||'(''([^'']|(''''))*'')',null) as res
         from x
    select string,res,
         regexp_substr(res,'\:[[:alpha:]]([[:alnum:]]|_)*',1,level)
    from fil
    connect by regexp_instr(res,'\:[[:alpha:]]([[:alnum:]]|_)*',1,level) > 0
    /Or through these procedures
         function get_binds(
              inp_string in varchar2
         ) return string_table
         deterministic
         is
              loc_str varchar2(32767);
              loc_idx number;
              out_tab string_table;
         begin
              --dbms_output.put_line('cond = '||inp_string);
              loc_str := regexp_replace(inp_string,'(/\*[^*]*\*/)'||'|'||'(--.*)'||'|'||'(''([^'']|(''''))*'')',null);
              loc_idx := 0;
              out_tab := string_table();
              --dbms_output.put_line('fcond ='||loc_str);
              loop
                   loc_idx := regexp_instr(loc_str,'\:[[:alpha:]]([[:alnum:]]|_)*',loc_idx+1);
                   exit when loc_idx = 0;
                   out_tab.extend;
                   out_tab(out_tab.last) := regexp_substr(loc_str,'[[:alpha:]]([[:alnum:]]|_)*',loc_idx+1);
              end loop;
              return out_tab;
         end;
         function divide_string (
              inp_string in varchar2
              --,inp_length in number
         --return string_table
         return dbms_sql.varchar2a
         is
              inp_length number := 256;
              loc_ind_1 pls_integer;
              loc_ind_2 pls_integer;
              loc_string_length pls_integer;
              loc_curr_string varchar2(32767);
              --out_tab string_table;
              out_tab dbms_sql.varchar2a;
         begin
              --out_tab := dbms_sql.varchar2a();
              loc_ind_1 := 1;
              loc_ind_2 := 1;
              loc_string_length := length(inp_string);
              while ( loc_ind_2 < loc_string_length ) loop
                   --out_tab.extend;
                   loc_curr_string := substr(inp_string,loc_ind_2,inp_length);
                   dbms_output.put(loc_curr_string);
                   out_tab(loc_ind_1) := loc_curr_string;
                   loc_ind_1 := loc_ind_1 + 1;
                   loc_ind_2 := loc_ind_2 + length(loc_curr_string);
              end loop;
              dbms_output.put_line('');
              return out_tab;
         end;
         function execute_statement(
              inp_statement in varchar2,
              inp_binds in string_table,
              inp_parameters in parametri
         return number
         is
              loc_stat dbms_sql.varchar2a;
              loc_dyn_cur number;
              out_rows number;
         begin
              loc_stat := divide_string(inp_statement);
              loc_dyn_cur := dbms_sql.open_cursor;
              dbms_sql.parse(c => loc_dyn_cur,
                   statement => loc_stat,
                   lb => loc_stat.first,
                   ub => loc_stat.last,
                   lfflg => false,
                   language_flag => dbms_sql.native
              for i in inp_binds.first .. inp_binds.last loop
                   DBMS_SQL.BIND_VARIABLE(loc_dyn_cur, inp_binds(i), inp_parameters(inp_binds(i)));
                   dbms_output.put_line(':'||inp_binds(i)||'='||inp_parameters(inp_binds(i)));
              end loop;
              dbms_output.put_line('');
              --out_rows := DBMS_SQL.EXECUTE(loc_dyn_cur);
              DBMS_SQL.CLOSE_CURSOR(loc_dyn_cur);
              return out_rows;
         end;Bye Alessandro
    Message was edited by:
    Alessandro Rossi
    There is something missing in the functions but if there is something that may interest you you can ask.

  • Extract organization by sorting date

    hi
    An employee in an org. can be in different units in different time.I want to extract the employees organization in which he is currently working with.
    MANDT PERNR ENDDA      BEGDA      UNAME  PERSK    ORGEH    PLANS    STELL
      200       3 31.12.9999 24.02.2009 122910 11    10100519 50001466 80000301
      200       3 23.02.2009 01.11.2008 106953 11    10100519 50001466 80000301
      200       3 31.10.2008 01.10.2008 106953 10    10100463 50000005 80000002
      200       3 30.09.2008 04.09.2008 106953 10    10100008 50002108 80000404
    I have to extract ORGEH corresponding to latest DATE i.e. ENDDA
    How to sort the date ?
    Sachin

    Hi,
    After fectching the records from infotype 0001.
    if not itab[] is initial.
    Sort itab by pernr begda descending.
    delete adjacent duplicates from itab comparing pernr.
    endif.
    So you will get latest record for each pernr.
    Regards,
    Kumar Bandanadham.

  • Extracting and sorting AVCHD Clips

    I just got a Panasonic Lumix GH3 camera. I took shots for several different projects all on the same SD card. I want to separate the clips into the corresponding project folders on my computer so that I can label the clips and import and edit them later in Premiere. When I insert the SD card, I click on private and the AVCHD file. I dragged and dropped the whole file onto myu desktop and then opened it. I then tried to drag and drop the individual files to the folders, but it doesn't work. I don't want to import the whole file into Premiere because the clips are from several different projects. How can I extract the clips out to sort them before working with them in Premiere?

    Like this?
    SELECT loan_desc,REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+%?') extract_string
    FROM loan_dtl
    ORDER BY 1,
             DECODE(loan_desc,
                    loan_desc,
                    TO_NUMBER(REGEXP_SUBSTR(loan_desc,'[[:digit:],.]+')));
    Message was edited by: 000000

  • Extract date modified for sorting and renaming

    I am new to the area of XMP data so bare with this inquiry..
    I am trying to sort a lot of pictures by their actual modified date versus the date modified that shows in the file browser of my os ( mac os x).
    Is there a way to extract the actual date modified from within the Description metadata of an image and then use that information to sort and then rename the pictures?
    I can see in Adobe Bridge that the data modified is captured and this would actually tell me the correct sequence the pictures should be in. If I had that information I could then sort and determine a renaming scheme to name the sequence and use that in various xml data feeds.
    Or is there a way I can access the data through xml. Perhaps through XML I can load the images in order to the resulting file ( in this case a flash movie.)
    Thanks in advance for thoughts on this...
    Suz

    Greetings,
                 I have produced such a command line tool a long time ago that should do this, I have recently re-released the tools. Even though, the tools are still in BETA stage, you can get them here:
    http://www.optimasc.com/products/dex/index.html
    Look for the renameto.exe tool in the bin directory after installation.
    Please do a backup of your files, since its still BETA!
    Good luck!
    Carl Eric Codère
    http://www.optimasc.com

Maybe you are looking for

  • I cannot add music to my iPhone 5

    This has been a problem for a few months and I have spent the past few days trying every variation I can think of from this thread iPhone 5 won't sync music from my iTunes library I cannot restart my phone either because my sleep/wake button is broke

  • Transferring all music from ipod to new computer with Windows Vista

    I need help!!! I recently bought a new computer that has windows vista, and I do not have access to my old computer. I have tried following the online help but I cannot figure out how to transfer all of my music files from my nano to this new compute

  • How to apply a Character Style that's already been made in a template document?

    First of all I'd like to thank everyone that helps. I'm a complete beginner at scripting and appreciate all your help. I'm basically using GREP expressions to find patterns in a document and apply a Character Style which has already been made. This C

  • Function module to predict the date for a given date

    hi friends, is there any function module to predict the date means  for example if i enter one date  , what will be the date after 4 months(say)  to the given date. my requirement is when a person is hired today (10.06.2008) and if he is under probat

  • Shutting off....only when plugged in.

    I know there are a lot of posts out there about the ibook shutting off, but mine has some peculiarities I didn't see in others, so before I take my computer apart as was the conclusion here http://discussions.apple.com/thread.jspa?threadID=1082138&ts