Getting top record

Hi all
I'm writing a job using Data Services and need to get top 1 record in my query object. Unfortunately there is no other way, like Max or min doesn' mean to my senario. How can I get the first record like what we have in SQL Server as Select top 1 ....
Thanks for your help in advance.

Another option is to add a new column to your query transform, call it ROWNUM, and use gen_row_num() as the mapping.
Then add a second query transform and include "ROWNUM=1" in the where clause.
Make sure you include any sorting in the first query transform.
Manoj's SQL transform solution will probably be faster, but this one will work for any kind of data source, not just SQL Server.

Similar Messages

  • How to get latest record on top of the result list

    Hi Gurus,
    How to get latest record on top of the result list when you open the record.
    saved data method in BT120H_CPL of OverView page and result list in ICCMP_INBOX.
    Regards,
    Ravi

    Hi
    Try sort descending by on fileld "changed at ".
    manipulate the sort depends on your requirement
    Regards
    Logu

  • How to get top 10 records for each option in table prompt?

    Hi,
    I have created one report in which my requirement is to get top 10 highest salaries for each departments. I have created one table prompt which contains the names of all departments. On the salary column I have applied one filter i.e. TOP 10. Currently I am having 3 departments. I want to show the top 10 salaries for each department, but I am getting top 3 from first, 4 from second and 3 from third.They are calculating top 10 salaries based on all departments, not on individual department. How can I get top 10 salaries for each department?

    Hi,
    Use TopN function in your column formula.
    Ex: TOPN("Sales ,5 BY department)
    Thanks,
    Satya

  • How can I get Video Recording! on my Blackberry curve 8320 ???????????? HELP PLEASSEEEEE

    Hi, Im a bet stressed out i just got the blackberry Curve 8320 from Tmobile and realized it has no Video recording however the person that sold it to me says they downloaded a program like a converter or something and they used to have video recording on it.  Can you please tell me how i can get video recording on mine Please. Thank you.

    to use video you need an upgrade. The name is handheld device software OS. I believe you have 4.2. 4.5 is required.
    You have to wait for TMobile to release the 4.5 OS.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Getting checked records

    Hi All,
    For when ‘UPDATE’, I need to get all the checked records from itab_output. Can some one please help me with getting checked records.
    Thanks,
    Veni.
       select docnum segnam segnum sdata from edid4 into table itab_edid4
                         for all entries in itab_edidc
                         where docnum = itab_edidc-docnum
                         and segnam in ('E1BPAD1VL', 'E1BPAD1VL1').
        sort itab_edid4 by docnum.
        commit work.
        loop at itab_edid4.
          t_itab_edid4-docnum = itab_edid4-docnum.
          t_itab_edid4-segnam = itab_edid4-segnam.
          t_itab_edid4-segnum = itab_edid4-segnum.
          t_itab_edid4-sdata =  itab_edid4-sdata.
          t_itab_edid4-sndprn = itab_edidc-sndprn.
          append: t_itab_edid4.
        endloop.
        perform process_data.
        PERFORM output.
      else.
        set pf-status 'NORM'.
        write: /05 '********* NO DATA FOUND **************'.
      endif.
    Event TOP-OF-PAGE.
    top-of-page.
      perform headings.
    top-of-page during line-selection.
      case sy-ucomm.
        when 'SELE'.
          perform headings.
      endcase.
    at user-command.
      case sy-ucomm.
        when 'SELE'.
         sy-lsind = 1.
          set pf-status 'NORM'.
          if chk = 'X'.
            chk = ' '.
          elseif chk = ' '.
            chk = 'X'.
          endif.
          perform output.
        when 'UPDATE'.
          DESCRIBE TABLE itab_output LINES lv_cnt.
      endcase.
          FORM process_data
    form process_data.
      loop at t_itab_edid4 where segnam = 'E1BPAD1VL'.
        move t_itab_edid4-sdata to itab_e1bpad1vl.
        itab_output-name_2 = itab_e1bpad1vl-name_2.
        condense itab_e1bpad1vl-name_2 no-gaps.
        lv_no = strlen( itab_e1bpad1vl-name_2 ).
        lv_no = lv_no - 4.
        if lv_no ge 5.
          move itab_e1bpad1vl-name_2+lv_no(4) to lv_storeno.
        endif.
        itab_output-name = itab_e1bpad1vl-name.
        itab_output-storeno = lv_storeno.
        itab_output-name_3 = itab_e1bpad1vl-name_3.
        itab_output-name_4 = itab_e1bpad1vl-name_4.
        itab_output-city = itab_e1bpad1vl-city.
        itab_output-city_no = itab_e1bpad1vl-city_no.
        itab_output-postl_cod1 = itab_e1bpad1vl-postl_cod1.
        itab_output-transpzone = itab_e1bpad1vl-transpzone.
        itab_output-street = itab_e1bpad1vl-street.
        itab_output-str_suppl1 = itab_e1bpad1vl-str_suppl1.
        itab_output-country = itab_e1bpad1vl-country.
        itab_output-extens_1 = itab_e1bpad1vl-extens_1.
        append itab_output.
        clear itab_output.
      endloop.
    endform.
    *&      Form  HEADINGS
    form headings.
      uline /(154).
      format color 4.
      write: /01 sy-vline,
              02 'C',
              03 sy-vline,
              04 'Store Num',
              14 sy-vline,
              15 'GLNumber',
              31 sy-vline,
              32 'Store Name',
              68 sy-vline,
              69 'Store Type',
              87 sy-vline,
              88 'Address',
              142 sy-vline,
              143 'Status',
              154 sy-vline.
      format color off.
      uline /(154).
    endform.                               " HEADINGS
    *&      Form  OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM OUTPUT.
    Initial Output to the Screen
      set pf-status 'NORM'.
      sort itab_output by transpzone name_4 Ascending.
      loop at itab_output.
        concatenate itab_output-str_suppl1 itab_output-city
                    itab_output-city_no itab_output-postl_cod1
                             into lv_address separated by space.
        write: /01 sy-vline,
                02 chk as checkbox,
                03 sy-vline,
                04 itab_output-storeno,
                14 sy-vline,
                15 itab_output-name_4,
                31 sy-vline,
                32 itab_output-name_2,
                68 sy-vline,
                69 itab_output-name,
                87 sy-vline,
                88 lv_address,
                142 sy-vline,
                143 itab_output-transpzone,
                154 sy-vline.
      endloop.
      uline: /(154).
    ENDFORM.                    " OUTPUT

    You have to read the report back into the program using READ LINE. Then evaluate the value of your checkbox.
    Rob

  • HOW TO GET "N" RECORDS, URGENT

    Hi,
    Can any one please tell me what will be the SQL statement to get 10 records for each department . I dont want top 10 , i just want to get 10 records for each department from the employee table. or lets say 10 orders for each day for last 30 days from the order table. This is very URGENT. Please help.
    Thanks in Advance

    Hi,
    Thanks for your reply . But you didnt get my question I guess. I said I dont want the top "N" records. I want a query to pull N records for each department . Here is a sample, which shows 3 records for each department. Though there can be many records in the table for each department, the select staement pulls only three records for each department. I want that select statement.
    Thanks
    Feroz
    deptno------------empno----------ename
    10 -------------------100------------feroz
    10--------------------110------------anwar
    10--------------------120-------------liakat
    20-------------------200--------------zahir
    20------------------210---------------inzam
    20------------------220---------------shakil
    30------------------300---------------rameh
    30------------------310--------------rajesh
    30-------------------320-------------ritesh

  • Want to get a recordable signal

    I recently purchase an M-audio fastrack pro audio interface and attempted to configure it into audition , but i have yet to
    get a recordable signal . could you walk me through the steps in trying to get a signal.
    I wanted to know if it was possible to record into the Adobe Audition 3 software in 16 bit quality vs. the standard amount available
    now?
    Will Adobe Audition 3.0 recogninze my interface ( int he device properties tab), to do some work in edit and multitrackview, if say
    my interface is a protools digi 002?

    To get your M-Audio Fastrack to record in Audition you need to configure it in Edit/Audio Hardware Setup menu. When it opens in the Edit View page you should be able to select M-Audio USB ASIO from the drop down list in the Audio Driver slot. Having selected that if you click on Control Panel the M-Audio panel will open where you can select your inputs and outputs and Sample Depth 16 or 24. The Control Panel should show connected at the top right if your USB Fastract is working. Close the Fastrack Control Panel and then you can check at the bottom of the Audio Hardware Setup panel which input and outputs Audition will use (01S is channel 1 stereo or  01M is mono). You will then have to select the Multitrack View to set up the M-Audio for multitrack use as well. Click on Apply then OK to close Setup and return to Audition.
    When you select New file in Audition you can select the sample rate you want to record at and the bit depth, 16 or 32. There is not much point in recording 16 bit as Audition works at 32 internally and it is better to keep your files at 32 bit to retain quality until you have finished processing them. You can then always save them out as 16 bit when you need them as such.
    I am afraid you won't have much luck with using a Digi 002 as a source for Auditon although it can sometimes be made to work with some difficulty. Digidesign have so set up the 002 drivers to only really be compatible with ProTools.

  • Getting individual records in st03.

    Hi,
    Can anybody let me know how to drilldown for individual records in st03 tcode like stad ?
    Thanks in Advance,
    Archana

    I need to display logo on top of the report, for that reason i have included one database table and mapped it against POJO class in the report file.
    So because of this additional table, iam getting each record repeated thrice in the report.........Is there any other way of displaying image in the report using POJO class in crystal report

  • CUBE Not getting All records from DSO

    Hi Experts ,
    We have a situation where we have to load data from a DSO to a Cube . The DSO contains only 9 records and while we r loading the data into cube , the cube is only getting 2 records . Thus 7 records are missing. Also The Cube contains more Fields  than DSO. in the transformations , for the extra fields we have written end routine and those extra fields will get data by reading master data .. Any pointers how to get the missing records or what is the error ...
    Sam

    Why multiple threads ????

  • Info Cube not getting full records

    Hi All,
    I am extracting data from the flat file (60k records..of which most fields have binary values),, am getting the values into data source..but when loading from data source to info cube am not getting total records..
    the load is successful and it is showing as transferred 60k records and added 510 records in the manage tab of the info cube.
    what would be the problem ....any help is appreciated.

    Hi,
    Data with same combination for characterstic is added and only for unique charactersitc value it will give new record.
    Material---Customer-Price
    10002----- C1--
    20
    10002----- C1--
    20
    10002----- C1--
    20
    10002----- C2--
    20
    SO As you can see in flat file 4 records are there but in inofcube it will be only 2
    Data with same combination of charactersitc is added and with unique combo only it will display.
    Hope it clears you.
    Also in addition please check the data in flat file.
    Regards,
    AL

  • Not getting all records in pagination

    I am also have a problem getting all records in the report as the post on Apr. 21,2004. My reports pagination stops at 500. When I set the 'max row count' to 100000. The pagination at the bottom of my page disapears. When I leave 'max row count' empty, it only goes from 1-500. No way to view records past the 500th record.
    I see there was a post on Apr. 21, 2004 about the same thing but it did not specify a fix or work around or if I'm missing a setting. (also tried the log off/on but did not help).
    *My pagination Scheme is 'Row Ranges 1-15 16-30 in select list(wiht pagination)'
    *My report has 1000+ records.
    Thanks, Paula

    The actual number of rows supported by the select list depends on how many rows you show on each page. If you go with the default of 15 rows, you would be able to use the select list with close to 5000 rows. If you increase the number of rows per page, the select list will work with even more rows.
    If the select list can't be used, it may make sense to consider using the "row ranges with set pagination" style. Set pagination lets you navigate from one set to the next instead of one page to the next, so you can navigate through your result set a lot quicker.
    However the best option for reports with that many rows would be "row ranges x-y", without showing the total number of rows. The reason is that the report renders a lot faster if you don't have the total number of rows calculated. In order to better be able to find certain records, I would recommend a search field on your report page that lets you filter the result set.
    Hope this helps,
    Marc

  • Full update not getting all records from PSA to ODS

    Dear BW Masters,
    I am working with MM module. Iam using standard extract structure 2LIS_02_ACC
    Iam doing full update. Getting full data 1300 records in to PSA. But getting only 298 in to my ODS. I tried changing fields in to KEY FIELDS AND IN TO DATA FIELDS in my ODS
    But could not get data.
    Pls help me..i have dead line before that i need to complete report on the same.
    Its happening with the other HDR and ITM extractors.
    PLs help me..

    Hello,
    Look at this example:
    R/3 Record:
    CustNo | Name | Order | Amount
    1234 | Customer1 | Order 1 | 100
    1235 | Customer2 | Order 2 | 200
    1234 | Customer1 | Order 3 | 300
    If Cust.No is Keyfield, In BW you will get 2 records
    1234
    1235
    If Order No is Key field, you will get 3 records.
    It is not necessary to get the same no of records as they are in R/3.

  • How get all record from master and matching record from detail

    hi master
    sir i have master detail table
    i have many record in master table but some record in detail table how i get
    all record from master and matching record from detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
    this query not work that get only related record i need all record from master
    please give me idea
    thanking you
    aamir

    hi master
    sir i have master detail table
    i have many record in master table but some record in
    detail table how i get
    all record from master and matching record from
    detail
    such as
    select m.accid,m.title,d.dr,d.cr from master m,
    detail d where m.accid=d.accid
    this query not work that get only related record i
    need all record from master
    please give me idea
    thanking you
    aamir
    select m.accid,m.title,d.dr,d.cr
    from master m, detail d
    where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
    Note: Oracle 10g now supports ANSI standard outer joins as in:
    select m.accid,m.title,d.dr,d.cr
    from master m LEFT OUTER JOIN detail d on m.accid=d.accid

  • How to get multiple records using fn-bea:execute-sql()

    Hi,
    I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
    Regards,
    Nagaraju
    Edited by: user10373980 on Sep 29, 2008 6:11 AM

    Hi,
    Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
    For example:
    fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
    Id Name
    01 XXX
    02 YYY
    03 ZZZ
    I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
    <student>
    <Name>XXX</Name>
    </student>
    I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
    Please suggest.
    regards,
    Venkat

  • Data merging: how to get multiple records in single text frame?

    Hi
    I'm experimenting with data merging in InDesign CS3. The biggest stumbling block I've come across is trying to get my records to flow as continuous text in a single text frame (which would, ideally, autoflow onto new pages in the document). The records vary considerably in length, and so I can't just create a standard text frame to repeat on the page.
    Perhaps data merging isn't the best way of doing this and I should be learning to script instead. I feel like I'm just one step away, though.
    Any suggestions would be appreciated.

    OK, new scenario now:
    Is it possible to set a text box to auto-resize to fit the content that comes in during the data merge?
    I have placed one of my data fields in a text box with a stroke and fill, and placed this as an anchored object in the main text box with the other fields. The problem is that the length of text in this field varies considerably, and I'd like the text to fit snugly within its box. Ideally this text box would not appear at all if the field is blank for a particular record.
    I hope I've explained all of that clearly enough. Any ideas?

Maybe you are looking for

  • Nokia update PR1.1 - Nokia N8

    Hi guys! Does anybody can tell me if the update PR1.1 is available for every countries? My N8 can not find new updates (still on PR1.0) and I would like to know if this is a problem of my phone settings. Thanks for the info. Regards Solved! Go to Sol

  • ACH Payment, F110

    Guys, I ran another F110 for ACH payment.The  propsal gives the following messages,Anyone please guide me how to create payment media and variant for format ACH. Regards Shaun Step 002 started (program SAPFPAYM_SCHEDULE, variant &0000000000369, user

  • MB1C   Intial Stock posting error

    Hi Gurus, When i am doing MB1C intial stock posting i got a error  " G/L Account 39999 does not exist in Company Code 9999".... Give me suggestion... Thanks in Advance Ravikumar Talluri

  • Service Objects

    We are currently in the process of rearchitecting our software systems around Forte. Could anyone tell me what experiences they have had with building a system using Forte Service objects in a multi-tiered system? It seems to us that these are intend

  • IMovie11 maximum project size

    Does anyone know what the maximum file size is for an iMovie11 project?  I have one that is over 2 hours and I can't publish it to iTunes.  I cut it in half and it still didn't work, so I'd like to see if someone can shorten my learning curve and jus