How to copy last record to a new record ?

Hello,
i have a question pls.
i want to copy last record to every new record
say,
multirecord forms has : Tank_no Last_measured Lab_Denisty
record1 : 1009aw 1532.94 .5796
what i want to do next record is copying last record (record1 ) as
record2 : 1009aw 1532.94 .5796
so the user may change the Last_measured only and not to have to rewrite the Tank_no and the Lab_Denisty cause it doesn't change.
May i do this ? if yessss, but How..?
Regards,
Abdetu..

Hello poelger
i check it then found the following code :
DUPLICATE_RECORD Examples /*
** Built-in: DUPLICATE_RECORD;
** Example: Make a copy of the current record and increment
** the "line_sequence" item by one.
DECLARE
n NUMBER;
BEGIN
** Remember the value of the 'line_sequence' from the
** current record
n := :my_block.line_sequence;
** Create a new record, and copy all the values from the
** previous record into it.
Create_Record;
Duplicate_Record;
** Set the new record's 'line_sequence' to one more than
** the last record's.
:my_block.line_sequence := n + 1;
END; but then which trigger best fit the procedure should i use
w-c-r or w-n-r-i Triggers
and what is meant by line_sequence pls. ?
Regards,
Abdetu..

Similar Messages

  • How to pull last record

    hi how to pull last record of a db table.
    i want to replace this.
    Pull out last record of the period
      SELECT mblnr mjahr cpudt cputm
       INTO (gw_act_mkpf-mblnr,gw_act_mkpf-mjahr,
             gw_act_mkpf-cpudt,gw_act_mkpf-cputm)
       FROM mkpf WHERE budat IN s_budat.
      ENDSELECT.
    suggest

    Hi,
    I hope following code will solve your problem.
    DATA : it_bseg TYPE TABLE OF bseg,
           x_bseg TYPE bseg,
           v_index TYPE i.
    SELECT COUNT(*)
      FROM bseg
      INTO v_index.
    SELECT *
      FROM bseg
      INTO TABLE it_bseg.
    READ TABLE it_bseg INTO x_bseg INDEX V_INDEX.
    First SELECT will give you the number of rows in a table in v_index. Second SELECT will fetch all table data and then READ will give you the last record of the table in a structure x_bseg.
    Regads

  • How to copy last year GL Accounts to this year, with out creation

    HI
    Good evening
    How to copy last year all GL accounts to this year. same configarations.(Not manual creations
    urgently i want please
    Ashok kumar
    [email protected]

    HI
    I dont want copy of Chart of accounts i want copy  GL Accounts
    Thank you
    Ashok kumar
    [email protected]

  • I had my iPhone 4S stolen last week and I am going to sync it to my computer to get everything back on it. I have a new computer, i know how to copy music over to the new computer, but where are the contacts stored on the computer?

    Hi there,
    Can anyone help me!? I know how to copy my music library to my new computer but struggling with copying the contacts etc. Where do I find the contacts folder on my old computer?
    Thanks
    K

    I had my iPhone 4S stolen last week and I am going to sync it to my computer to get everything back on it.
    If it is stolen , how are you going to sync it?
    You mean you got a new iPhone and you want to sync it to your computer?
    Plug it in.
    I know how to copy my music library to my new computer
    New computer??? Or new iPhone?
    I know how to copy my music library to my new computer but struggling with copying the contacts etc. Where do I find the contacts folder on my old computer?
    I suggest you simply copy your entire User folder from old computer to new computer. This way all your data (Music, photos, contacts, emails, calendars, documents, etc.)  goes across.

  • How to copy a record into a new one

    I would like to copy a whole record into a new one. Duplicate_Record doesn't help, because I do not necessarily want to copy the last record, but any record.
    The user should be able to open a record and then call "copy" and the current record is beeing copied into a new one. The user can also choose "new record" and nothing will be copied into the new record.
    So, if I want to copy the record, it's always the last one that has been opened.
    Should I save the values from the last record in globals and pack them into the new record?

    Sorry, the data is very complex, so I can't give an example. But to say it in a simpler way: I would like to copy any record, opened by the user. But not the last record in the database -> therefore I can't use duplicate_record.
    Hope it is clearer this time?still you have not given the data and output which you want.
    But not the last record in the database
    what did you mean here...
    oracle doesnt have a track of the records which were inserted to the db.

  • Computer crashed - how to copy files from ipod onto new computer

    Dear all,
    My computer crashed and I desperately need some tips on how to copy my music files from my ipod to the new hard disk. Any ideas?
    Thanks so much,
    Patrick
    HP notebook   Windows XP  

    Check out the instructions/suggestions here.
    Music from iPod to computer.
    There's also Yamipod. This is a free program that transfers music and playlists etc from iPod to iTunes.

  • How to copy exitsitng extracter into another new extracter?

    Hello,
    Please some one can tel me how to copy the existing  extracter into another new extracter.
    I have requirment as below
    Currect me if i am wrong ,need to enhance the existing extracter and add some new fields,and need to include some masterdata filds also to it.
    For master data i am going to do write routines at Transfermation so that no need to include in my exter for those filds to extracter.
    Please some one guide me in this scenario.
    Chrs

    Hi,
    you do not have to copy the extractor, you can enhance it with fields and fill them via enhancement coding --> rsa6.
    If you want to copy it, you need to check what kind of extractor you have. Is it a function module or just a table extractor.
    for fm: copy the function module via se37 and copy the extract structure via se11. Add your enhancements in the copied structures and coding. Create a new datasource with rso2.
    for table extractor: create a view adding the additionally needed fields. create a new ds with rso2. Surely you need to add some coding in the relevant enhancement.
    regards
    Siggi

  • How to select last record or first record value in a formula?

    Post Author: d111
    CA Forum: General
    I am using a query in a report that in addition to other columns, has a column of month labels like:
    There are no unique identifiers or sequence fields that can be used.   There is only 4 columns: the label and 3 percent columns.
    Jan07Feb07Mar07Apr07etc.
    I would like to show the range of months I am using in a label on the report showing the last and first records value. like: "Jan07 to Jun07".
    I can not see how to use the functions maximun or minimum since it sorts the months alphabetically.
    I would like to use a formula to just grab the first and last record.  I can't seem to find any information on this anywhere.
    Please advise and thanks.

    Post Author: bettername
    CA Forum: General
    Hmm... I suspect what you actually want is the minimum and maximum dates in the report, rather than the first and last records (even if they do happen to come out in date order). So you need to convert the text dates to real ones, and then pick the min/max values.
    If so, try these:
    Formula "ConvertToDate" (for details section) which converts your text field into a real date - suppress it once placed!:
    //Since you have 2-digit years, this conversion assumes that all your dates are >=year 2000
    numbervar the_month;if left({YourTable.YourField},3) = "Jan" then the_month:=1 elseif left({YourTable.YourField},3) = "Feb" then the_month:=2 elseif left({YourTable.YourField},3) = "Mar" then the_month:=3 elseif left({YourTable.YourField},3) = "Apr" then the_month:=4 else
    //...etc etc you fill in the rest!
    if left({YourTable.YourField},3) = "Dec" then the_month:=12;
    date(tonumber("20"+right({YourTable.YourField},2)), the_month, 1);
    Formula "Show Date Range" (for anywhere on the report) to show the min/max values of the dates;
    totext (minimum({@ConvertToDate})) + " to "+totext(maximum({@ConvertToDate}))
    If, however, you really just want the first and last records, and you want it at the top of your report as a title (eg: in the Report Header), then I can't see how it can be done without using a subreport that looks at the same dataset, but only displays the first and last records (using the formulas below).
    Stick this in the details section, and call it "HoldRecords" and suppress it:
    whileprintingrecords;stringvar first;stringvar last;if recordnumber = 1 then first:={YourTable.YourField}; //if its the first record that crystal is displaying, store it in a variableif recordnumber = count({YourTable.YourField}) then last :={YourTable.YourField} //and again, but for the last record
    Now create another formula, and put it into the report footer:
    evaluateafter({@HoldRecords});stringvar first" to "stringvar last //will display "Jan07 to Apr07"
    NOTE:  if you have the report ordered by anything, this'll throw the record numbering, and therefore the first and last records, therefore... urgh.
    Hope this helps...

  • How to get last Record ior Total rows in For Loop Cursor ?

    Hi Friends
    I would like to know , the last record in for loop cursor, i have the code in following format
    cursor c1 is
    select * from emp;
    begin
    for r1 in c1 loop
    v_total_rec := ? ( i would like to know total rows in the cursor , say for example if cursor has 10 rows, i want10 into this variable )
    v_count := v_count +1;
    dbms_output.put_line(r1.emp_name);
    end loop;
    end;
    Hope i am clear
    Any suggestions?
    Thanks
    Ravi

    Even though cursor loops are generally a Bad Idea ^tm^ as Dan says, here's an example of how you can get the information you wanted within the query itself...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    cursor c1 is
      3      select emp.*
      4            ,count(*) over (order by empno) as cnt
      5            ,count(*) over () as total_cnt
      6      from emp
      7      order by empno;
      8  begin
      9    for r1 in c1 loop
    10      dbms_output.put_line(r1.ename||' - row: '||r1.cnt||' of '||r1.total_cnt);
    11    end loop;
    12* end;
    SQL> /
    SMITH - row: 1 of 14
    ALLEN - row: 2 of 14
    WARD - row: 3 of 14
    JONES - row: 4 of 14
    MARTIN - row: 5 of 14
    BLAKE - row: 6 of 14
    CLARK - row: 7 of 14
    SCOTT - row: 8 of 14
    KING - row: 9 of 14
    TURNER - row: 10 of 14
    ADAMS - row: 11 of 14
    JAMES - row: 12 of 14
    FORD - row: 13 of 14
    MILLER - row: 14 of 14
    PL/SQL procedure successfully completed.
    SQL>

  • How to fetch last record from the table to display in screen painter?

    Hi Gurus,
                  I have a requirement where i have to fetch the last record value in the table.
    I have a screen where the TEXT name is REQUEST and I/P field name is REQ and SAVE push button.
    In this I/P field automatically 1 should display when i excecute the program and when i save this, the request number should turn to 2 that is dynamically..once agin save then 3 and so on....and this 1, 2, 3 will be storeing in table.
    I have succeeded till generating the values dynamically and saving in the table like 1 is displayed and when i click save it is changeing to 2..but the problem is when i am coming out of program and logon again the request number is again displaying as 1 rather it has to start with 4 because already 3 request are there in the table.
    My code is...
    Table zsave.
    data declarations....
    data req type i.
    req = 0.
    req = zsave-req.
    PROCESS BEFORE OUTPUT
    req = 0.
    select req into table fun_st from zsave.
    req = zsave-req.
    zsave-req = req.
    req = zsave-req + 1.
    PAI
    req = zsave-req + 1.
    zsave-req = req.
    when 'save'.
    wa_funst-req = zsave-req.
    Please can you provide me with the solution....answer will be rewared.
    THKS

    Can you tell me, when updaing the ZSAVE table with the counter value are you modifying the exisiting value or inserting the value as new record?
    From the code in your first post, i see that you are extracting records into internal table but when you are moving to variable REQ, you are moving from table work area which is blank, so everytime when you execute it may be starting as 0.
    Hope below code can help you understand on handling your requirement
    Global Declaration:
    >DATA: l_req TYPE i. 
    PBO:
      SELECT MAX( req ) INTO l_req FROM zsave.
      l_req = l_req + 1.
    PAI:
      DATA: wa TYPE zsave.
      CASE ucomm.
      WHEN 'SAVE'.
        wa-req = l_req.
        INSERT zsave FROM wa.
      ENDCASE.

  • How show the last record by date

    Hi Gurus,
    i got in the cube the next records for example:
    calday                  Material    Quantity
    01.01.2011             A                 10
    15.01.2011             A                  20
    if i present in the query these IO an KF the query will show these 2 records, now i want just show the last record by date
    calday                  Material    Quantity
    15.01.2011             A                  20
    i tried in the query with a calculate KF with exception aggregation , MAX with Reference to calday , but this still show both records... how can i do it? help gurus.

    Hello,
    If there are sales occuring for the material on two different dates and you include date in there will be always two records.
    I dont understand the need to show the last transaction. Anyways if you still need that you need to remodel the backend.
    Put a DSO on the cube with date in the data field, this will always overwrite the value for the key combination you need.
    Then you can return on this DSO.
    Regards
    Shashank

  • How to copy a record with an Automatic Row Processing (DML) ?

    Hi,
    I want to duplicate (to copy) a record.
    I have a form, with an Automatic Row Processing (DML), looking for the PK stored into an item named P26_ID and populating the values into the corresponding items of the form.
    I have an Automatic Row Processing (DML) which permit to update, delete and modify the row.
    So far so good.
    I thought it would be good if I calculate a new value for the PK and stored it into the P26_ID.
    Then I thought the Automatic Row Processing (DML) would see that it is a new value for the PK and would "decide" insert a new record.
    But it does not work like that. I thought it was because the item P26_ID is database column type; so I switched to another item named P26_ID_NEW and put this new pk into this item. I then created another Automatic Row Processing (DML), triggered by this button, and which will look into this new item. It does not work either.
    Where do i go wrong ?
    Thank you for your kind help !
    Christian

    Christian:
    Assuming that the 'Duplicate' function is available only when the page is in 'Edit' mode, ie. a record has already been loaded into the form you can do the following to duplicate this record
    1) Define a button named 'Duplicate'
    2) Set the target of this button to be 'URL'
    3) Set the URL for this button to be
    javascript:duplicate();
    4) Add this bit of JS into the page HTML header<script>
    function duplicate() {
    $s('<name_of_PK_page_item>','');
    doSubmit('CREATE');
    </script>Varad

  • How to Copy LSO records of an employee to another employee

    Hi LSO Experts,
    I have a requirement to copy existing employee's LSO records andassign the same to another employee. This scenario comes in when same guy is rehired with a Wrong iring action (having a new Pernr). Thus we need to allocate all his previous training details to this new pernr.
    I think FM LSO_GET_BOOK_PARTICIPANT will provide all training records details of a guy. However, what should be the appoach to copy these records to a brand new Pernr ?
    While digging up deep, I found, linking with LSO records with PERNR lies in the table HRP1001 and hrpad614. However linking field between these two tables are auto generated by SAP.
    I want to transfer all existing records of one employee to another employee. Please let me know the right aproach.

    Hi LSO Experts,
    I have a requirement to copy existing employee's LSO records andassign the same to another employee. This scenario comes in when same guy is rehired with a Wrong iring action (having a new Pernr). Thus we need to allocate all his previous training details to this new pernr.
    I think FM LSO_GET_BOOK_PARTICIPANT will provide all training records details of a guy. However, what should be the appoach to copy these records to a brand new Pernr ?
    While digging up deep, I found, linking with LSO records with PERNR lies in the table HRP1001 and hrpad614. However linking field between these two tables are auto generated by SAP.
    I want to transfer all existing records of one employee to another employee. Please let me know the right aproach.

  • How to fetch last record from a flatfile

    I have a flatfile with 5000+ records and last record is the count record , i want to fetch the last record only through sql loader or External table (OS IS Unix)
    Pls any body can give the answer
    Kiran Kumar Thayyuru
    Message was edited by:
    user557500

    you migth want to take a look at the option CONTINUEIF LAST

  • How to retrieve last record entered into database

    Hi all,
    I want to retrieve the last resord entered into a database table.
    I have a MS Access database.
    This code does not return the last record but its my nearest attempt to.
    Can anyone suggest the correct SQL or Solution.
    Help is greatly appriciated.
    Thanks.
    String str = "SELECT * FROM Missions WHERE Mission = (SELECT MAX(Mission) FROM MISSIONS)";
            ResultSet rs = null;
                String f1 = null, f2 = null, f3 = null, f4 = null;
                try{   
                    rs = statement.executeQuery(str);
                    txtMissionInformation.setText("");
                    int row = 0;
                    while(rs.next()){
                        f1 = rs.getString(1);
                        f2 = rs.getString(2);
                        f3 = rs.getString(3);
                        f4 = rs.getString(4);
                        System.out.println(f1 + " " + f2 + " "+f3+" "+f4);
                        txtMissionInformation.append(f1 + ", "+ f2 + ""+","+f3+","+f4);
                    System.out.println("Query Complete !");
                } catch(Exception e){
                    e.printStackTrace();
                }

    I fixed my problem, i aded an autonumber field to my database set it as primary key and called it ID. i then used the syntax from before and it worked.

Maybe you are looking for

  • Problem in using jmsConnectionFactory

    Hi All, I'm new to j2ee. i have problem in message driven bean - "jmsConnectionFactory" . where this is intialize to use in message driven bean. please let me help on this.

  • I have a problem in the data entry Visa card please help

    I have a problem in the data entry Visa card please help

  • Link between ABC Indicator and Priority

    Hi friends, My client requires the Link between ABC Indicator and Priority. i.e., While creation of notification, based on the ABC indicator assigned in the Equipment, Priority should be selected. Is it possible, if possible please help me out to res

  • Ftp page question

    Question from a relative newbie: On iWeb, you can set up an ftp page for guests where any file put into your public_html folder automatically gets listed on the ftp page. You don't have to set up a link. Just upload any file into your public_html fol

  • Firefox 4.0 new bookmarks not saved

    Been using FireFox 4.0.1 since it was released. Works fine until I noticed a few days ago that it suddenly stopped saving new bookmarks. I typically drag the url by it's icon over to the folder I want it to reside in...I have quite a few. It worked f