Limit number of lines

I know how to limit the number of characters that a user can
input, but is there a way to limit the number of lines that a user
can input into a textbox.

Firstly thanks kglad and KnowMind for your responses.
Why I wanted this. I have a textfield that a user fills in.
This text is then displayed in another textfield that can't be
scrolled at a later point. Therefore I need to limit the number of
lines that they use when filling in the first textfield so that it
will be fully displayed in the later textfield.
knowmind, your code works, but doesn't do what I wanted. as
it increases the size of the textfield being filled out, rather
than limitting it.
kglad (as usual) you have done what I wanted, however if a
user tries to edit his work, eg, goes back to the top line and
clicks enter any line that goes over the height is lost and can't
be retrieved, which would be annoying. Therefore instead I am going
to use the following code:
commentTxt.maxChars=420;
remForcedLines = commentTxt.text.split("\r").join(" ");
It simply removes any forced lines that are in textfield 1.
Therefore as long as maxChars is under the maxchars in textfield 2,
it will display fully. Obviously this wouldn't be particularly
practicle for large textfields but as you can see it is only 420
chars long.
So thanks to both of you for your help. J.

Similar Messages

  • Limit number of lines in a text editor

    Hello.
    In my program, i'm creating a text zone and i need to limit the data users will put in this zone.
    To create that, i'm using the object cl_gui_textedit. I've looked in the methods of this object but i wasn't able to find one that will limit the number of lines of the text editor.
    Did i miss it ? Does anybody knows how i can for example limit the input zone to 5 lines ?
    Thanks for your help.
    Here's my code
      IF g_editor IS INITIAL.
    *   Instanciation du container pour la zone de texte
        CREATE OBJECT g_textedit_custom_container
            EXPORTING
                container_name = 'TEXTEDITOR'
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    *      add your handling
        ENDIF.
    *   Création de la zone d'édition du texte
        CREATE OBJECT g_editor
          EXPORTING
            parent        = g_textedit_custom_container
            wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
            wordwrap_position          = 68
            wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
      ENDIF.

    I just notice there is a method SET_HEIGHT but this one is implemented in CL_GUI_CONTROL.
    I tried this :
            CALL METHOD g_editor->set_height
                    EXPORTING height = w_height.
    But in fact, i never enter the method.
    Do i have to create a CL_GUI_CONTROL object ? If yes, how do i link it to the CL_GUI_TEXTEDIT.
    Sorry if some questions mays seem obvious. It's my first object abap program.

  • How do I limit the number of characters allowed in an input form and then how do I limit the number of lines?

    I'm selling Classified Advertising in a newspaper and I want my visitor to be able to enter their own ads.
    They need to be limited to 30 characters/line with a limit of 4 lines.  (120 characters total).
    How can I use html or css to limit the input to 30 characters per line and then limit them to 4 lines?
    Is that possible?
    Thanks so much.
    Dale

    I would place 4 text fields and use the maxlength attribute. Setting maxlength="30" will stop any more than 30 characters from being entered into any given text field...
    <p>
      <label for="textfield">Line 1:</label>
      <input type="text" name="textfield" id="textfield" maxlength="30">
      <br>
    <label for="textfield2">Line 2:</label>
      <input type="text" name="textfield2" id="textfield2" maxlength="30">
      <br>
    <label for="textfield3">Line 3:</label>
      <input type="text" name="textfield3" id="textfield3" maxlength="30">
      <br>
    <label for="textfield4">Line 4:</label>
      <input type="text" name="textfield4" id="textfield4" maxlength="30">
    </p>

  • 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.

  • Maximum number of line items in PO/SA....

    Hi,
    1.
    What is the limitation on maximum number of line items in a PO/schedulling agreement/Contract.
    2.
    Also what is the maximum permissible number of lines in a single accounting document possible.As far as I know there is a limitation of counter 999 meaning if an aaccounting document is generated after GR then it will only allow max 999 lines.
    Is there any other way to avoid this.Because in my case I have for several line items in PO and several pricing conditions with separate GL account.Now when I do GR and if a PO has many line items with about 4 to 5 conditions then for each line item there would be minimum 6-7 entries.
    How can this best be handled in SAP.
    I was being adviced to split the GR but is there any better way or is there any option like summerised acounting document ?
    Please suggest as this is most critical for me.
    Thanks in advance
    Regards,
    manOO

    Hi,
    There is no limitation in PO.  But if you want, you can use following user exit;
    <b>EXIT_SAPMM06E_012</b>
    With regard to Maximum Number of items: There is a limit of (999) line items which can be posted per FI document. This is because the line item number (BSEG-BUZEI) field length is defined as (3) numeric positions, i.e., (999) line items.
    The most commonly used workarounds are as follows:
    (1) Implement FI summarization (per note 36353).
    (2) Cancel the original billing document and split it into smaller documents using different payment terms but actually with the same terms, in case of invoice verification.
    This will avoid the (999) line item limit for FI postings. Please also have a look at the note 117708 and 77161.
    Bye,
    Muralidhara

  • Number of lines in SAP B1 2007A

    Hi all.
    We have a client that use SAP B1 2007A on a SQL server 2005. The sometimes make very big sales quotations which exists of maybe 3000 rows. To my understanding, there is documentation saying there is no limitations on amount of rows it only affects performance. What would be the acceptable performance (measured in time) when adding line number 3001 on a sales quotation?
    For our install, we wait maybe 20 seconds for adding the item and then we wait maybe 1 minute when updating the sales quotation. We are running on a machine with 4 processors and 4GB RAM.
    Does anyone have some other experiences on this field?
    Best regards, Runar Wigestrand.

    Hi Runar,
    A 3000 line quote is too much for B1 to handle. The scenario you mentioned if not the worst in that amount of data. Although it is no limitations on amount of rows, the performance is the LIMIT.
    Even if your client upgrade their hardware to double the performance, it will still be painful.
    Better if they can change their current business process.  I think the number of line can be trimmed if they set up item correctly.
    Thanks,
    Gordon

  • What is the maximum number of line items we can enter in an order...

    Hi,
       Can anyone explain what is the max number of line items that v can enter in an order....
    or if i want to increase the number of line items than the max where it is controlled.
    Because my mm counter part is facing this in the PO he could make only 9999,the problem is when posting...the accounting document is not getting generated bcas of exceeding the limit.
    venugopal

    hi,
    this is my personal experiance that we can enter at the most 499 line items in SALES ORDER.
    This is because for every line item there will be 2 financial entries, debit and credit. and 1 FI document can have at the most 999 line items (which we can not increase without KEY fromSAP)
    If we divide 999 by 2 then it comes to 499.50 so you can enter at the most 499 line items in Sales order.
    Regards
    Vishal

  • How to limit number of logins per day?

    We have a custom web application (WebAS 6.20) used by people and automated systems. Each user has his own login, and some of these automated systems sometimes produce heavy load because they log into system too often.
    Is there an easy way to:
    1) limit number of logins to, say, 1000 per day and when this limit is reached - do not allow this user to login till midnight
    OR
    2) dedicate one of the processes to the specific user
    thanks in advance

    extend PlainDocument class to restrict the number of characters per line.
    Set this class as model to TextArea.
    Below is a class which does this. May be its useful
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    public class FixedNumericDocument extends PlainDocument {
    private int maxLength = 9999;
    private String max="";
    public FixedNumericDocument(int maxLength) {
    super();
    this.maxLength = maxLength;
    //this is where we'll control all input to our document.
    //If the text that is being entered passes our criteria, then we'll just call
    //super.insertString(...)
    public void insertString(int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (getLength() + str.length() > maxLength) {
    return;
    else {
    try {
    //check if str is numeric only
    int value = Integer.parseInt(str);
    //if we get here then str contains only numbers
    //chk if it is less than 65535 so that it can be inserted
    super.insertString(offset, str, attr);
    catch(NumberFormatException exp) {
    return;
    return;

  • Manual posting at level 20 - number of lines available in cons monitor

    Hello,
    I have a question concerning manual postings. We have created a document type and a task for manual postings connected to intercompany eliminations (posting level 20). In the monitor, the users only have 10 lines available for the manual posting and I have not been able to figure out how to increase the number of lines. Has anyone else been able to get more than 10 lines, or is that a limit?
    Thanks in advance!
    Kerstin

    Well, that would be great - but I tested it and I couldn´t make it work? I will try this with my customer again tomorrow, if we can´t make it work I hope it´s OK if I get back to with a follow-up question?
    Kind Regards,
    Kerstin

  • Maximum number of lines in Al11 for csv and txt files

    Hello Experts,
    I need to extract millions of records to a file in AL11 from several DSO - based on fiscal period and year. Can anyone tell me about the maximun number of lines a csv and txt file can hold in AL11.
    Points will be assigned.
    Kevin.

    Hi.
    As per my knowledge there is no limit for text files but for csv file its 1048576 rows.
    Hope this helps.
    Regards
    Sai

  • Set maximum number of line in text area

    Hi !
    I need to limit my text area to 3 lines. How do I do this ?
    I was thinking about character limitation but if the user
    press "enter" 3 times, I'm screwed since it is only 3 characters
    but it bust my 3 lines limit.
    Thx guys !

    You should never limit them to a set number of lines. Go for
    character limitation and test the input value before allowing them
    to submit the form.

  • Set the number of lines allowed in multi-line text field

    Hi,
    I am designing a form where I have some multi-line text fields where I only want the user to be able to enter a maximum of say 5 lines. I know I could do this by enabling the "Limit Length to Visible Area" option, however, this option is ignored by Reader 7 and the field scrolls, hiding any text that spills beyond the visible area from printouts. It works great in 8 though. To avoid this bug/feature in Reader 7, is there some script that I can use to limit the number of lines allowed in a text field?
    Thanks

    I ran into similar issues switching between Acrobat/Reader. Here is the prominent code that works for me when I use this in "Enter" event of the textField.
    var aSOM=this.somExpression.substr(15,this.somExpression.length - 1);
    var acroField = event.target.getField(aSOM);
    acroField.doNotScroll = true;
    I chose Allow Multiple Lines alone and noting else.
    Good Luck,
    SekharN

  • What is the maximum number of lines per PO?

    Are their line limitations per PO? I'm trying to find out if there is a max number of lines you can have on a given PO.
    I assume performance starts to get effected at some point, but at what point might that be? 100 lines, 1000, 5000? We are looking at creating some standard PO's with 500+ lines on them, so we can create ASN against them via iSupplier.
    If you know or have any experience dealing with large PO's please fill me in.
    Thanks,
    Jeremy

    Hello,
    We used to have an interface who imported standard PO, with a contract number as PO number, then the number of lines was increasing. We had a first problem from 200 lines, we had to apply a patch, then the limit was about 900 lines. I made a few searches but this occurs 2 years ago and I'm not even able to find the SR or a patch number ...
    But from a business point of view, it's obviously a bad idea to always have the same PO with a high number of lines (hard to match invoices, PO is never closed, etc.) , from this problem we choose to import PO with PO number generated from the BL number + an suffix (to avoid duplicates PO numbers)
    Hope it helps a little,
    Kind regards,
    Xavier

  • Maximum number of lines textfield

    Hi everybody !
    I need to set a maximum number of lines on a text field that should be expandable up to that line number and not beyond.
    Who do I know how to do?

    You can control the number of chars in the field, you can limit the field to the visible area but you cannot dictate a number of lines that the field can be. The closest thing you can get is to make  the field the max number fo lines and then use "limit to visible area" so that people cannot add more text.
    Paul

  • Maximum number of line items in delivery

    HI experts,
    For open sales orders deliveries are created through VL10c in  background  job
    what are maximum number of  line items a delivery can have and How do I ristrict the Line items?
    Thanks in Advance.

    In standart there is not limit of quantity items in Delivery.
    But you can make limit - see Note 103334.
    SAP recomended 300 pos.

Maybe you are looking for

  • Unable to move message - the message could not be moved to the mailbox trash

    Hi, I have a yahoo email account and suddenly I am unable to delete emails and send them to trash. This is occurring on my iPhone 4 and iPad. I've been through the forum and tried every suggestion, including: 1. Going into settings, mail etc and into

  • Photos do not appear on published site

    My photos do not appear on the page when I publish the site within the computer. Also the hyper linl mwnu at the top of every page are not there either when published. Sounds like I do need help, John

  • 10.8.4 upgrade unable to connect to wifi

    After upgrading to 10.8.4, wireless card will not turn on and find the wireless services. I cannot even turn it on through network preferences.

  • Automatic creation of deliveries in back ground

    Hi All,           I want to create a automatic delivery via background scheduling. I have created the variant for the program RVV50R10C. I have created the role. can u please tell me how to assign the role in the program? The role field in user role

  • How can I down load...

    How can I down load youtube videos on my HD