Present string data as boolean !

hello !
i am recieving data from UDP READ FUNCTION as string and want to present it as bits (like 10011100-11001100.....)
the string indicator allows me to see the data as HEX/CODES/ASCII only.
your help please.
Solved!
Go to Solution.

Himanshu Goyal wrote:
Please see the attached VI. I hope you are looking for the same solution.
Himanshu
Your code is incorrect and much more complicated than needed.
Instead of %b, you need to use format %08b, else the binary formatted strings lose their trailing zeroes and all information is lost.
I don't understand the reason for the parts after the first loop. They do absolutely nothing! What were you thinking?
After creating the faulty output string in the first for loop, you create an array containing the seperate characters, then use built array to convert it to exactly the same 1D array, then you use concatenate strings to merge it back into the single string you had after the first loop already.
Here is a corrected version (your original code is on top for comparison) that could be used if the original poster is looking for an output containing no "-" delimiters.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
StringToBinaryFormattedString.png ‏11 KB

Similar Messages

  • String date to integer

    Need help.
    Does anybody know how to convert a string date to int..
    format of the date is like this(dd-mm-yyyy) example ->15-Aug-1993.
    I would like to convert the corresponding month to int...
    like for Jan=1, Feb=2,Mar=3...Aug=8...Dec=12...
    is there any method in java which supports this kind of conversion?
    sample codes would be of great help.
    Thanks in advance.

    If your intention is to convert "15-Aug-1993" into "15-8-1993", ie a string->string conversion, use a SimpleDateFormat to parse the first string into a Date. And then use another one to format the date into the appropriate format.
    If you want to obtain an integer value from the string according to the scheme you presented, you could parse it as above then use the getMonth() mehod of the Date class. Note: the returned value is zero based (January is zero, not one) and the method is deprecated.
    It's better to use the Calendar class:
    * Use SimpleDateFormat to obtain a Date (ie parse the string)
    * create a Calendar instance and set its time to the date
    * use the get() method of Calendar to obtain the month
    The Calendar class defines a number of int values: Calendar.JANUARY, Calendar.FEBUARY etc. Mostly you use these values without knowing or caring what int values they have.

  • Creating Mime-messages from String data

    How do I save string data of email received from Outlook Express by calling BufferedReader's readLine() method over a socket a connection so that it can be converted into MimeMessage.

    Sorry but i didn't read your code snipppet so well.
    So you have a Vector v wicht contains the client part of the dialog.
    This is a typical conversation: ( you don't use EHLO or HELO handshake!? it's considered rude not to introduce yourself :) )
    EHLO CLIENTNAME
    250
    MAIL FROM:<[email protected]>
    250 MAIL FROM:<[email protected]> OK
    RCPT TO:<[email protected]>
    250 RCPT TO:<[email protected]> OK
    DATA
    354 Start mail input; end with <CRLF>.<CRLF>
    Message-ID: <24569170.1093420595394.JavaMail.cau@PTWPC019>
    From: [email protected]
    To: [email protected]
    Subject: something
    Mime-Version: 1.0
    Content-Type: multipart/mixed;
         boundary="----=_Part_0_17459938.1093420595224"
    ------=_Part_0_17459938.1093420595224
    Content-Type: text/plain; charset=US-ASCII
    Content-Transfer-Encoding: 7bit
    TEXT CONTENTS
    ------=_Part_0_17459938.1093420595224
    Content-Type: text/html; charset=US-ASCII
    Content-Transfer-Encoding: 7bit
    <b>HTML CONTENTS<b>
    ------=_Part_0_17459938.1093420595224--
    250 <412ADBC5000000B5> Mail accepted
    QUIT
    221 ontrob1.bmsg.nl QUIT
    The results in the vector from DATA to the ending dot . should be the part of your constructor string;
    Use this constructor
    MimeMessage mm = new MimeMessage(null,  ByteArrayInputStream( yourstring.getBytes() )  ) ;at this moment you can deconstruct the mime further.
    maybe this code will help:
    you should call the dumpPart method like this dumpPart( mm );
         Store store;
         Folder folder;
         static boolean verbose = false;
         static boolean debug = false;
         static boolean showStructure = true;
         private static void dumpPart(Part part) throws Exception {
              if (part instanceof Message)
                   dumpEnvelope((Message) part);
              /** //Dump input stream ..
              InputStream is = part.getInputStream();
              // If "is" is not already buffered, wrap a BufferedInputStream
              // around it.
              if (!(is instanceof BufferedInputStream))
                   is = new BufferedInputStream(is);
              int c;
              while ((c = is.read()) != -1)
                   System.err.write(c);
              pr("CONTENT-TYPE: " + part.getContentType());
              * Using isMimeType to determine the content type avoids
              * fetching the actual content data until we need it.
              if (part.isMimeType("text/plain")) {
                   pr("This is plain text");
                   pr("---------------------------");
                   if (!showStructure)
                        System.out.println((String) part.getContent());
              } else if (part.isMimeType("multipart/*")) {
                   pr("This is a Multipart");
                   pr("---------------------------");
                   Multipart mp = (Multipart) part.getContent();
                   level++;
                   int count = mp.getCount();
                   for (int i = 0; i < count; i++)
                        dumpPart(mp.getBodyPart(i));
                   level--;
              } else if (part.isMimeType("message/rfc822")) {
                   pr("This is a Nested Message");
                   pr("---------------------------");
                   level++;
                   dumpPart((Part) part.getContent());
                   level--;
              } else if (!showStructure) {
                   * If we actually want to see the data, and it?s not a
                   * MIME type we know, fetch it and check its Java type.
                   Object o = part.getContent();
                   if (o instanceof String) {
                        pr("This is a string");
                        pr("---------------------------");
                        System.out.println((String) o);
                   } else if (o instanceof InputStream) {
                        System.err.println("HELLO CAU 1111");
                        pr("This is just an input stream");
                        pr("---------------------------");
                        InputStream is2 = (InputStream) o;
                        int c2;
                        while ((c2= is2.read()) != -1)
                             System.out.write(c2);
                        System.err.println("\nHELLO CAU");
                   } else {
                        pr("This is an unknown type");
                        pr("---------------------------");
                        pr(o.toString());
              } else {
                   pr("This is an unknown type");
                   pr("---------------------------");
         private static void dumpEnvelope(Message msg) throws Exception {
              pr("This is the message envelope");
              pr("---------------------------");
              Address[] a;
              // FROM
              if ((a = msg.getFrom()) != null) {
                   for (int j = 0; j < a.length; j++)
                        pr("FROM: " + a[j].toString());
              //TO
              if ((a = msg.getRecipients(Message.RecipientType.TO)) != null) {
                   for (int j = 0; j < a.length; j++)
                        pr("TO: " + a[j].toString());
              // SUBJECT
              pr("SUBJECT: " + msg.getSubject());
              // DATE
              Date d = msg.getSentDate();
              pr("SendDate: " + (d != null ? d.toString() : "UNKNOWN"));
              //FLAGS
              Flags flags = msg.getFlags();
              StringBuffer sb = new StringBuffer();
              Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
              boolean first = true;
              for (int i = 0; i < sf.length; i++) {
                   String s;
                   Flags.Flag f = sf;
                   if (f == Flags.Flag.ANSWERED)
                        s = "\\Answered";
                   else if (f == Flags.Flag.DELETED)
                        s = "\\Deleted";
                   else if (f == Flags.Flag.DRAFT)
                        s = "\\Draft";
                   else if (f == Flags.Flag.FLAGGED)
                        s = "\\Flagged";
                   else if (f == Flags.Flag.RECENT)
                        s = "\\Recent";
                   else if (f == Flags.Flag.SEEN)
                        s = "\\Seen";
                   else
                        continue; // skip it
                   if (first)
                        first = false;
                   else
                        sb.append(' ');
                   sb.append(s);
              String[] uf = flags.getUserFlags(); // get user-flag strings
              for (int i = 0; i < uf.length; i++) {
                   if (first)
                        first = false;
                   else
                        sb.append(' ');
                   sb.append(uf[i]);
              pr("FLAGS: " + sb.toString());
              // X-MAILER
              String[] hdrs = msg.getHeader("X-Mailer");
              if (hdrs != null)
                   pr("X-Mailer: " + hdrs[0]);
              else
                   pr("X-Mailer NOT available");
         static String indentStr = " ";
         static int level = 0;
         * Print a, possibly indented, string.
         public static void pr(String s) {
              if (showStructure)
                   System.out.print(indentStr.substring(0, level * 2));
              System.out.println(s);
    Tricae

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trun

    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    Thanks in advance.
    -R

    Sorry for incomplete information. Basically there is a insertion and then there is retrieval of information from the same data table.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right trunca

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

    Dear All,
    I am getting the following error like "07/01 17:33:33 (3380 0EC4): Encountered ODBC error 1: 01004, 0, [Oracle][ODBC]String data, right truncated."
    What does this error means.The set of query I am running for insertion is same for 32bit(Windows 2003 Server) and 64bit (Windows 2008 Server R2).
    In case of the former this works perfectly without any error but in case of 64bit I am getting the above issue.Any suggestion would be of great help and what is the workaround for this.
    When I am inserting data of blob type I am getting data and grabage value also.
    From the backend when I am using plsql and querying on that paritcular table from the 2nd row onwards I am getting garbage value apended with the string.How I see the garbage is when I click on the blob data under the plsql respective table it takes me to string by default for all the columns containing blob and from 2nd column onwards I get the garbage appended with the string.
    This garbage value is not present in the 1st row at all but it from the 2nd row it comes.
    desc of the particular table I am talking about is
    SQL> desc Table_1084;
    Name Null? Type
    BBID NOT NULL NUMBER
    KEYORDER NOT NULL NUMBER
    KEYLENGTH NOT NULL NUMBER
    DTTM_DOM NOT NULL NUMBER(2)
    KEYVALUE BLOB
    2ndly I tried to remove the garbage using memset.This time there is no garbage but from the 2nd row onwards when I click on the blob from the plsql backend
    I did memset for deleting the garbage.But then after 2nd column onwards when I click on the blob it takes me hex by default not to text.When I come to text I don't see any garbage.
    In both the cases I get the above error when I try to retrieve the above information from the DB.
    The same set of query runs well when I use Windows 32bit but I am getting issue when I am using Windows 2008 Server 64bit.
    Below I have given the code snipet any thoughts or inputs would be very much appreciated.
    SQLLEN lsqlkeyElementIDLengths = *(this->keyElementIDLengths);
    SQLBindParameter(this->statement,1, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementBlackBoxIDs, 0, &lsqlkeyElementIDLengths);
    SQLLEN lsqlkeyElementOrderLengths = *(this->keyElementOrderLengths);
    SQLBindParameter(this->statement,2, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementOrders, 0, &lsqlkeyElementOrderLengths);
    SQLLEN lsqlkeyElementLengthLengths = *(this->keyElementLengthLengths);
    SQLBindParameter(this->statement,3, SQL_PARAM_INPUT, SQL_C_ULONG, SQL_INTEGER,
    0, 0, this->keyElementLengths, 0, &lsqlkeyElementLengthLengths);
    SQLLEN lsqlkeyElementValueLengths = *(this->keyElementValueLengths);
    SQLBindParameter(this->statement,4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY,
    elementSize, 0, this->keyElementValues,
    elementSize, &lsqlkeyElementValueLengths);
    SQLExecDirect(this->statement, (unsigned char*) insertcommand, SQL_NTS);
    Here the this->keyElementValues is of void pointer.
    When I query on the back ground I get the below garbage value
    ntdll.dll!KiFastSystemCallRet 0x7c8285ec
    kernel32.dll + 0x24ed (0x77e424ed)
    termite.exe!CTermiteDlg::TestRegisterMemoryProc 0x004050ed c:\cm\build\public\tkbkwincln.10-01-06\talkback\src\client\termite\win32\termdlg.cpp, line 460Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾Þï¾
    Let me know if I can provide more information.
    Thanks,
    -R

  • The "write key" configurat​ion file vi use of "trim string" prior to writing the data can modify any string data written.

    I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
    I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
    After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
    1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
      and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
    2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
    or
    3)  You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
    Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like    key="\20Hello\20World\20"   while option #2 produces an entry that looks like   key=" Hello World "
    The attached PDF contains screenshots of all this.
    Attachments:
    Binder1.pdf ‏2507 KB

    Hi Warren,
    there's a 4th option:
    Simply set the "write raw string" input of the write key function to TRUE
    This option only appears when a string is wired to that function!
    Just re-checked:
    I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
    Message Edited by GerdW on 05-02-2009 08:32 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Need to convert string data to numbers.

    I have string data that I need to convert to numbers so that I can graph it or perform calculations on it. The data (file attached) is in three columns (tab separated) and is in the format time/double/time (saved as a string with Write haracters to File.) When I try Read From Spreadsheet I get 0.0000 for column 1 and 2.0000 for column 3.
    Attachments:
    testOK.txt ‏1 KB

    Hi,
    I've done this through scan from file, using %s%f%s%s so I get the relative time, numeric, time, PM
    See the attached .vi.
    Hope it helps
    S.
    // it takes almost no time to rate an answer
    Attachments:
    disect_data.vi ‏46 KB

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

  • Smartform Problem in Displaying a string data

    Hi Friends,
                     I am facing a problem while displaying a string data in smartform. Actually it is a one of the field's data in an internal table. It is a STRING field type of length 0. While populating in an internal table it is having a all the data(Around 700 char data). But while displaying in a smartform surprizingly only few characters(Around 225 char data). How can i overcome this problem?
    Regards,
    Sekhar.J

    Hi
    try this and see
    Declare some Variables of 72 char each and split that long string data of internal table text field into them and display these variables strings one below other in smartform
    var1 = itab-text+0(72)
    var2 = itab-text+72(72)
    var3 = itab-text+144(72)
    like that
    and display one below other in smartform.
    &VAR1&
    &VAR2&
    &VAR3&
    Reward points for useful Answers
    Regards
    Anji

  • Dynamic structure of "string" data type. Please help.

    ABAPers,
    I am calling cl_alv_table_create=>create_dynamic_table method to dynamically create a structure. The input structure definition is as follows:
    data: xfc type lvc_s_fcat.
    data: ifc type lvc_t_fcat.
    * define Fld1
    clear xfc.
    xfc-fieldname = 'Fld1'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    * define Fld2
    clear xfc.
    xfc-fieldname = 'Fld2'.
    xfc-datatype = 'string'.
    append xfc to ifc.
    Although the call to create_dynamic_table does not throw any exceptions, it appears Fld1 and Fld2 are not of "string" data type. I don't know of a way to see what type they are. However, they do have a length limit of 10 characters.
    After some experimenting, it turns out that the method simply ignores "datatype" value if it doesn't understand it and creates the field with some default data type.
    I would appreciate it if someone can show me how to create fields of "string" data type.
    Thank you in advance for your help.
    Pradeep

    That's right, use STRG as the datatype.  Please see the example program.
    report zrich_0003.
    type-pools: slis.
    data: new_table type ref to data,
          new_line  type ref to data.
    data:  xfc type lvc_s_fcat,
           ifc type lvc_t_fcat.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <fs>.
    start-of-selection.
      clear xfc.
      xfc-fieldname = 'Field1' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
      clear xfc.
      xfc-fieldname = 'Field2' .
      xfc-datatype = 'STRG'.
      append xfc to ifc .
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = ifc
        importing
          ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      assign component 1 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 1'.
      assign component 2 of structure <dyn_wa> to <fs>.
      <fs> = 'This is string 2'.
      append <dyn_wa> to <dyn_table>.
    * Write the values of internal table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component sy-index of structure <dyn_wa> to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          write:/ <fs>.
        enddo.
      endloop.
    REgards,
    Rich Heilman

  • Xy graph in GUI. Show string data related to a X,Y point

    It is possible to show string data, while hovering the mouse or clicking a cursor, attached/related to a X,Y point in a XY graph??
    Kind regards

    I assume you want to let the x-y-value pair hover over the graph at mouse position.Perhaps this will help you:
    http://forums.ni.com/t5/LabVIEW/Text-overlay-annotation-onto-an-intensity-graph/m-p/883438/highlight...
    Another option might be just to use the cursor functionalities of XY graphs, although they don't hover at mouse position.
    Other than that I had a similar request on Image Displays with IMAQ (Vision Development Module) where it turned out that using a simple string control from the classic palette that you move around according to mouse position is an efficient way to let information hover wherever you want. Check it out:
    http://forums.ni.com/t5/LabVIEW/Why-do-overlays-take-so-much-longer-on-single-precision/m-p/2376338#...

  • Datetime field overflow / String data right truncation

    Hi All,
    Getting the follwing erros while working with timestamp for selecting from or inserting data into DB2 through WebSphere 6.1.
    I am passing values like this: 2006-05-02-21.57.26.744341.
    The queries run fine while executing through some SQL Frontend editor.
    [IBM][CLI Driver] CLI0114E Datetime field overflow. SQLSTATE=22008
    [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
    Please let me know the problem.

    If you are trying to convert to a java.sql.Timestamp as part off the process of inserting into DB2 then Timestamp is derived from java.util.Date which holds the time in milli-seconds but you are providing a microseconds field.
    Could this be the problem?

  • String Data-Loss over Sockets

    I have some code that sends strings through a socket to a C++ program on another machine.
    The test strings I have been using are three characters long (i.e. 6 bytes). The buffer size I have put on the socket is 72 bytes, so I should have no problem writing these strings.
    The first three strings always arrive at the other program fine, BUT after that, only a substring of each string seems to get through. I am absolutely certain that the strings are complete before I send them, because I print it to the screen at the same time.
    I have tried change the style of output stream I use (I have used DataOutputStream, BufferedOutputStream, BufferedWriter, StringWriter, and PrintWriter. It still happens.
    Can anybody tell me why this might happen?
    - Adam

    Without more info it is hard guessing. If you want
    reassurance that it should work, then yes, it should
    work.-(Well that's kinda what I'm looking for. I'm wondering if anybody knows of a reason why a C++ program (running in windows -- btw, not by my choice) would read the string differently than a java program?
    For all the XxxWriter types you used, I hope you
    declared the charset to be one that preserves the
    2bytes/char you expect (UTF-8 and ISO8859-1 aren't).I haven't modified that from whatever default is set. This may be the probelm, I will look into that, thanks.
    You certainly did not use the BufferedOutputStream
    without somehow encoding the characters into bytes,
    so how did you do? I'm not sure (it was last week that I tried it) but I think the BufferedOutputStream has a method writeBytes(String) that I used.
    For DataOutputStream, I hope you
    used writeChar, which guarantees that 2bytes/char are
    send. Nope. I mostly tried to stick with methods that accept a String, so that I was sure that it was sent out in the right format to be read back in as a String. I wasn't sure what the actually format of a String is, when passed through a socket, specifically, if there is a terminating character (I know C uses a \0 to end the string). Is there any additionl info need to write a string to a socket?
    If you did all this, ... well I would not
    fiddle with the socket's buffer size.Sorry, but I may have to maintain a low buffer size, because these strings are not the only things being sent over this socket. Do you think the buffer size is affecting the problem. I wondered, but the buffer size seems more than large enough to send 3 character strings.
    That's all that comes to mind. Did you try netcat
    (aka nc) as a server to make sure the problem is not
    at the receiving end?I haven't tried this yet, but I will if I can't figure this out. Unfortunately, I'm NOT the author of the code that recieves the data, and the guy who is has simply assumed that the problem is my fault (although he's never actually tested his code with the string data being sent before), and is not interested in checking to make sure he's done it right. I tried looking over his code, but he's got the input routine burried in an #include file that I don't have.
    Thanks for the input, Harald. There are a few things there that I will look into.
    - Adam

  • String data to Sign data

    I am using a device where I receive a string data output which has a meaning.
    For example:
    :000000 -0067U 0004 -0578
    :000000 -0067U 0004 -0578
    :000000 -0066U 0004 -0579
    :000000 -0066U 0003 -0579
    :000000 -0066U 0003 -0580
     I need to extract the 9th and 11th character through a string subset.
    I have a question, please the attached VI:
    1. Is it correct extraction method? any other suggestion?
    2. The 9th character actually is the sign of character 11 i.e +(if space) and - (is shown as minus)
    Then I have to take this number for e.g -5  or +5 then use in another calculation but problem is how can I convert the _ and +  from string to the number? then how can I make the 9th and 11th character as one number.
    Attachments:
    string.vi ‏14 KB

    Maybe the last part can be simplified. Please see the image.
    I modified your input a little bit since your data only contained "minus". I changed row 2 to have a "space" which should be interpreted as positive sign. Moreover, row 4 shows a explicit "plus" sign in the ninth position. Note that both space and plus are correctly interpreted as positive.
    Consider sanitizing the input. The 0th-row with "-0587" does not follow the syntax of all the other rows so it should be removed.
    Regards,
    Attachments:
    Solution.PNG ‏24 KB

  • How to send string data through socket!

    Is there any method to send string data over socket.
    and if client send string data to server,
    How to get that data in server?
    Comments please!

    Thank for your kind answer, stoopidboi.
    I solved the ploblem. ^^;
    I open the source code ^^; wow~~~~~!
    It will useful to many people. I spend almost 3 days to solve this problem.
    The program works like this.
    Client side // string data ------------------------> Server side // saving file
    To
    < Server Side >
    * Server.java
    * Auther : [email protected]
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Server extends JFrame
         private JTextField enter;
         private JTextArea display;
         ObjectInputStream input;
         DataOutputStream output;
         FileOutputStream resultFile;
         DataInputStream inputd;
         public Server(){
              super("Server");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent ev){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display),
                     BorderLayout.CENTER);
              setSize(300, 150);
              show();
         public void runServer(){
              ServerSocket server;
              Socket connection;
              int counter = 1;
              display.setText("");
              try{
                   server = new ServerSocket(8800, 100);
                   while(true){
                        display.append("Waiting for connection\n");
                        connection = server.accept();
                        display.append( counter + " connection is ok.\n");
                        display.append("Connection " + counter +
                             "received from: " + connection.getInetAddress().getHostName());
                        resultFile = new FileOutputStream("hi.txt");
                        output = new DataOutputStream(resultFile);
                        output.flush();
                        inputd = new DataInputStream(
                             connection.getInputStream()
                        display.append("\nGod I/O stream, I/O is opened\n");
                        enter.setEnabled(true);
                        try{
                             while(true){
                                  output.write(inputd.readByte());
                        catch(NullPointerException e){
                             display.append("Null pointer Exception");
                        catch(IOException e){
                             display.append("\nIOException Occured!");
                        if(resultFile != null){
                             resultFile.flush();
                             resultFile.close();
                        display.append("\nUser Terminate connection");
                        enter.setEnabled(false);
                        resultFile.close();
                        inputd.close();
                        output.close();
                        connection.close();
                        ++counter;
              catch(EOFException eof){
                   System.out.println("Client Terminate Connection");
              catch(IOException io){
                   io.printStackTrace();
              display.append("File is created!");
         public static void main(String[] args){
              Server app = new Server();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runServer();
    < Client side >
    * Client.java
    * Auther : [email protected]
    package Client;
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Client extends JFrame
         private JTextField enter;
         private JTextArea display;
         DataOutputStream output;
         String message = "";
         public Client(){
              super("Client");
              Container c = getContentPane();
              enter = new JTextField();
              enter.setEnabled(false);
              enter.addActionListener(
                   new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                             //None
              c.add(enter, BorderLayout.NORTH);
              display = new JTextArea();
              c.add(new JScrollPane(display), BorderLayout.CENTER);
              message = message + "TT0102LO12312OB23423PO2323123423423423423" +
                        "MO234234LS2423346234LM2342341234ME23423423RQ12313123213" +
                        "SR234234234234IU234234234234OR12312312WQ123123123XD1231232" +
                   "Addednewlinehere\nwowowowwoww";
              setSize(300, 150);
              show();
         public void runClient(){
              Socket client;
              try{
                   display.setText("Attemption Connection...\n");
                   client = new Socket(InetAddress.getByName("127.0.0.1"), 8800);
                   display.append("Connected to : = " +
                          client.getInetAddress().getHostName());
                   output = new DataOutputStream(
                        client.getOutputStream()
                   output.flush();
                   display.append("\nGot I/O Stream, Stream is opened!\n");
                   enter.setEnabled(true);
                   try{
                        output.writeBytes(message);
                   catch(IOException ev){
                        display.append("\nIOException occured!\n");
                   if(output != null) output.flush();
                   display.append("Closing connection.\n");
                   output.close();
                   client.close();
              catch(IOException ioe){
                   ioe.printStackTrace();
         public static void main(String[] args){
              Client app = new Client();
              app.addWindowListener(
                   new WindowAdapter(){
                        public void windowClosing(WindowEvent e){
                             System.exit(0);
              app.runClient();

Maybe you are looking for

  • Same query at same time, but different execution plans from two schemas

    Hi! We just had some performance problems in our production system and I would like to ask for some advice from you. We had a select-query that was run from USER1 on SCHEMA1, and it ran a table scan on a huge table. Using session browser in TOAD I co

  • Non-accessible signature in Reader

    I created a document in Adobe XI Pro using Word 2007.  At that time, all the fields (including signatures) in the form worked fine.  We have since upgraded to Windows 8 and now the signature boxes are not fillable in reader.  I have recreated the for

  • (Text) Field Enhancement - in Customer Master

    Hi Experts, Pls. let me know that Steps involved in Text Enhancements? My requirement is that I need to do text enhancement for KATR6 field's description from Attribute 6 to my_own_description in Customer Master. How to proceed, pls. step by step? Th

  • Out of application memory when starting iPhoto

    i get a "out of application memory" notification when trying to start iPhoto

  • Widget Browser can't be started

    Hello, I can't start the Widget Browser. I get the message "Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (http://www.adobe.com/cfusion/exchange/exchangedwwidgetsfacade.cfc?wsdl)" What can I do? I use Windo