Get last add record using UI

Hi is there anyway to get the last added record from UI-API?
I want to return the last added doc num from the delivery screen after the user press the add button.
The method i am using now to get the doc num is to return the docnum after the itempressed event = true. After that i will minus 1 to that result. Is this the only way to get the last added number or is there another method to use?
Thanks

Thanks Ibai
I tried making an UDF in the Document/Title part, and created a new field called GUID. When i tried entering the GUID into that field using UI-API, it does not enters. My code are something like this
sGuid = guid.newguid.tostring
oitem = odevnote.items.item("U_GUID")
oedittext = oitem.specific
oedittext.value = sguid
pls help
ps. one more thing, if the UDF screen is not opened, the GUID value would not be entered right? is there a way to force the user to open the UDF screen? or is there any other solution for this?
Message was edited by: Melvin Teng

Similar Messages

  • SQL query to get last 10 records in the table?

    Hi,
    Can anyone tell me the SQL query to get last 10 records in the table?
    Thanks!!
    MCP

    Please, define what "last" means. Sets are unordered by definition, so if you want to retrieve rows from a table in a specific order you need to specify what that order is - e.g. by maintaining a value in a column (or a combination of columns) that you can use in the ORDER BY clause of the SELECT statement.
    If, for instance, you kept the time when the row was inserted in a special column (InsertedTime), you could use this in your query like this:
    select top (10)
      <column list>
      from <table or view>
      where <restriction(s)>
      order by InsertedTime desc;
    ML
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

  • Getting Last Payroll Record

    Hi all,
    I need to fetch last payroll record of a pernr,from transaction pc_payresult.
    I am using the LDB PNP.
    After calling GET PERNR, I am using functions CU_READ_RGDIR and then PYXX_READ_PAYROLL_RESULT to fetch the last active payroll record.
    But is there any way to <b>directly</b> fetch the last active payroll record,based on the pernr? Please suggest a way.
    Thanks&Regards
    Ananya

    Hi
    To get the payroll results, you need to read the cluster CU to get RGDIR. For this CU_READ_RGDIR is used and almost all standard programs also use this FM.
    Simple Report using LDBs to get latest payroll result.
    report ythr_read_payroll .
    data: t_rgdir type pc261 occurs 0,
          t_result type payus_result,
          w_bt type line of hrpay99_bt,
          out_seqnr like pc261-seqnr.
    tables: pernr.
    get pernr.
      call function 'CU_READ_RGDIR_NEW'
           exporting
                persnr                = pernr-pernr
           tables
                in_rgdir              = t_rgdir
           exceptions
                no_record_found       = 1
                import_mismatch_error = 2
                no_read_authority     = 3
                others                = 4.
      if sy-subrc <> 0.
        write:/1 'No payroll results for ', pernr-pernr.
      endif.
    call function 'CD_READ_LAST'
           exporting
                begin_date      = pn-begda
                end_date        = pn-endda
           importing
                out_seqnr       = out_seqnr
           tables
                rgdir           = t_rgdir
           exceptions
                no_record_found = 1
                others          = 2.
      if sy-subrc <> 0.
        write:/1 'Error for ', pernr-pernr.
      endif.
      call function 'PYXX_READ_PAYROLL_RESULT'
           exporting
                clusterid                    = 'RU'
                employeenumber               = pernr-pernr
                sequencenumber               = out_seqnr
           changing
                payroll_result               = t_result
    exceptions
                illegal_isocode_or_clusterid = 1
                error_generating_import      = 2
                import_mismatch_error        = 3
                subpool_dir_full             = 4
                no_read_authority            = 5
                no_record_found              = 6
                versions_do_not_match        = 7
                error_reading_archive        = 8
                error_reading_relid          = 9
                others                       = 10.
      if sy-subrc <> 0.
        write:/1 'Error for ', pernr-pernr.
      endif.
      loop at t_result-inter-bt into w_bt.
        write:/1 pernr-pernr, out_seqnr, w_bt-bankl, w_bt-bankn.
      endloop.
    Regards
    Navneet

  • GET LAST INSERTED RECORD

    I am fairly new to flex. So please bear with me no this
    question.
    I would like to get MYSQL ID of the last record I inserted.
    MSQL has as function LAST_INSERT_ID() that is connection based and
    will return the last id of the last inserted record. My thought was
    in the function contained within the cfc to do 2 queries insert the
    record and return the last id directly after (see below). However,
    I don't know how I would read the results back into flex. I am
    unsure how to write the event handler. Thanks
    <cffunction name="insertUser" access="remote"
    returntype="query" >
    <cfargument name="SSN" required="false" type="string"
    hint="SSN"/>
    <cfargument name="FNAME" required="false" type="string"
    hint="FNAME"/>
    <cfargument name="LNAME" required="false" type="string"
    hint="LNAME"/>
    <cfargument name="CLIENTID" required="false"
    type="string" hint="NEW CLIENTID"/>
    <cfquery name="insUser" datasource="DBT">
    INSERT INTO CLIENT (SSN, FNAME, LNAME) VALUES (
    <cfqueryparam value="#ARGUMENTS.SSN#"
    cfsqltype="CF_SQL_VARCHAR" maxlength="12"/>,
    <cfqueryparam value="#ARGUMENTS.FNAME#"
    cfsqltype="CF_SQL_VARCHAR" maxlength="20"/>,
    <cfqueryparam value="#ARGUMENTS.LNAME#"
    cfsqltype="CF_SQL_VARCHAR" maxlength="30"/>)
    </cfquery>
    <cfquery name="qRead" datasource="DBT">
    SELECT last_insert_id() AS CLIENTID
    </cfquery>
    <cfreturn qRead >
    </cffunction>

    I assume you have LCDS installed with CF and you are using
    the remote object service,
    <mx:RemoteObject
    id="myService"
    destination="ColdFusion"
    source="full.path.to.cfc"
    showBusyCursor="true">
    <mx:method name="insertUser"
    result="insertUser_result(event)" />
    </mx:RemoteObject>
    <mx:Scrpit>
    private function insertUser_result(event:ResultEvent) {
    trace(event.result);
    event.result will be the id of the newly inserted record.
    BTW, I would highly recommend you looking into the data
    management servcie. the SQLAssembler can spare you of the CF code
    for simple CRUDs like this.

  • How to get last year records in P&L

    Hii gurus,
    I am creating Profit & Loss report.
    I need to show last year records.
    Please explain.....
    Thanks in advance......
    Moderator message: please do more research before asking, show what you have done yourself when asking.
    Edited by: Thomas Zloch on Sep 27, 2011 2:11 PM

    Hi,
    Better still if you want this to be easily changeable, i.e. not without a repository migration, put the search spec on the Applet in the Application - Personalization screen. In this way you can change the Search Spec in case of Business Requirement change without needing to go through a development cycle. Do not forget to do a Reload Personalization Rules after changing Search Spec to bring this in effect.
    If you have a standard requirement then do it preferably on the Applet so that you can use the BusComp at other locations also without having to deal with the search spec coming in uninvited.
    Thanks and Regards,
    Tanmay Jain.

  • To get last 10 records

    hi
    suppose there are 50 records in a table
    but i want last 10 records .how can we retrive them?
    thanks in advance.......

    It works fine. The only odd thing is the timestamp appears later and the message (alert) appears first. But this is much better.
    Like this -
    Current log# 2 seq# 7479 mem# 0: D:\TESTDB\ORADATA\DATAFILES\TESTDB\REDO02.LOG
    Thread 1 advanced to log sequence 7479
    Thu May 01 12:30:40 2008
    ORA-00600: internal error code, arguments: [qkatab_10], [16], [79557], [], [], [], [], []
    Errors in file d:\admin\testdb\udump\testdb_ora_2092.trc:
    Thu May 01 11:35:21 2008
    ORA-00600: internal error code, arguments: [qknltAllocate_10], [79557], [], [], [], [], [], []
    Errors in file d:\admin\testdb\udump\testdb_ora_2092.trc:
    Thu May 01 11:34:45 2008
    WARNING: inbound connection timed out (ORA-3136)
    Thu May 01 11:26:38 2008
    Thank you all,
    Sanju.

  • Get last 5 records.

    I want to retrieve last 5 records in my emp table. This table contains 1000 rows. i should give "order by sal desc."

    http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html

  • Sender file adapter Need to Get Only one record Using FCC

    Hi All,
                  I am using File to ABAP Proxy interface, where i need to Trigger my proxy so in my sender file adapter , i need to configure as such it is should take only one record, from whole file i am using Key field parametrs in FCC but it is taking all the records which is not having the key fields also
    please help me
    Thanking you
    Sridhar

    2A64310       1 6V83970       03751650016001154000                    1 6V9961XT-3   13236157001160
    2A64310       1 6V83970                        000                    1 6V9962XT-3   23236162
    2A64730       1 6V83970       03751650016000106000                    1 6V9962XT-3   13236162000112
    2A64730       1 6V83970                        000                    1 6V9961XT-3   23236157
    2A64741 6V99481 6V83971 4S541403751650016000152360                    1 6V9964XT-3   13236168000166
    2A64741 6V99471 6V83971 4S5414                 000                    1 6V9963XT-3   23236167
    2A64772 6V99492 6V83982 3S860605001650017000244000                    2 6V9965XT-3   13289090000248
    2A65690       1 6V97460       07501226872000110000                    11242153L&MP   1
    2A65690       1 6V97460                        000                    11242121L&MP   2
    EOF
    this is sample file , i need to have any one line , cause i need to just trigger a proxy , i am not to going tp take entire file cause in real time i will getting 100 MB file which will be a performance issue

  • How to Get Top 10 records using SQL select statement.

    :-) Hiee E'body,
    I want to generate a sql report in which I only want the top 10 records based on the numeric value of a column.
    For Example,
    To generate a Location Wise, Employee Wise Years of Service Report.
    Here I need the Top 10 Employees according to their No. of Years of Service for all the existing locations using a single query.
    eg.
    Location Emp No. YOS
    India - 22 30
    212 28
    819 24 ...
    US 123 40
    312 33
    90 33
    144 30 ...
    UK 77 20
    79 20
    331 18
    109 16 ...
    Every Location should display their respective Top 10 Employees
    regarding their No. of Years of Service.
    Please let me the know the solution to this.
    Have a nice day.
    Thanking You,
    Vivek Kapoor.

    For example if the table contained (India rows only shown) :
    India 202 30
    India 212 28
    India 819 24
    India 820 24
    India 900 20
    India 920 18
    India 922 17
    India 925 16
    India 926 15
    India 927 14
    India 928 13
    India 929 13
    India 930 12
    do you want to see
    India 202 30
    India 212 28
    India 819 24
    India 820 24
    India 900 20
    India 920 18
    India 922 17
    India 925 16
    India 926 15
    India 927 14
    or
    India 202 30
    India 212 28
    India 819 24
    India 820 24
    India 900 20
    India 920 18
    India 922 17
    India 925 16
    India 926 15
    India 927 14
    India 928 13
    India 929 13
    Also if the India rows were
    India 202 30
    India 212 30
    India 819 30
    India 820 30
    India 900 30
    India 920 30
    India 922 30
    India 925 30
    India 926 30
    India 927 30
    India 928 30
    India 929 30
    do you want to see
    India 202 30
    India 212 30
    India 819 30
    India 820 30
    India 900 30
    India 920 30
    India 922 30
    India 925 30
    India 926 30
    India 927 30
    or
    India 202 30
    India 212 30
    India 819 30
    India 820 30
    India 900 30
    India 920 30
    India 922 30
    India 925 30
    India 926 30
    India 927 30
    India 928 30
    India 929 30
    Please clarify.
    Thanks,
    Partha

  • What is the best way to get the delta records using DSS(Data Syncronus Task)?

    This document may be helpful: Incremental Loading with Informatica Cloud. The screenshots are a little out-of-date, but the content should still be useful.

    DSS

  • Last 10 records of a table with out using count

    How can i get last 10 records of a table with out using count() method? if there is some page size(eg 10) , and if we want last page. is it posible without ount()? if posible how?
    Message was edited by:
    user480375

    "is there any other way without nesting?"
    Not correctly, no. What is your problem with nesting? Nested queries are not inherently slower than unnested queries. In some cases, such as this, they are the only correct way to do the query. Even an analytic version of the Top N needs to be nested because:
    SQL> SELECT object_name
      2  FROM t
      3  WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
      4  /
    WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
    ERROR at line 3:
    ORA-30483: window  functions are not allowed hereTTFN
    John

  • How to get all records using Invoke-webrequest?/Why Invoke-webrequest returns only first 2000 Records?

    invoke-webrequest content returning only 2000 records though it has around 4000 records in web api.
    The same url if I give in excel oData Data feed I am getting all the records.
    See the below script
    Script:
    $QueryResult= (Invoke-WebRequest -Uri $ODataURI -UseDefaultCredentials)
    [xml]$xmlResult=$QueryResult.content
    foreach($obj in $xmlResult.feed.entry.content.properties)
    $Name=$obj.Name;
    $IsAvail=$obj.isAvail.'#text';
    $PGroup=$obj.PGroup
    I am exporting the above result as a CSV file and my CSV file contains only 2000 records. 
    But,  $xmlResult.feed.Count --> it Shows 4000 Records.
    The same Odata url if I give in excel oData Data feed I am getting all the 4000 records.
    So Please help me how can I get all the records using power shell.
    Thanks
    A Pathfinder..
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Hi Jo Swa(K.P.Elayaraja)-MCP,
    Would you please also post code which is used to export the records?
    In addition, to use the cmdlet invoke-RestMethod to work on ODate feeds, please refer to this article:
    Interacting with TechEd NA 2012 Schedule using PowerShell v3
    I hope this helps.

  • How to insert the records using sql query

    hi,
    i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
    how can i solve this problem?
    Regards,
    M.Thippa Reddy

    You are not support use Insert / Update / Delete on SAP Databases directly.
    SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
    Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How to populate last 10 records from data base table

    Hi,
    My requirement is to populate last 10 transfer order items confirmed from LTAP. as the table is too large there is no point to fetch all the records and filter them...
    Please let me know better way (in terms of performace) to get last 10 records from LTAP.
    Thanks in advance.
    Nag

    Hi brother,
    the following code is working......(sample code)
    data itmara type mara occurs 0 with header line.
    select matnr from mara into corresponding fields of table itmara up to 20 rows.
    sort itmara descending by matnr.
    loop at itmara .
    write:/ itmara-matnr.
    if sy-tabix = 10.
    exit.
    endif.
    endloop.
    plz reward with maximum points
    Edited by: sreejith gn on May 13, 2008 12:52 PM

  • Fatch last inserted record in ztable

    hi all,
    any buddy can tell me how can i get last inserted record from my ztable.

    Hi,
    I think this wont work .....
    Ex: table has   (considering first two cols as PK's)
    000123   AA   124
    000123   AB   124
    000123   AC   124
    000123   BA   124
    000123   BB   124
    000123   BC   124
    000123   LH   124
    Now i am inserting         000123   BD   124
    => Records will be arranged as
    000123   AA   124
    000123   AB   124
    000123   AC   124
    000123   BA   124
    000123   BB   124
    000123   BC   124
    000123   BD   124
    000123   LH   124
    How will yur query works ? Please clarify ....

Maybe you are looking for

  • Database connections

    Hi all I am working with a web application and I am getting the following error: Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections I understand that that means

  • Post Moved Illegal use of my broadband

    Post moved http://community.bt.com/t5/Other-BB-Queries/Illegal-use-of-my-broadband/td-p/606892 If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark a

  • Not All Installed Styles Appear In Styles Panel Menu

    I have many layer styles installed - over 100.  I do this because I like to experiment with a lot of styles during the creative process and prefer to have them quickly available.  When I click the panel menu icon in the Styles panel, the list of avai

  • ActionScript 3 Error: 1046: Type was not found or....

    Hi, I am completely new to Flas and AS3. I am trying to create an opacity slider using the slider component. I foudn a similar tutorial and tried to alter it to fit my opacity needs. In line 8 (function opacityChange (event:SliderEvent):void{) I get

  • Error: Imported bank file format does not correspond to selected format

    Hi All, I am trying to execute FF.5 transaction - Import Electronic Bank Statement - for brazilian bank (Banco do Brasil) but I got an error message no. 8B795 (Imported bank file format does not correspond to selected format), I tried format B (Cobra