Problem with long text field.

Hi all,
I have a problem when I try to concatenate two fields.
It seems the new field only is 254 characters long?
Here is my syntax:
data: w_long_text(1000).
clear w_long_text.
    loop at iline.
      concatenate w_long_text iline-tdline into w_long_text separated by space.
    endloop.
I'm sure the text is longer then 254 becuase I can see the text in an Activity in the Sap Crm system.
Best Regards
Frode

Hi thomas
wat i would suggest you is better take an internal table with long_text(255) field .
data : begin of it_text occurs 0,
            long_text(255),
          end of it_text.
clear : w_long_text,it_text.
loop at iline.
concatenate w_long_text iline-tdline into w_long_text separated by space.
<b>it_text-long_text = iline-tdline.</b>
append it_text.
clear it_text.
endloop.
and when displaying the text keep that in a loop and print it.
This way u can display the whole text irrespective of the char length.
Reward points if helpful
Regards
Zarina

Similar Messages

  • Problem with long text field in PLD

    Hi all.
    I´m doing a layout for A/R invoices. I have a user field of text type. When I try to display this field and the text is too long the PLD make a new line. but in the first line cut me some characters. How can I fix this issue?
    Can you help me?
    Thanks

    The Aligment properties are:
        *Horizontal: Left
        *Vertical: Top
        *Line break: Divide into rows
        *Length:
        *Filler:
        *Field haight adjustment: checked
        *Sum in words: Not checked
        *Suppress zeros: Not checked

  • Problem with long text

    Hi folks,
    iam uploading longtext in transaction KP06 in bdc programing using create_text.
    now my problem is if i pass selection criteria
    case 1:
    Vertion : N0
    fiscal year : 2007
    planner profile: CCPLAN4
    then the budeget plan data uploading successfully along with long text.
    case2: Vertion : N1
    in this case also everthing wrking fine
    case3: Vertion : 001
    in this case budgetplan data uploading sucessfully but longtext is not uploading,
    i debbug the proragm , create_text also returning sy-subrc = 0. but if i check in KP06  the long text is not there.
    data declaration
    vertion : VERSN type C(3)
    can u tell me the problem is in logic or with FM ?
    note : i checked with save_text also.
    regards
    neeru

    HI Naimesh,
    the FM Create_text internally contains both FMs save_text and commit_text,
    even i debug the FM in case of vertion N1, N0 and 001,
    all the cases sy-subrc = 0.
    code:
    CLEAR G_OBJNR.
    LOOP AT RECORD.
    COST = RECORD-BDC01.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = COST
        IMPORTING
          output = COST.
        CONCATENATE 'KS' p_kokrs record-bdc00 INTO g_objnr.
            SELECT SINGLE * FROM COSP WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
      IF SY-SUBRC = 0.
          LEDNR = COSP-LEDNR.
          OBJNR = COSP-OBJNR.
          GJAHR = COSP-GJAHR.
          WRTTP = COSP-WRTTP.
          VERSN = COSP-VERSN.
          KSTAR = COSP-KSTAR.
          HRKFT = COSP-HRKFT.
          VRGNG = COSP-VRGNG.
          VBUND = COSP-VBUND.
          PARGB = COSP-PARGB.
          BEKNZ = COSP-BEKNZ.
          TWAER = COSP-TWAER.
    CONCATENATE LEDNR OBJNR INTO OBJNR.
    CONCATENATE OBJNR GJAHR INTO TNAME1 separated BY SPACE10.
    CONCATENATE TNAME1 WRTTP VERSN INTO TNAME2.
    CONCATENATE TNAME2 KSTAR INTO TNAME3 separated BY SPACE.
    CONCATENATE TNAME3 VRGNG INTO TNAME4 separated BY SPACE4.
    CONCATENATE TNAME4 BEKNZ INTO TNAME5 separated BY SPACE10.
    CONCATENATE TNAME5 TWAER INTO TNAME.
    I_THEAD-TDOBJECT = 'CCSS'.
    I_THEAD-TDID = 'COSP'.
    I_THEAD-TDNAME = TNAME.
    I_THEAD-TDSPRAS = 'E'.
    APPEND I_THEAD.
    i_tline-tdformat = '*'.
    I_TLINE-TDLINE = RECORD-LONGTEXT.
    APPEND I_TLINE.
    loop at i_thead.
    CALL FUNCTION 'CREATE_TEXT'
      EXPORTING
        FID               = I_THEAD-TDID
        FLANGUAGE         = I_THEAD-TDSPRAS
        FNAME             = I_THEAD-TDNAME
        FOBJECT           = I_THEAD-TDOBJECT
      SAVE_DIRECT       = 'X'
      FFORMAT           = '*'
      TABLES
        FLINES            = i_tline
    EXCEPTIONS
      NO_INIT           = 1
      NO_SAVE           = 2
      OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CLEAR I_TLINE.
    REFRESH I_TLINE.
    CLEAR I_THEAD.
    REFRESH I_THEAD.
      SELECT SINGLE * from cokp into itab WHERE OBJNR = g_objnr
                              AND GJAHR = P_GJAHR
                              AND VERSN = p_ver
                              AND KSTAR = COST.
    if sy-subrc = 0.
       itab-TXFLG = 'X'.
       append itab.
       write:/ 'Text saved for', record-bdc00 , record-bdc01.
       else.
          write:/ 'Text saved for', record-bdc00 , record-bdc01.
          ENDIF.
    ENDIF.
    my program wrking fine but the long text is not visible for vertion 001.
    regards
    niru

  • Problem with a text field

    Hi,
    I want to load a string of characters to a text field of a table. I'm using SQL Loader.
    I've tried to declare the field in several types: varchar2(4000), clob, raw, etc, but when I run sql loader to load the text I get the same error: The data file exceeds maximum lenght. I've tried with a shorter text and it works.
    My question is, why I can't load long characters in that field?
    Thanks in advance.
    Regards.

    Although you have made your table column up to size 4000, SQLLoader have not got a clue about that. You still need to tell SQLLoader that the text coming in is more than the default 255 in your control file. Strange isn't it?
    Here is my table named testlog. Note that I changed the column names LOG, DAY, TIME and TYPE because they are reserved Words
    SQL> CREATE TABLE TESTLOG
      2  (LOG_1 CHAR(3) NOT NULL,
      3  DAY_1 DATE,
      4  TIME_1 CHAR(8),
      5  SOURCE VARCHAR2(100),
      6  EVENTID NUMBER(22),
      7  TYPE_1 VARCHAR2(64),
      8  CATEGORY VARCHAR2(64),
      9  USER0 VARCHAR2(64),
    10  COMPUTER VARCHAR2(64),
    11  MESSAGE VARCHAR2(4000) NOT NULL)
    12  /
    Table created.
    SQL> desc testlog
    Name                                                                                                      Null?    Type
    LOG_1                                                                                                     NOT NULL CHAR(3)
    DAY_1                                                                                                              DATE
    TIME_1                                                                                                             CHAR(8)
    SOURCE                                                                                                             VARCHAR2(100)
    EVENTID                                                                                                            NUMBER(22)
    TYPE_1                                                                                                             VARCHAR2(64)
    CATEGORY                                                                                                           VARCHAR2(64)
    USER0                                                                                                              VARCHAR2(64)
    COMPUTER                                                                                                           VARCHAR2(64)
    MESSAGE                                                                                                   NOT NULL VARCHAR2(4000)
    SQL> select * from testlog;
    no rows selected
    SQL>
    I saved the same data you have abvoe in a file named testlog.txt Here is my test controlfile named testlog.ctl
    LOAD DATA
    INFILE 'testlog.txt'
    INTO TABLE testlog
    FIELDS TERMINATED BY ','
    TRAILING NULLCOLS
       LOG_1     CHAR NULLIF (LOG_1=BLANKS)
    , DAY_1     DATE "DD/MM/YYYY" NULLIF (DAY_1=BLANKS)
    , TIME_1    CHAR NULLIF (TIME_1=BLANKS)
    , SOURCE    CHAR NULLIF (SOURCE=BLANKS)
    , EVENTID   INTEGER EXTERNAL NULLIF (EVENTID=BLANKS)
    , TYPE_1    CHAR NULLIF (TYPE_1=BLANKS)
    , CATEGORY  CHAR NULLIF (CATEGORY=BLANKS)
    , USER0     CHAR NULLIF (USER0=BLANKS)
    , COMPUTER  CHAR NULLIF (COMPUTER=BLANKS)
    , MESSAGE   CHAR(4000) NULLIF (MESSAGE=BLANKS)
    Here is the Result of my test run
    D:\DBMSDIRECT\DBA\Test>sqlldr userid=test control=testlog.ctl
    Password:
    SQL*Loader: Release 11.1.0.6.0 - Production on Fri Nov 5 15:36:05 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Commit point reached - logical record count 1
    D:\DBMSDIRECT\DBA\Test>
    Here is the Result in the table
    SQL> col message format a50
    SQL> col source  format a50
    SQL> col category  format a10
    SQL> col source  format a10
    SQL> col user0  format a10
    SQL> col type_1 format a10
    SQL> col computer format a10
    SQL> set pasge 20
    SQL> select * from testlog;
    LOG DAY_1     TIME_1   SOURCE        EVENTID TYPE_1     CATEGORY   USER0      COMPUTER   MESSAGE
    SEC 04-NOV-10 12:26:02 Microsoft-       4656 Success    12800                 server1.it A handle to an object was requested.^`^`Subject:^`
                           Windows-Se                                             acasa-sa.c  Security ID: S-1-5-21-3830471607-3036766313-42914
                           curity-Aud                                             om         15205-2156^` Account Name: mbelles^` Account Domai
                           iting                                                             n: ITACASA-SA^` Logon ID: 0x38988bbc^`^`Object:^`
                                                                                             Object Server: Security^` Object Type: File^` Obje
                                                                                             ct Name: K:\AMBIENTE^` Handle ID: 0x1e18^`^`Proces
                                                                                             s Information:^` Process ID: 0x4^` Process Name: ^
                                                                                             `^`Access Request Information:^` Transaction ID: {
                                                                                             00000000-0000-0000-0000-000000000000}^` Accesses:
                                                                                             %%4416^` ^` Access Mask: 0x1^` Privileges Used for
                                                                                              Access Check: -^` Restricted SID Count: 0
    1 row selected.
    SQL>

  • Problem with a text field check

    When there is nothing placed inside the text field it will return a message dialog box saying that there is nothing located inside the text field. However if there is something inside the text field it will perform a
    doSpellingSuggestion and write the results to a .txt file.
    This works as the search term can be found within the .txt file.
    However when I try to display a message dialog box to display the contents of the .txt file that contains the spelling suggestion it will come out with an error from the catch statement
    catch(Exception spelling_error)
    JOptionPane.showMessageDialog(null , "Spelling error = " +
    spelling_error.getMessage());
    It keeps showing an error message box saying "Spelling error = null"
    It wont go past this line and thats the problem that i have. I tryed putting
    I tried substituting this in place of the error message above but it wouldnt go down to it
    //Display a message with a spelling suggestion
    JOptionPane.showMessageDialog(null , "Did you mean to spell " +
    search_term + " like this " + buffer.toString());
    but this didnt work
    class spellcheck_button_listener implements ActionListener
    public void actionPerformed(ActionEvent spelling_check)
    try
    String myKey = "0RK+HoNQFHJlcbNPfxgBpcjESUWV96aO";
    String wsdl = "http://api.google.com/GoogleSearch.wsdl";
    String url = "http://api.google.com/search/beta2";
    String ns1 = "urn:GoogleSearch";
    String ns2 = "urn:GoogleSearch";
    if((search_field.getText() == null) || (search_field.getText().equals("")))
    JOptionPane.showMessageDialog(null , "No search term entered in text field"
    + " please enter another search term");
    else
    search_term = search_field.getText();
    //Create the connection
    SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
    SOAPConnection connection = soapConnFactory.createConnection();
    //Create the actual message
    MessageFactory messageFactory = MessageFactory.newInstance();
    SOAPMessage message = messageFactory.createMessage();
    //Create objects for the message parts
    SOAPPart soapPart = message.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPBody bodyName = envelope.getBody();
    SOAPElement bodyElement;
    //Populate the message by adding SOAP body elements to form a semantically meaning
    //SOAP request
    bodyElement = bodyName.addBodyElement(envelope.createName("doSpellingSuggestion" , "ns1" , ns1));
    //Adding content to the message
    //addTextNode used when entering strings , addAttribute used for integers
    bodyElement.addChildElement(envelope.createName("key")).addTextNode(myKey);
    bodyElement.addChildElement(envelope.createName("q")).addTextNode(search_term);
    //Send the message and get a reply
    URLEndpoint endpoint = new URLEndpoint(url);
    //Send the message
    SOAPMessage reply = connection.call(message , endpoint);
    //Getting the content of a Message
    SOAPPart sp = reply.getSOAPPart();
    SOAPEnvelope env = sp.getEnvelope();
    SOAPBody replyBody = reply.getSOAPPart().getEnvelope().getBody();
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Source styleSheet = new StreamSource(translate_file);
    Transformer transformer = transformerFactory.newTransformer(styleSheet);
    Source sourceContent = reply.getSOAPPart().getContent();
    StreamResult result = new StreamResult(spell_check_file);
    transformer.transform(sourceContent, result);
    java.util.Iterator iterator = replyBody.getChildElements();
    while (iterator.hasNext())
    bodyElement = (SOAPBodyElement)iterator.next();
    String url_results = bodyElement.getValue();
    //Close the connection
    connection.close();
    FileReader inputFile = new FileReader(spell_check_file);
    buffer = new StringBuffer();
    // write new list to standard out
    BufferedReader in = new BufferedReader(inputFile);
    String input;
    while ((input = in.readLine()) != null)
    if(!input.startsWith("<?xml version"))
    // Skip XML header
    buffer.append(input + "\n");
    in.close();
    //Display a message with a spelling suggestion
    JOptionPane.showMessageDialog(null , "Did you mean to spell " + search_term +
    " like this " + buffer.toString());
    } //End of else statement
    } //End of try method for search action performed
    catch(Exception spelling_error)
    JOptionPane.showMessageDialog(null , "Spelling error = " +
    spelling_error.getMessage());
    } //End of method actionPerformed for search button
    } //End of class spellcheck_button_listener implements ActionListener

    I don't use SOAP, so I can't test your code.
    If you really want people to read your code then it should be [url http://forum.java.sun.com/features.jsp#Formatting]formatted so it is readable with correct indentation of lines and highlighting of the source code.

  • Problem with Update Text fields in Infoset

    Hi experts,
    Here i would like to rephrase the question. Normaly while working with Infosets, when press "update text fields" button, those fields having text is updated. But one of my field is not updated. I need some help from you for that.
    One more question i've that my field is having check table so i would like to know how exactly the text field is updated.
    scenario.
    Customized IT9320 has field prt_pos added. This field is having check table T528B. But i want text field to be attached is IT1000-STEXT.
    How this can be done, because i suspect that just using check table field IT1000-STEXT is not attached to IT9320-prt_pos.
    Please help. I'm really got stuck here.
    Thanks a lot,
    Toral.
    Hi,
    I'm working on customised Infotype. I need to add one new customised field ie Present Position. This field has number as well as text associated with it. There is a check table attached with this field so that text can be displayed alongwith number.
    I need this field in SAP/Adhoc query. But when i go to SQ02 this fields shows only value. Text is disabled for this field. I'm not sure why is it so.
    I looked into other infotype which as one field using same data element, and that field shows both value as well as text. Please help me to rectify this issue for present position field.
    Thanks,
    Toral.
    Edited by: Toral Sheth on Jul 4, 2008 2:01 PM

    You would be much better off with one multi-line form field.
    There are many problems with trying to determine when one is at the end of the display field with text entry.

  • Problem with validating text field

    Hi All
    i want to validate the text fields present in jsp page for a sturts application..
    i have a jsp page for input then struts form for validation as struts machinism provides and if error occurs it add error to error object.
    i want to display error message in text field when it occurs..
    plz help me to do it
    thanx in advacne

    I'm not getting your requirement clearly, by my understanding ... you need to retrieve database whenever a <select> field trigger "onchange" - am I right?
    If that is your requirement, it depends on what kind of solution you are looking into?
    1. AJAX+Servlet (dojo/jMaki/write your own)
    2. Java Server Faces (MyFaces/JSF)
    3. write yourself a custom TAG (JSTL) to do the purpose (AJAX+Servlet/purely Servlet)
    4. purely JSTL
    5 purely Servlet
    (please "Google" them by appending "<select> <option>"/ "populate combobox")
    Personally I would recommend 1st or 3rd approach, even 2nd approach (MyFaces/JSF) is cool, but if your whole application is not written in JSF, no point to mixed the solutions.
    If you want to try Ajax+TAG approach, refer following:
    http://ajaxtags.sourceforge.net/
    If you wish to use MyFaces approach, please refer following:
    http://avatar21.superihost.com/index.php?entry=entry051020-163838
    A forth/fifth approach will be much browser-portable, but the amount of coding will be more.
    Regards,
    Avatar Ng
    Message was edited by:
    Avatar_Ng
    Message was edited by:
    Avatar_Ng

  • Problem  with Input Text Field

    I am trying to use the binding tag for a inputText field... The value of the text Field is a hashmap, in which the key is equal to the binding variable i have used
    <h:inputText id="ug" binding="#{userBean.ugclassCode}" rendered="true" value="#{userBean.finalUghm}" styleClass="numericalignRight" />
    This is the first time i m trying binding to an inputText so please let me know if this method is correct... and please let me know if there is any other method to accomplish the same.
    Thanks in advance

    Maybe you misunderstand the binding attribute ..
    Two ways to get it work:
    Way 1:
    JSF 1<h:form id="form">
         <h:inputText binding="#{MyBean.inputText}" />
    </h:form>MyBean 1    private HtmlInputText inputText = new HtmlInputText();
        private Map inputValues = new HashMap();
        public HtmlInputText getInputText() {
            inputValues.put("key1", "testvalue1"); // test
            inputText.setValue(inputValues.get("key1"));
            return inputText;
        public void setInputText(HtmlInputText inputText) {
            this.inputText = inputText;
        }Way 2:
    JSF 2<h:form id="form">
         <h:inputText value="#{MyBean.inputValue}" />
    </h:form>MyBean 2    private Map inputValues = new HashMap();
        private String inputValue;
        public String getInputValue() {
            inputValues.put("key2", "testvalue2"); // test
            inputValue = (String) inputValues.get("key2");
            return inputValue;
        public void setInputValue(String inputValue) {
            this.inputValue = inputValue;
        }

  • Mail Merge from Numbers with long text fields

    I'm having trouble doing a Mail Merge that's reading fields from a Numbers spreadsheet. Everything is working as expected except for my one field that contains several sentences of text for each record. Nothing from that field gets transferred into the merged document and there is no error message (the courtesy of an error message would be much appreciated if I'm hitting some limit of the feature!).
    If I make fairly short text fields, it will merge successfully, but it would be tedious to go through my large text field and break each one into multiple shorter ones, and I haven't been able to figure out the limit on text length if there is one, so there would be a lot of trial and error. It doesn't seem to be by number of words, so perhaps it is by number of characters?
    I have tried cutting and pasting into a new table in Numbers, pasting as values in case there was any weird formatting at issue.
    I can't find anything to help me either fix this or at least know what the limitations are on Mail Merge. The only discussion I found here suggested either splitting the text fields or creating a new document, and those haven't worked for me.
    Thanks for any leads people can give me on this!

    mezzaluna wrote:
    Luckily I'm only merging a few dozen records, so I can go through by hand and pick out the odd spaces. But I'm open to any ideas for saving me that work, too!
    Numbers can do a character count, but unfortunately can't do that 'live' as you are entering characters into the entry box; only when the string has actually been entered into a cell.
    You can, however, make an estimate of the number of characters by entering them into a text frame of fixed width using a mono-spaced font. In the examples below, the font is Andale Mono 10pt, and the text boxes are 4.50 inches wide.
    The top example shows the result when exactly 254 characters from the first paragraph of your previous post are entered in the box. For this example, leaving off the two words that wrapped onto line six and including only the first five lines of text would leave a 'headroom' of nine (or ten, depending on whether the space after "but" was included) characters.
    To use: Enter your text into the text box using Andale Mono 10 pt. Select and Cut the first five lines. Click on the table cell to receive this chunk. Go Edit > Paste and Match Style to use the font set in the table, or simply Paste to use Andale Mono in this cell.
    Repeat until all text has been transferred.
    More below.
    You can also get the actual character count using the LEN() function. In the table on the left, each of the cells B3, B4 and B5 contain the formula
    =LEN(A)-254
    A3, A4 and A5 contain part or all of the text shown in the two text boxes. I've set the alignment of these cells to 'Align right' to show the end of each string.
    The Conditional formatting rules below are applied to cells B4 and B5. They set the background colour of the cell to 'amber' when the cell in column A is within 10 characters of the maximum and to red when the maximum is exceeded. The numbers in the cells show how many more characters may be added (negative numbers) or how many excess characters (positive numbers) are in the cell to the left.
    These check cells may be placed in a separate table, and the formula revised to include the table name of the data table.
    Regards,
    Barry

  • Problem with JButtons Text field not updating

    Im working on a program (which has its full code included below incase its part of the problem) which wants to change a Jbutton's name during a program. The way I'm trying to make it change is by having a string, "test", be called "before update". then have the jbuttons text equal test. then, in an actionlistener, it changes string test to equal "after update". This doesn't update the Jbuttons text.
    I don't get any errors when I press the button, but the buttons name is not updating. Whats causing the buttons name not to be updated?
    Thanks for help in advance.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*; 
    public class TicTac extends JFrame {
    public int Teamplaying = 0;
    public int CrossA, CrossB, CrossC, CrossD, CrossF, CrossG, CrossH, CrossI, CircleA, CircleB, CircleC, CircleD, CircleE, CircleF, CircleG, CircleH, CirclI, TLB, TMB, TRB, MLB, MMB, MRB, LLB, LMB, LRB = 0;
    String test = "Before Update";
        public TicTac() {
             JPanel TicTac = new JPanel();
             TicTac.setLayout(new GridLayout(3,4));
                  TicTac.add(new JButton(test));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  TicTac.add(new JLabel("a"));
                  setContentPane(TicTac);
             pack();
             setTitle("Add Numbers Together TicTac");
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             setLocationRelativeTo(null);
        class TopLeftBox implements ActionListener {
             public void actionPerformed(ActionEvent e) {
             String test = "After update";
             if (Teamplaying == 0) {
                  CrossA = CrossA + 1;
                  CrossD = CrossD + 1;
                  CrossG = CrossG + 1;
             else {
                  CircleA = CircleA + 1;
                  CircleB = CircleB + 1;
         public static void main(String[]args) {
        TicTac Toe = new TicTac();
        Toe.setVisible(true);
    }

    1) Strings are immutable meaning you can't change them.
    2) Even if you could, the two test strings are completely different variables.
    3) To change JButton text, you should call its setText method.
    4) For a JButton to perform an action on button press, it needs to have an actionlistener added to it via the addActionListener(...) method.
    5) Please read, study, and review the Sun Swing tutorials. You will benefit greatly from having a solid foundation in Swing basics before you try coding in Swing.
    Good luck.
    Edit: a small example code (SSCCE, if you will):
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Frame extends JFrame
        public Frame()
            JPanel panel = new JPanel();
            JButton button = new JButton("Before Update");
            button.addActionListener(new ButtonListener()); // add actionlistener here
            panel.add(button);
            setContentPane(panel);
            pack();
            setTitle("Frame");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setLocationRelativeTo(null);
        private class ButtonListener implements ActionListener
            public void actionPerformed(ActionEvent e)
                // get the button that called this action
                JButton button = (JButton)e.getSource();
                // update the button's text
                button.setText("After update");
        public static void main(String[] args)
            SwingUtilities.invokeLater(new Runnable()
                @Override
                public void run()
                    new Frame().setVisible(true);               
    }Edited by: Encephalopathic on Apr 28, 2008 9:26 PM

  • Problem with append += text in Text Field

    Hi guys
    i have a problem with append text.
    I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
    Then i have one String and one Text Field.
    Using for loop im getting right results. But when im running script again then im getting  same text again.
    F.ex.
    First time:
    City name: Name 1
    City name: Name 2
    Second time:
    City name: Name 1
    City name: Name 2
    City name: Name 1
    City name: Name 2
    I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
    How to avoid this?
    Here is script:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    _CityAreaTF1 = new TextField();
      _CityAreaTF1.border = true;
      _CityAreaTF1.wordWrap = true;
      _CityAreaTF1.multiline = true;
      _CityAreaTF1.selectable = false;
      _CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
      _CityAreaTF1.name = "CityAreaTF1";
      _CityAreaTF1.embedFonts = true;
      _CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Problem viewing text in long text field

    Hi,
    I have a long text in the screen and it takes 65 characters per line in the long text field. iam able to populate data in the long text field but the text in the long text field is truncating in between the words as shown below.
    SAP Business One users can access and ru
    n reports by using the UI API provided as
    part of the SAP Business One SDK and the
    Crystal Reports .Net Winform viewer. Rea
    d the new ---
    Could any one suggest how to rectify this, my requirement is to end the lines at spaces like
    SAP Business One users can access and run
    reports by using the UI API provided as
    part of the SAP Business One SDK and the
    Crystal Reports .Net Winform viewer. Read
    the new ---
    Appriciate your time.
    Reward points for useful answer.
    Thanks,
    Sreeni.

    here is how I would do it:
    1) convert the input (short text) table to string
    2) apply this code to the string:
    DATA: lv_text TYPE text40,
              lv_length TYPE i.
    WHILE lv_string IS NOT INITIAL.
      lv_length = 39.
      lv_text = lv_string.
      WHILE lv_text+lv_length(1) NE space AND lv_length GE 0.
           lv_text = lv_text(lv_length).
           lv_length = lv_length - 1.
      ENDWHILE.
      IF lv_length GE 0.
         APPEND lv_text TO lt_short_text.
      ENDIF.
       lv_length = lv_length + 1.
       SHIFT lv_string LEFT BY lv_length PLACES.
    ENDWHILE.

  • BAPI_ACC_DOCUMENT_POST long text field missing

    Hi,
    I will have to transfer our vendor open items from v 3.1 to ERP 2004. I
    am using <b>BAPI_ACC_DOCUMENT_POST</b> to upload these open items. However, I
    cannot find the <b>'LONG TEXT'</b> field in the said BAPI. In using <b>F-02</b>, a
    long text field/button is available. <u><b>How can i post an entry in the long text
    field of the line item in f-02 using BAPI_ACC_DOCUMENT_POST</b></u>.
    Also, i have used the extension1 table and a BTE (note 487722) in
    uploading the posting key. Since field bschl is available in table
    accit, there was no problem in doing this. However, i cannot seem to
    find the field long text in this table. Is it available? If not, what
    can I do with the above situation.
    Thanks.

    Hi
    Excuse me! you can't use RFBIBL00, use the fm SAVE_TEXT.
    After calling the BAPI you should have the number of FI document will be created and know in which item you need to insert the long text so:
    THEAD-TDOBJECT     = <Object text>.
    THEAD-TDNAME(4)    = <Company code>
    THEAD-TDNAME+4(10) = <Document number>
    THEAD-TDNAME+14(4) = <Fyscal year>
    THEAD-TDNAME+18(3) = <Item number>.
    THEAD-TDID         = <Id text>.
    THEAD-TDSPRAS      = <Language>.
    THEAD-TDLINESIZE   = 72.
    These are the header data, transfer the text in LINES parameters.
    Max

  • Modifying the lengh of a long text field- Crystal Report version 2011

    Hello,
    I'm having a problem with the long text field in my crystal report.
    I'll desribe the problem:
    We work with BW version 7.4 sp 5.
    I created a BEX Report with an infobject of type Long Text (Long Text is XL).
    I know the length of this field is 1,333 char.
    When I run the Bex Report the field is displayed correctly (long text).
    I then created a Crystal Report 2011 version 14.0.6.1036 RTM based on my BEX Query.
    The problem is that the Crystal report brought this database long text field as a
    String[70]. Thus I get only the first 70 characters of the field.
    Can we modify the settings of the field to enlarge it to be 1,333 characters in
    length?
    Thank you,
    Ayelet

    Hi Jothi,
    Short Text and Long Text are associated objects of a Characteristic from a BEx query.
    The 'Short Text' will not turn to 'Long Text' by setting the 'Can Grow' option.
    In Fact, both are completely different objects.
    -Abhilash

  • G/L Account Long Text Field in Display

    Dear Sir,
    I want G/L Account long text field be displayed along with G/L account number in G/L Account line item display report (FBL3N)
    I cheched the layout, the option of G/L account number is available but option of G/L account Long text is not available.
    Kindly guide me as to how can I do it?
    Regards
    Chirag Shah

    You must do some development for it.
    You can add additional field to FBL*N reports with using BTE exit.
    First of all, if you don't use BTE before, you must create a product on FIBF.
    Call FIBF transaction -> Settings -> Products -> ...of a customer
    Create a new line,
    Product: ZFI
    Text: BTE Products for FI Exit
    Product active: tick checks from activation.
    Then you must call SE11 for structure RFPOS.
    You must use append structure function for this structure and you can define ZFI_RFPOS append structure
    Define 4 fields.
    Component: KUNNR - Component type: KUNNR
    Component: NAMED - Component type: NAME1
    Component: LIFNR - Component type: LINFR
    Component: NAMEK - Component type: NAME1
    Then save and active your RFPOS structure.
    After that, you must do same step for structure RFPOSX.
    Then go to SE37 and copy from SAMPLE_INTERFACE_00001650 to ZFI_INTERFACE_00001650 FM.
    After copy action, you must uncomment this line on ZFI_INTERFACE_00001650 FM's source code. It's very important;
    E_POSTAB = I_POSTAB.
    Then you should add some ABAP code for getting customer & vendor details.
    I give you some examples, you can use it. (Next message on this thread, please check)
    Then save and active FM.
    Call FIBF transaction again.
    FIBF -> Settings -> Process Modules -> ...of a customer
    Define a new line.
    Process: 00001650
    Function Module: ZFI_INTERFACE_00001650
    Product: ZFI
    and this customizing.
    Then you go to SE38 transaction.
    start report RFPOSXEXTEND. After starting, a pop-up appears, you must click YES.
    After those operations, you can see customer/vendor code and their names on FBL3N.
    ABAP source example,
    TABLES : bseg, kna1, lfa1.
    IF sy-tcode = 'FBL3N'.
      CLEAR: bseg.
      SELECT SINGLE *
      FROM bseg
      WHERE bukrs = i_postab-bukrs
           AND belnr = i_postab-belnr
           AND gjahr = i_postab-gjahr
           AND koart = 'K'.
      IF sy-subrc EQ 0.
        e_postab-lifnr = bseg-lifnr.
        CLEAR: lfa1.
        SELECT SINGLE *
        FROM lfa1
        WHERE lifnr = bseg-lifnr.
        IF sy-subrc EQ 0.
          e_postab-namek = lfa1-name1.
        ENDIF.
      ENDIF.
      CLEAR : bseg.
      SELECT SINGLE *
      FROM bseg
      WHERE bukrs = i_postab-bukrs
           AND belnr = i_postab-belnr
           AND gjahr = i_postab-gjahr
           AND koart = 'D'.
      IF sy-subrc EQ 0.
        e_postab-kunnr = bseg-kunnr.
        CLEAR: kna1.
        SELECT SINGLE *
        FROM kna1
        WHERE kunnr = bseg-kunnr.
        IF sy-subrc EQ 0.
          e_postab-named = kna1-name1.
        ENDIF.
      ENDIF.
    ENDIF.

Maybe you are looking for