Assign sequential number for same records

Please help in writing query for the below scenario
Table                
recordId
Name
date
Abc-123
Star
23-09-2013
Abc-123
Neon
17-09-2014
Abc-123
lap
05-05-2014
Xyz-789
Note
09-10-2013
Xyz-789
Sketch
15-01-2014
I must write query where the o/p would be like this
Where same recordid  should be numbered sequentially ,and the sequence should start from beginning
 for the another record.only same recordid’s should be considered and numbered irrespective other fields
 in the tables
O/p
Numbering
recordId
Name
date
1
Abc-123
Star
23-09-2013
2
Abc-123
Neon
17-09-2014
3
Abc-123
lap
05-05-2014
1
Xyz-789
Note
09-10-2013
2
Xyz-789
Sketch
15-01-2014

thanks sofiya .. could you also  please  help in another requirement .
recordId
Name
Abc-123
Star
Neon
lap
Xyz-789
Note
Sketch
I want to get  to all the names associated with one recorded ..as shown in the above table.

Similar Messages

  • Number for every record that is retrieved from (query)

    Hello
    I wish to put a number for every record that is retrieved
    from the record that is output by this query
    For example
    For the first recored/row
    Generated number, ksnumber, date
    1, gg111 11/05/05
    2, oo235 12/06/05
    the query returned 2 records 1 and 2 are the number that is
    generated with this code.
    In addition if there is a built in function, where in the
    code do I put it???
    <cfquery name="gelov datasource="kl90">
    SELECT
    FROM
    WHERE
    ORDER BY
    <cfswitch expression="#Form.orderBy#">
    <cfks value="KSNUMBER">
    KS.KS_NBR
    </cfks>
    <cfks value="CREATIONDATE">
    KS.KREATDAT
    </cfks>
    </cfswitch>
    </cfquery>
    <!---html report--->
    <cfswitch expression="#Form.outputFormat#">
    <cfks value="HTML">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Ctwye Kss Report</title>
    </head>
    <style type="text/css">
    table{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    td{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:10px;
    h2{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    h3{
    font-family:Arial, Helvetica, sans-serif;
    font-size:13px;
    </style>
    <body>
    <cfoutput>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td align="center">
    <h3>Ctwye Kss
    Report</h3><br><br></td>
    </tr>
    <tr>
    <td align="center">
    </h2>report returned #getCtwyeKss.RecordCount#
    records</h2></td>
    </tr>
    <tr>
    <td>
    <table border="1" cellpadding="2" cellspacing="0">
    <tr>
    <td width="160">Ks Number</td>
    <td>Creation Date</td>
    <!--- <td class="dataField">Address</td>
    <td class="dataField">Type</td>
    <td class="dataField">Description</td>--->
    </tr>
    <cfloop query="getCtwyeKss">
    <tr bgcolor="<cfif currentrow mod
    2>GHOSTWHITE<cfelse>WHITE</cfif>">
    <td>#KS_NBR#</td>
    <td>#dateformat(KREATDAT,"mm/dd/yyyy")#</td>
    </tr>
    </cfloop>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    </cfoutput>
    </cfks>
    <cfks value="CSV">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=ctwye.csv">
    <cfcontent type="application/msexcel">"Ks
    Number","Creation Date"
    <cfoutput
    query="getCtwyeKss">#ltrim(KS_NBR)#,"#dateformat(KREATDAT,"mm/dd/yyyy")#"
    <tr #IIF(getCtwyeKss.CurrentRow MOD
    2,DE(''),DE('backgroundColor="##999"'))#>
    <!---<tr bgcolor="<cfif currentrow mod
    2>##808080<cfelse>##ffffff</cfif>"> --->
    </cfoutput>
    </cfks>
    </cfswitch>

    <cfks> is not a Coldfusion tag. Use <cfcase>
    instead.
    The following code will print the row numbers
    <cfquery name="gelov" datasource="kl90">
    select ksnumber, date
    from yourTable
    </cfquery>
    <cfoutput query="gelov">
    #currentrow#, #ksnumber#, #date#<br>
    </cfoutput>

  • Some of the data for same records is going on to the next page in excel??

    Hello,
    I designed a template in word with page setup orientation to Landscape, to get the Excel report output. Later when i preview the same in Excel with the Landscape page setup..the print preview is showing me with some of the data going out of the page set up.My font size for data in word I put is 8pt Times New Roman.
    Basically..my requirement is to print the report in excel with the landscape page setup.
    But some of the data for same records is going on to the next page in excel??
    How do i prevent this from happening?
    Thanks in Advance!

    Hello
    The blog suggested above is to set the output for a PDF document using RTF template. Whereas, my requirement is to get a excel output using RTF template, with data fitting directly with in the landscape orientation of EXCEL when printed.
    Basically, the requirement is : When i run the report, the excel output should be sent to a printer with style 'Landscape' from apps?? But the problem is that i am not getting all the pagebreaks i put in the RTF template and also some of the data for the same records is not fitting in to the landscape orientation of the excel while it gets printed.
    But when i run the same as a PDF everything is fine... ..But that's not my requirement...Please help!
    Thanks,

  • How to assign Line Number for Lines when click on Add More Lines

    Hello All,
    Kindly help me to assign line number for the lines which are added through Add More Lines button on an Advance table. If user clicks on the button Add More Lines then there are 5 lines get inserted at a time but I am not able to handle the line number for them.
    Similarly, if user delete any of the line then I need to re-order them.
    Kindly help and share if there is any sample code.
    Thanks,
    Sandy

    Hi,
    Check if this link helps you :
    Re: How to display serial numbers in the results table region
    --Sushant                                                                                                                                                                                                                                                           

  • Sequential number for PDC messages

    i need information regarding field named PDSNR (Sequential number for PDC messages) in table named ASSOB.
    what are these PDC messages ?

    Hi,
    Number Range for your PDC message. The PDC messages are nothing, various message you are getting after the upload of time datas from PDC to SAP.
    Good Luck
    Om
    Reward it, if u feel hlepful.

  • Sequential Number for Non-Approved Forms

    Hello-
    I'm building an InfoPath form that is submitted to a SharePoint library.  There is an approval workflow created in SP Designer.  Once the form is approved, it is moved to another document library and then deleted from the current one.  Our
    goal is to assign a sequential number (RQNumber) to each form.  In InfoPath I have created 2 fields:  One that looks in the initial form library and grabs the max RQNumber and another that looks in the other form library and grabs the max
    RQNumber.  Then I have a field that takes the max of those two numbers and adds 1.
    The issue I'm having is I can't get the formula to grab the max RQNumber from the first form library.  I'm guessing this is because the form hasn't been approved yet, so it doesn't pull from the form until it's approved.  Is that correct? 
    Is there any way around that?
    Thanks! 

    Hi Nivek,
    Question: At what stage is the RQNumber assigned to the form in the first form library? Is it during submission of the form or during approval? If you are deleting the document from the first form library, arent you getting the max RQNumber same everytime?
    If this number is assigned during form creation, you should be able to lookup in the form library from a data connection to the same form library. During Form load, set a field to have max of RQNumber. Hope it helps.
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • Assigning sequential number from number range

    Hi All,
    My Zreport is updating Ztable with sequential number field assigned for each document numbers for each period. Below are the numbers assigned for period 5 in Ztable.
    00001000000000000000
    00001000000000000001
    00001000000000000002
    00001100000000000000
    00001200000000000000
    00001200000000000001
    00001200000000000002
    00001200000000000003
    When I ran for period 6 the sequence number is coming as below.
    00001000000000000003
    00001000000000000004
    00001100000000000001
    00001200000000000004
    00001200000000000005
    00001200000000000006
    It should give me the below.
    00001000000000000003
    00001000000000000004
    00001100000000000000
    00001200000000000004
    00001200000000000005
    00001200000000000006
    I am fetching the data from Ztable and sorting in descending order. Below is the data in my internal table in debugging.
    bukrs belnr           blart   monat   numkr      zsequence
    2700 |1700002431 |KA   |05         |03         |00001200000000000003
    2700 |5100000804 |RE   |05         |02         |00001100000000000000
    2700 |2200000004 |P2   |05          |01         |00001000000000000002
    Below is my code.
          loop at t_ztable.
            clear w_zsequence.
            unpack t_table-zsequence to t_ztable-zsequence.
            if (t_ztable-zsequence = '00001200000000000000' or
                 t_ztable-zsequence = '00001100000000000000' or
                 t_ztable-zsequence = '00001000000000000000' ).
            w_zsequence = t_ztable-zsequence
            else.
              w_zsequence = t_ztable-zsequence + 1.
              unpack w_zsequence to w_zsequence.
            endif.                                              "BK003
    *   shift w_zbelnr left deleting leading space.
            loop at t_bkpf
                  where bukrs = t_ztable-bukrs
                    and groupnumber = t_ztable-numkr.
              move-corresponding t_bkpf to t_ztable_load.
              t_ztable_load-zsequence = w_zsequence.
              t_ztable_load-numkr = t_ztable-numkr.
              append t_ztable_load.
              w_zsequence = w_zsequence + 1.
    *         shift w_zsequence left deleting leading space.
              unpack w_zsequence to w_zsequence.
            endloop.
          endloop.
    How to acheive this. Please help me.
    Thanks,
    VBK

    Hi Haritha,
    Can you show us the table t_bkpf dataon which you are looping?
    Regards,
    Sudeesh Soni

  • Same spool number for same job on mutilple days

    Hi all,
    We have daily Batch job which runs at 9:00 PM for a 1 variant and with 2 variant after first job is done.
    On 11/05 we have got one spool number 845411 for the spool  and on the 11/09 for the same job we got the same spool number for 2 jobs , and the data is also showing as 11/05 only and the spool creation date is showing as 11/05 and modified on 11/10...
    This is happening for only 1  batch job, we have checked the other  jobs all are fine with different spool #, we have checked spool number range and every thing is fine.
    Please suggest   what can be the reason for this scenario...
    Thanks,
    Subhash.G

    Hi Subhash,
    Check the print parametes of the job, can be seen under steps --> double click on program --> print properties. There we have option to select new spool number.
    So every time the job runs it will have a new spool number. Hope this helps.
    Regards
    Sushant

  • Assigning sequential numbers for every lines within a group of records

    The scenario is:
    This set of records with group number, lets say 100(group number) contains 7 lines/records. How to assign line numbers (sequential) for each line within these groups on the fly during the mapping process before inserting these set of rows in the target. I know it is easy to achieve in a procedure, but not sure how to do this in the mapping.
    please advice.
    Thanks,
    Prabha

    Use Rank function
    SQL> select empno,ename,deptno,(rank() over (partition by deptno order by empno)) seqno from emp;
    EMPNO ENAME DEPTNO SEQNO
    7782 CLARK 10 1
    7839 KING 10 2
    7934 MILLER 10 3
    7369 SMITH1 20 1
    7566 JONES 20 2
    7788 SCOTT 20 3
    7876 ADAMS 20 4
    7902 FORD 20 5
    7499 ALLEN 30 1
    7521 WARD 30 2
    7654 MARTIN 30 3
    7698 BLAKE 30 4
    7844 TURNER 30 5
    7900 JAMES 30 6
    1111 Test 40 1
    1222 test 1
    1333 2
    17 rows selected

  • 499 Step Number for condition record?

    Hello Everyone,
    In ECC6,  Quotation print output AN00 is not showing price per unit for some items. I checked in debug, there seem to be a condition record with step number 499 (which does not have a condition type) that is missing values for XKOMV-KBERT. When I populate this value in debug, it shows up find in the output. Step number 499 is not in KONV.  What logic does SAP use to come up with these values for step number 499?
    I know this may sound like an ABAP question but it is not. I think some pricing is not configured right. There is a calculation type condition but it is only populating field KWERT.
    TIA,
    Lyn

    Hi lyn
    Check in your piricing procedure V/08 wheather , in the step 499 what has been maintained any text type ? and if condition type has been maintained. , check wheather condition record has been maintained or not ? and also check wheather that  value is coming in the sales order or not .
    check for the step 499 wheather in print feild it  has been checked or not .
    Regards
    Srinath

  • Cannot able to assign Operation number for Order for Change cost assignment in Travel

    All dear Gurus,
    During the creation of travel request in NWBC suppose if an employee opted to change cost assignment. And he selected order from Accounting Object and given an order. He is not able to select it because he is getting an error when he click on Accept.
    The error is " Order 1000000160 requires assignment to an operation number "
    In ECC we have an option called Enhance Cost assignment through which we can choose the operation number. But no such option is available in NWBC.
    Kindly help me to solve the issue.
    Regards,
    Namsheed.

    Hi,
    Business Area is a Required entry for G/L account 1180 300000.
    So
    Go to FS00, and check Filed Status Group,for G/L account 1180 300000
    Go to OBC4, check the Filed Status Group, what u have mentioned for the G/L account 1180 300000.
    Go To material management segment and put optional entry for the field of Business Area and save.
    Now try ur transaction.
    Regrads,
    Biju K

  • IDOC Number for a record

    Hello All,
    I am working in HR. If I have a record created by IDOC, is ther any way for finding IDOC  number that has created this record.
    Regards,
    Rahul

    Hi Sergie
    The ALEAUD is a separate IDoc, so naturally it must have a different number than the original IDoc. However, the field E1STATE/DOCNUM in ALEAUD is a reference to the original IDoc.
    How is your ALEAUD generated? If you are doing this "manually" via a message mapping, you need to include the original IDoc number in the message to your receiving system so that it can send an audit message back containing the original IDoc number. From this audit message you should be able to map a correct ALEAUD message.
    Regards,
    Thorsten

  • Tax report for Spain - Sequential Number

    The layout that I have prepared for the Tax report (RFUMSV00, Tx: S_ALR_87100833) shows the column "Sequential number." Thus, I have a relationship without jumping straight to the numbering of all invoices with VAT.
    The system assigns a "Sequential number" for SAP document number. The "problem" arises when there is a bill, a SAP document, with more than one tax indicator of VAT. Then some lines appear in the Declaration of VAT with the Sequential number field in blank and that is because the number of the document (this bill) is already listed in the Declaration in another line with its own Sequential number .
    How do you work with it? Can I somehow avoid that remove this Sequential number blank?

    Hi (again)
    After reading the SAP note number 1628714 ( https://websmp107.sap-ag.de/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=1628714&_NLANG=E ), I think that there isn't an SAP-standard solution.
    Best regards.
    Paco M

  • CRM 2013 On-Premise How to implement sequential numbering for records?

    Hi All,
    I don't know if someone could advise me on the following.
    I have two entities, Transport Routes and Stops with a 1:N relationship. I want to auto-number the Stops records sequentially (1, 2, 3, 4, etc.)  but want to start at 1 within each Transport Route. How should go about it? Is it possible to achieve this
    with JS, or would that be a bit clumsy and would you recommend a plugin instead?
    I have an auto-numbering solution (AdvancedCRMAutoNumber from Xbitz) but that will not restart the counter position to 1 for each Transport Route - at least to me knowledge it cannot.
    Would appreciate any help!
    Thanks, Viktor

    hi Victor,
    I think you can write plugin by following below steps.
    -->Create one field in the Transport route entity to store the sequential number.
    -->As soon creating the Transport stop record get the sequential from the Transport route and create the sequential number for the transport stop.
    -->Update the Transport route record by incriminating the sequential number field.
    So every Transport route record will have sequential number which we can start with 1 as based on the stops we can increment the number.

  • Assign User with Perso.Number for BP

    I have two Business partners for  a user, example 1 and 2.
    Currently BP 2 has org structure relationship in PPOMA_BBP.But i need the assignment for BP 1.How to do this.I have checked in BP transaction under Identification tab for employee data,It contains only User name and it do not have Personnel Number.I have tried by deleting the BP 2.It is not working.
    Please suggest me how to assign Personnel number for BUP003 for the user.
    With Regards
    Ram

    first try to delete the BP from org structure then remove the relationship by below report.
    BUPRELDI.
    after successful run.
    Check for the relationship of the deleted BP in tcode BP.
    If that is removed then assign the new BP from USERS_GEN.
    Regards,
    Sachin

Maybe you are looking for