Number my lines

In a detail table, i want to number my lines in creation order (first line created is number 1, next number 2, ...). I could use a sequence but :
1. For each new master record, I need to restart counting from 1
2. I don't want hole in my numbers. If I create 3 lines, the delete one and re-create one, I must have number 3 and not 4
I tried something like SELECT COUNT(*)+1 FROM MY_TABLE in a PRE-INSERT trigger but the table is mutating so I cannot SELECT FROM it.
Note : my wish is to use only tribber based on table (not forms trigger) and/or stored procedure/function.
Any idea ?

That really is odd.
Still, what if you have a number column named insert_order.
Then, in an after insert trigger for each row, you may do:
select seq_ins.nextval
into insert_order from dual;
So, you may order the query results using the insert_order column.
Then, you may say that you still want the record numbers, like 1, 2, 3, and not 201, 203, 204, 207, like they may appear.
In this case, in your form you may have a display-item that will be filled with the neded values using the post-query trigger.
null

Similar Messages

  • Restriction on number of line items in an automatically generated document

    Hi all,
    As per my info, an accounting document must have a minimum of 2 line items to complete the document. At the same time an accounting document can have a maximum of 999 line items.
    My observation:-
    When I am posting depreciation using t-code AFAB, system is posting depreciation document (document type AF). While checking, I found that the system has posted around 16 document for a period.
    On further checking, I observed that the each document contains a max 100 line items.
    I am using SAP 4.7
    My Query:-
    a> Is there any way / place wherein we can restrict the maximum number of line items possible for a given docuemnt type or for all document types in the client?
    b> In case it is not possible to restrict the number of line items per document, what could be possible reason for the system behaviour wherein it is posting about 100 line items per document & thereafter starts a new document.
    Thanking you in advance
    Santosh K Agarwal

    Hi,
    I have been reading CIN. There I came across with a statement i.e. "There is restriction on no of line items to be in an Excise Invoice".
    where you read this i dont know
    but yes for outgoing excise invoice we can put limitation in sap cin
    as per incoming excise invoice i think no  limitation
    in path SPRO-tax on goods movemnet-India-basic setting-maintain excise registration here you can maintain this
    and yes this for india only for other country they may have different
    Regards
    Kailas ugale

  • ALV_GRID How to get number of lines after filted applyed?

    Hi, all!
    The task is to display title in alv_grid like
    "N records selected (X records on the screen)".
    It means, N records in dataset and X records displayed after  filter applyed by user.
    But i can't get number of lines after filter applyed from the alv_grid.
    Can anybody help me?
    Thanks & regards,
    Konstantin

    Hi,
    If it goes through PBO/PAI cycle after user sets the filter then in your PBO call method get_filtered_entries of CL_GUI_ALV_GRID and then do a describe statement on the table.
    Number of entries in your grid table - number of entries in this filtered entries table will give you the displayed entries after the filter is set.
    If it does not go through PBO/PAI cycle then register for after_user_command and I think the fcode for filter is '&FILTER' and code for the above logic in your handler method..
    Hope this helps..
    Sri

  • Number of line items in each Invoice

    Hi Gurus,
    I have one requirement
    i need to display one column in the Report i.e. "Line items per eachinvoice" which should give the number of line items per that Invoice
    when iam using tcode 'FB03' at ECC - Document Display it is giving
    for Doc 1111 - 2 line items
    for Doc 2222 - 12 line items
    so in the report that column should display
    2 for Doc 1111
    12 for Doc 2222
    please guide me how to do this
    Thank you

    create a formula with constant 1
    and set the exception aggregation as Total, and set the reference char as Line Item.
    Make sure you have Invocie in the report.
    - Danny

  • How to restict number of lines  from my report output

    Hi,
    I deveoped a noraml alv report where 26 fields displayed in the report output .But when nuber of lines exdeed 65,000 then we are unable to donload it to spread sheet .so we want to reduce the number of lines based on customer .How to do this in layout is there any facility to restict the number of lines ??
    Please help me

    Hi I am not sure but you can try like devide table entries in multiple internal tables.
    Create saperate ALV Report and give customized button(Next and Back) to each report will have interlink to this reports.

  • How to find number of lines in the text content?

    Hello All,
    I have a multi line text item. I want to know the number of lines in a text item? How can I do that?
    Note that every lines end with the shift+enter.
    Example,
    This is a
    sample.
    After line This is a there is (Shift + Enter).
    Thanks for any help.

    Whenever the user inputs Shift-Enter, Photoshop inserts an [EOT] (End Of Text) control character (\x03 or \u0003) in the string.
    Also, in order to split the text according to multiple separators in only one call, it is necessary to use a regular expression instead of a string.
    Try replacing:
    var theArray = theText.split("\r");
    with:
    var theArray = theText.split(/[\u0003\r]/);
    BTW, you can improve performance by explicitely requesting the textKey property of the current layer object.
    Try using:
       ref.putProperty( charIDToTypeID("Prpr"), stringIDToTypeID("textKey") );
       ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    instead of:
       ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    HTH...

  • How to count number of lines in a file?

    I am using a BufferedReader to read my file, but I like to know how to count the number of lines in a file is there a way to do that in Buffered Reader or do I have to use FileInputLineStream?

    Well, if you know how to read one line with a Buffered reader, and you know how to keep reading lines until you run out, then all you have to to is initialize a counter to zero before you start reading, add 1 to it each time you read a line, and then examine its value when you're done.
    Try that, and post again if you get stuck.
    Just be careful how you construct your loop. "Off by one" errors are a common way to get bitten. It could happen if you count what you think is the last line, but you've actually already counted all the lines and you end up counting one extra for "there are no more lines".

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How do you find the number of lines in a file?

    I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
    Thanks

    That depends. How do you define a line? Is it a specific number of
    characters, a String that's terminated by a newline character or some
    combination thereof?

  • How do I increase the number of lines presented in a drop down list?

    When I am entering a single character/number for each of a random selection of three letters in a password verification, I get a drop down list from A to S only, the first 20. Accessing letter T to number 9 means scrolling down. How can I increase the number of lines in a drop down box to 36?

    Hi canddski,
    If you are taking about an interface on a website, this is up to the ui designer. But there is a reflow that depends on screensize for the Firefox UI.
    You can use asp to control the list:
    [http://forums.asp.net/t/1970301.aspx?How+can+i+display+selected+no+of+records+from+datatable+using+dropdown+list+without+database+]
    but also try asking on stackoverflow.com

  • How to get the number of lines of a FileReader

    I need to calculate the number of lines of a FileReader object. How can I do that ?

    I wrote the following some while ago. It assumes that a line is terminated by '\n' but it should be easy to adapt.
    import java.io.*;
    public class LineCounter
        public static int countLines(File file, String encoding) throws IOException
            int lineCount = 0;
            Reader reader = new InputStreamReader(new FileInputStream(file), encoding);
            char[] buffer = new char[4096];
            for (int charsRead = 0; (charsRead = reader.read(buffer)) >= 0;)
                for (int charIndex = 0; charIndex < charsRead ; charIndex++)
                    if (buffer[charIndex] == '\n')
                        lineCount++;
            reader.close();
            return lineCount;
        public static void main(String[] args)
            try
                File file = new File("/home/sabre/work/dev/maps/EUROPE.RIV");
                long startTime = System.currentTimeMillis();
                int lineCount = countLines(file, "UTF-8");
                double time =  (System.currentTimeMillis() - startTime) / 1000.0;
                System.out.println("File size = " + file.length() + " contains " + lineCount + " lines taking " + time);
            catch (Exception e)
                e.printStackTrace();
    }

  • How to get the number of lines of a file?

    Folks:
    Is there a way to get the number of lines of a text file? I don't know if there is an existing method to do that.
    Thanks a lot.

    HI
    I found some solution
    other than increment loop and all
    here is the code it might helpful to u
    //returns the number of lines in a file
    //author : Ravindra S
    //Symphony software Hyderabad
    try
    RandomAccessFile randFile = new RandomAccessFile(csvFile,"r");
    long lastRec=randFile.length();
    randFile.close();
    FileReader fileRead = new FileReader(csvFile);
    LineNumberReader lineRead = new LineNumberReader(fileRead);
    lineRead.skip(lastRec);
    countRec=lineRead.getLineNumber()-1;
    fileRead.close();
    lineRead.close();
    catch(IOException e)

  • Maximum number of line items in sales order

    hi,
    Is there a limit on the maximum number of line items that are permitted in a sales order?
    Thanks,
    Shailaja

    Hi
       I think the correct reply would be 999,999 because data type of item number POSNR is NUM 6, which means that it can hold upto value 999,999.
         However, at the same time keep the following into consideration:
    1. FI document has a restriction of 999 line items per document. So, depending on the account settings, there will be a lower limit. E.g. if each Sales order line item results in 2 line items in the accounting document, then the max. no. of SO line items is limited to 499.
    2. If FI summarization is active, then the system summarizes the account postings, thus reducing the no. of FI line items. Hence, a SO can accomodate more than 999 line items. However, this means that certain line item level details will not be available to the Finance guys (which they may not like).
    3. As the number of line items in a Sales order increases, the system performance suffers greatly. There are performance fixes available, but in general, it is painful to load a SO with large no. of line times through BDC's. 10 Sales orders with 100 lines each consume less system resources than 1 Sales order with 1000 lines.

  • Issue with number of lines in Table control for an web transaction in ITS

    Hi,
    We have acustom web transaction ZC03 where we have used table controls. Recently a kernal patch has been installed and after that the number of lines appearing in table control has got changed. Earlier table control was coming with 5 lines and presently its coming with 3 lines. Can you please help me to fix the issue.
    The  code used in HTML template for table controi is given below:
    `SAP_DynproLayerBegin(005,013,067,006)`
      `SAP_TableControl("TC_TIME1")`
        `SAP_DynproLayerEnd()`
    I have tried other alternatives like  `SAP_DynproTableControl("TC_TIME1")`, `D_TableControl("TC_TIME1') but did n't get any fruitful result also.
    Thanks and Regards,
    Ranadev

    What where the precise Kernel updates? What where you on and what did you upgrade too?
    Did you apply any BASIS Support Pack corrections during the Kernel upgrade?
    If you applied a new BASIS support pack - check the following WIKI:
    [How to check the publishing Date of an Internet Service|http://wiki.sdn.sap.com/wiki/x/OYG8BQ ]
    if you need to republish - use the following WIKI:
    [How to activate, publish and test ITS services in the integrated ITS?|http://wiki.sdn.sap.com/wiki/x/kmE ]
    Regards,
    Oisin

  • Number of Line Items Issue at the time of Payroll posting

    Dear All,
    While creating a posting document (Payroll posting) for FI, the maximum number of line item allowed is 999 where as I have 1464 line items. I am creating only one document based on Company code and it is giving me the following error, which is because of number of line item;
    Acct determination not defined for trans. HRA 1002  in chart of accts AGCA
    Message no. F5113
    Diagnosis
    An automatic posting cannot be created because the account determination for transaction HRA with keys 1002  is not defined in chart of accounts AGCA.
    System Response
    The document cannot be posted.
    Procedure
    Depending on the type of processing, you can hold the document and post it later. If this is not possible and the error cannot be eliminated straightaway in customizing, you must leave processing and enter the document later.
    Procedure for the system administrator
    Correct the account determination for the specified transaction. Proceed
    Please tell me how to create least amount of documents for posting?
    Regards.

    SPRO> payroll >Reporting posting payroll result to Accoutning > Activities in Account system >Assigning Accounts >Assign Technical accounts
    Here eneter 1001 payroll clearing account and next enter 1002 same payroll clearing account. by doing this it will allow document splitting.

  • How to find number of lines in an input file.

    Hi,
    Can someone tell me, if there is a way to find out the number of lines in an input file. I do not want to read line by line and then count the number of lines read.

    Then how do you think a program could determine the amount of lines in an input file? How does a human know how many lines are on a page? You're going to have to count the items that separate two lines to know how many lines are in your file.
    Either read line by line and count the amount or read char by char and count the number of '\n' occurences instead.
    If you have control over writing the input files, however, you can make this better. Write a header in the file that specifies the amount of lines in it. The first line of your file will then hold a number that represents the amount of lines in the file, so you need only read the first line to know how many lines are in your file.

Maybe you are looking for

  • Q10 Serious problem-Edit account-Not all the Connections were closed in the alloted time.

    hello, when my Q10 work account isn't responding ,its ask me to "tap for more info" , i go to "System Setting" - Accounts --Set up email --select my work account email address (show "Not Connected) -- "Edit Account" -Configure the account settings fo

  • SC Workflow not updating standard field

    Hi, I am using SRM 5.0 .After approval of SC which have multiple item not updating standard field of source_ind to all the line items . It's getting updated in only first line item . Recent Package : SAP_ABA SAPKA70011 Thanks , Sachin

  • Acrobat 9 with FrameMaker 7.2

    Hello, I'm running FrameMaker 7.2p158, Acrobat 7.1.0, and Windows XP, everything patched up to date. I've recently acquired the latest version of the Technical Communication Suite, which includes Acrobat 9. I'm not ready to install FM8 yet, but I wou

  • Can't see my network shared folders(on PCs)

    I have a home network with D-Link router with 3 other computers (2 WinXP and a Vista). The computers are all on the same subnet 192.168.0.10X and all use DHCP from the Router. The Macbook is getting an IP from the router but it doesn't see the other

  • Missing Mouse Up Bug

    I have Labview 6.02. Sometimes when my VI is running, Labview misses 'mouse Button Up' events. So if I try to scroll, I can't let go of the bar. Or a button will get stuck down. It usually catches the 'mouse Button up' about 5-10 seconds later. This