Problem on converting between different variable types

I have a Basket Class and a Customer Class
The following is the way I declare the variable "basketID" in the type of Basket. How to initialise this variable in this case?
public class Customer{
private Basket basketID;
public Customer()
   basketID = 0; // This is not working because I cannot assign the int type value to a Basket type variable.
     .Also How do I write this type of data into the *.txt file? The basketID cannot be written into the *.txt file...
Any way to solve this problem?
public void writeInfo()
    try {
      PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
          "C:\\Documents and Settings\\Charles\\My Documents\\customerDetail.txt", true)));
      out.println();
      out.write(customerID);
      out.write("  ");
      out.write(basketID); // This is not working because incompatible type between the variable and the write() method.
         .

Charles_Wong wrote:
I have a Basket Class and a Customer Class
The following is the way I declare the variable "basketID" in the type of Basket. How to initialise this variable in this case?
public class Customer{
private Basket basketID;
public Customer()
basketID = 0; // This is not working because I cannot assign the int type value to a Basket type variable.
You need to start with a basic Java tutorial. You're trying to assign the integer value 0 to an object reference. Do you understand why that will never work?
>
>
Also How do I write this type of data into the *.txt file? The basketID cannot be written into the *.txt file...
Any way to solve this problem?
public void writeInfo()
try {
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
"C:\\Documents and Settings\\Charles\\My Documents\\customerDetail.txt", true)));
out.println();
out.write(customerID);
out.write("  ");
out.write(basketID); // This is not working because incompatible type between the variable and the write() method.
Have you read the API docs for PrintWriter? Do you understand why you cannot pass an object into that method?

Similar Messages

  • Do it exist a FM to check possibility of convertion between different type?

    Hi all,
       We have usually met the problem of DUMP when moving or writing a data type of a variable to an other variable which haven't the same data type as data type of moved variable.
       For example:
           - var01 type char10 with content "char_test".
           - var02 type QUAN.
           - MOVE var01 TO var02 => DUMP (because program can't convert "char_test" into QUAN type).
           (we can use instruction WRITE var01 TO var02 to avoid a DUMP, but after, when we use this var02 to compute => DUMP also occurs).
    So could you please tell me if it exist a Function Module in ABAP to check the possibility of conversion between different data type?
    Thanks a lot in advance,
    Vinh Vo

    Dear Vinh,
    Field symbol should solve your problem. In case that does not work, then as per your requirement you can check for conversion using a try-catch block. The code below should give you an idea.
    DATA: var01 TYPE char10 VALUE 'char_test',       " CHAR or any other type
               var02 TYPE quan1.                                   "Field of type QUAN
    TRY.
        MOVE var01 TO var02.
      CATCH cx_sy_conversion_no_number.
        WRITE 'Steps in case conversion is not possible'.
    ENDTRY.
    WRITE / var02.
    The above code will not dump in case of conversions to QUAN. In case a conversion to any other format is required, there will be a similar errors. Please let me know if you need any further help.
    Regards,
    Nimish

  • Strange problem in converting between XML to string and vice versa

    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "&lt;" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • IDOC communication between different basic type releases.

    Has anyone run into a scenario where a newer SAP release would like to send a message to a partner with an older SAP release, using a basic type that does not exist in the older system?  (eg. DELVRY05 which only exists in release 700)
    In this scenario, what is the best practice, other than to have the newer SAP system send an older basic type that does exist in the receiving partner?
    Thanks.

    Hi,
    You can do this by specifying the older release in the partner profile outbound settings (for message type).
    Under the "Outbound options" tab there is a field "Seg. release in IDoc type". There you can specify the older release and the IDoc will automatically be depricated when it is received in the receiving system.
    Regards,
    Gajendra.

  • Dependencies issue between different DC Type.

    Hello Colleagues,
    I have created a new Java DC and have exposed the content as a Public Part with purpose (compilation, assembly, infrastructure ).
    The contents are basically java files.
    Now both the DCs( J2EE and Service) are having dependencies on new java DC and also consuming it's public part.
    But I am not able to make out why J2EE DC is not able to assemble the new DC stuff and same jar is assembled by Service DC.
    Is there any rule like j2ee application(with DC Type visual composer plugin) cannot assemble  the java DC stuff ??
    Thanks & Regards,
    Kamlesh.

    Hi Jason,
        This sounds like Printer driver issue, you must be already aware that when you use LOCL, the system uses the driver installed on your local PC. Please check the device type for HB07
    Also check Note 8928 - List of supported printers/device types

  • Java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv

    Hi all,
    I am writing a servlet that connects to Oracle 8.0.6 through jdbc for jdk1.2 on NT 4.0
    English version and it works fine.
    But when the servlet is deployed to a solaris with Oracle 8.0.5 (not a typo, the oracle on
    NT is 8.0.6 and oracle on solaris is 8.0.5) and jdbc for jdk1.2 (of course, for Solaris),
    the servlet failed with the Exception:
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    (I am using JRun 3.0 as the application and web server for both NT and Solaris)
    (The database in both the NT and solaris platform are using UTF8 charset)
    My servlet looks like this: (dbConn is a Connection object proved to be connected to Oracle
    in previous segment of the same method):
    String strSQL = "SELECT * FROM test";
    try { Statement stmt = dbConn.createStatement();
    ResultSet rs = stmt.execute(strSQL);
    while (rs.next()) {
    out.println("id = " + rs.getInt("id"));
    System.out.println("id written");
    out.println("name = " + rs.getString("name")); // <-- this is the line the
    exception is thrown
    System.out.println("name written");
    } catch (java.sql.SQLException e) {
    System.out.println("SQL Exception");
    System.out.println(e);
    The definition of the "test" table is:
    create table test(
    id number(10,0),
    name varchar2(30));
    There are about 10 rows exists in the table "test", in which all rows contains ONLY chinese
    characters in the "name" field.
    And when I view the System log, the string "id written" is shown EXACTLY ONCE and then there
    is:
    SQL Exception
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    That means the resultset is fetch back from the database correctly. The problem arise only
    during the getString("name") method.
    Again, this problem only happens when the servlet is run on the solaris platform.
    At first I would expect there are some strange code shown on the web page rather than having
    an exception. I know that I should use getBytes to convert between different encodings, but
    that's another story.
    One more piece of information: When all the rows contains ascii characters in their "name"
    field, the servlet works perfectly even in solaris.
    If anyone knows why and how to tackle the problem please let me know. You can feel free to
    send email to me at [email protected]
    Many thanks,
    Ben
    null

    Hi all,
    For the problem I previously posted, I found that Oracle had had such bug filed before in Oracle 7.3.2 (something like that) and is classified to be NOT A BUG.
    A further research leads me to the document of Oracle that the error message:
    "java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv"
    is a JDBC driver error message of error number ORA-17037.
    I'm still wondering why this behaviour will happen only in Solaris platform. The servlet on an NT machine I am using (which has an Oracle 8.0.6 and jdbc for jdk 1.2 running) is working just fine. I also suspect that this may be some sort of mistakes from jdbc driver.
    Nevertheless, I have found a way to work around the problem that I cannot get non-English string from Oracle in Solaris and I would like to share it with you all here.
    Before I go on, I found that there are many people out there on the web that encounter the same problem. (Some of which said s/he has been working on this problem for a month). As a result, if you find this way of working around the problem does help you, please tell those who have the same problem but don't know how to tackle. Thanks very much.
    Here's the way I work it out. It's kinda simple, but it does work:
    Instead of using:
    String abc = rs.getString("SomeColumnContainsNonEnglishCharacters");
    I used this:
    String abc = new String(rs.getBytes("SomeColumnContainsNonEnglishCharacters"));
    This will give you a string WITH YOUR DEFAULT CHARSET (or ENCODING) from your system.
    If you want to convert the string read to some other encoding type, say Big5, you can do it like this:
    String abc = new String(rs.getBytes("SomeColumneContainsNonEnglishCharacters"), "BIG5");
    Again, it's simple, but it works.
    Finally, if anyone knows why the fail to convert problem happens, please kindly let me know by leaving a word in [email protected]
    Again, thanks to those of you who had tried to help me out.
    Creambun
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by creambun creambun ([email protected]):
    Hi all,
    I am writing a servlet that connects to Oracle 8.0.6 through jdbc for jdk1.2 on NT 4.0
    English version and it works fine.
    But when the servlet is deployed to a solaris with Oracle 8.0.5 (not a typo, the oracle on
    NT is 8.0.6 and oracle on solaris is 8.0.5) and jdbc for jdk1.2 (of course, for Solaris),
    the servlet failed with the Exception:
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    (I am using JRun 3.0 as the application and web server for both NT and Solaris)
    (The database in both the NT and solaris platform are using UTF8 charset)
    My servlet looks like this: (dbConn is a Connection object proved to be connected to Oracle
    in previous segment of the same method):
    String strSQL = "SELECT * FROM test";
    try { Statement stmt = dbConn.createStatement();
    ResultSet rs = stmt.execute(strSQL);
    while (rs.next()) {
    out.println("id = " + rs.getInt("id"));
    System.out.println("id written");
    out.println("name = " + rs.getString("name")); // <-- this is the line the
    exception is thrown
    System.out.println("name written");
    } catch (java.sql.SQLException e) {
    System.out.println("SQL Exception");
    System.out.println(e);
    The definition of the "test" table is:
    create table test(
    id number(10,0),
    name varchar2(30));
    There are about 10 rows exists in the table "test", in which all rows contains ONLY chinese
    characters in the "name" field.
    And when I view the System log, the string "id written" is shown EXACTLY ONCE and then there
    is:
    SQL Exception
    java.sql.SQLException: Fail to convert between UTF8 and UCS2: failUTF8Conv
    That means the resultset is fetch back from the database correctly. The problem arise only
    during the getString("name") method.
    Again, this problem only happens when the servlet is run on the solaris platform.
    At first I would expect there are some strange code shown on the web page rather than having
    an exception. I know that I should use getBytes to convert between different encodings, but
    that's another story.
    One more piece of information: When all the rows contains ascii characters in their "name"
    field, the servlet works perfectly even in solaris.
    If anyone knows why and how to tackle the problem please let me know. You can feel free to
    send email to me at [email protected]
    Many thanks,
    Ben<HR></BLOCKQUOTE>
    null

  • How to convert an int variable into String type

    hi everybody
    i want to know how to convert an interger variable into string variable
    i have to implement a code which goes like this
    Chioce ch;
    for(int i=0;i<32;i++)
    // here i need a code to convert the int variable i into a string variable
    ch.add(String variable);
    how do i convert that int variable i into a String type variable??
    can anyone help me?

    Different methods:
    int a;
    string s=a+"";or
    String.valueOf(int) is the better option because Int.toString() generated an intermediate object to get the endresult
    Ema

  • Cannot convert between unicode and non-unicode string data types.

    I'm trying to copy the data from 21 tables in a SQL 2005 database to a MS Access database using SSIS. Before converting the SQL database from 2000 to 2005 we had this process set up as a DTS package that ran every month for years with no problem.  The only way I can get it to work now is to delete all of the tables from the Access DB and have SSIS create new tables each time. But when I try to create an SSIS package using the SSIS Import and Export Wizard to copy the SQL 2005 data to the same tables that SSIS itself created in Access I get the "cannot convert between unicode and non-unicode string data types" error message. The first few columns I hit this problem on were created by SSIS as the Memo datatype in Access and when I changed them to Text in Access they started to work. The column I'm stuck on now is defined as Text in the SQL 2005 DB and in Access, but it still gives me the "cannot convert" error.

    I was getting same error while tranfering data from SQL 2005 to Excel , but using following method i was able to tranfer data. Hopefully it may also help you.
    1) Using Data Conversion transformation
       data types you need to select is DT_WSTR (unicode in terms of SQL: 2005)
    2) derived coloumn transformation
       expression you need to use is :
        (DT_WSTR, 20) (note : 20 can be replace by your character size)
    Note:
    Above teo method create replica of your esting coloumn (default name will be copy of <coloumn name>).
    while mapping data do not map actual coloumn to the destination but select the coloumn that were created by any of above data transformer (replicated coloumn).

  • How to fix "cannot convert between unicode and non-unicode string data types" :/

    Environment: SQL Server 2008 R2
    Introduction:Staging_table is a table where data is being stored from source file. Individual and ind_subject_scores are destination tables.
    Purpose: To load the data from a source file .csv while SSIS define table  fields with 50 varchar, I can still transfer the data to the entity table/ destination and keeping the table definition.
    I'm getting validation error "Cannot convert between a unicode and a non-unicode string data types" for all the columns.
    Please help

    Hi ,
    NVARCHAR = DT_WSTR
    VARCHAR = DT_STR
    Try below links:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ed1caf36-7a62-44c8-9b67-127cb4a7b747/error-on-package-can-not-convert-from-unicode-to-non-unicode-string-type?forum=sqlintegrationservices
    http://social.msdn.microsoft.com/Forums/en-US/eb0d1519-4be3-427d-bd30-ae4004ea9e8d/data-conversion-error-how-to-fix-this
    http://technet.microsoft.com/en-us/library/aa337316(v=sql.105).aspx
    http://social.technet.microsoft.com/wiki/contents/articles/19612.ssis-import-excel-to-table-cannot-convert-between-unicode-and-non-unicode-string-data-types.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • Preserve variable type between handlers

    How can I make a script like the following preserve variable type between handlers?
    global theURLs
    set theURLs to "http://www.reddit.com/,www.google.com"
    testVar1(theURLs)
    testVar2(theURLs)
    on testVar1(theURLs)
              if theURLs contains "," then
                        set {myTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {","}}
                        set theURLs to text items of theURLs
                        set AppleScript's text item delimiters to myTID
              end if
              return theURLs
    end testVar1
    on testVar2(theURLs)
              return theURLs
    end testVar2
    testVar1 returns a list, while testVar2 returns text.

    The other answers helped me emend my script.
    Now I want to rewrite another script with similar scope problems, I think.
    I want to make this working script
    tell application "TorBrowser"
      activate
              if front window exists then
      --on TorGetURLs()
                        delay 0.5
                        tell application "System Events" to tell process "TorBrowser"
      --set theWindows to (reverse of rest of reverse of (get value of attribute "AXChildren"))
                                  set theWindows to value of attribute "AXWindows"
                                  set theURLs to {}
                                  repeat with theWindow in theWindows
                                            tell theWindow
                                                      set value of attribute "AXMain" to true
                                                      set value of attribute "AXMinimized" to false
                                                      repeat
                                                                keystroke "l" using command down
                                                                keystroke "c" using command down
                                                                delay 0.2
                                                                if theURLs does not contain (the clipboard) then
                                                                          set end of theURLs to the clipboard
                                                                          key code 48 using control down
                                                                          delay 0.2
                                                                else
                                                                          exit repeat
                                                                end if
                                                      end repeat
                                            end tell
                                  end repeat
                        end tell
      --end TorGetURLs
      --on TorNewIdentity()
                        set {x, y} to bounds of front window
                        set xOffset to 85
                        tell application "System Events" to tell process "TorBrowser"
                                  set isFullScreen to value of attribute "AXFullScreen" of front window
                                  if isFullScreen then
                                            set yOffset to 40
                                  else
                                            set yOffset to 65
                                  end if
                        end tell
                        tell me to do shell script "cliclick -r c:" & (x + xOffset) & "," & (y + yOffset)
                        delay 0.1
                        tell application "System Events" to keystroke "i"
                        delay 0.4
                        tell me to do shell script "open -b org.mozilla.torbrowser http://www.yourip.us/"
      --end TorNewIdentity
      --on TorRestoreState()
                        repeat with theURL in theURLs
                                  delay 0.1
                                  if theURL as text is not "about:tor" then ¬
                                            tell me to do shell script "open -b org.mozilla.torbrowser " & theURL
                        end repeat
                        delay 0.5
                        tell application "System Events" to tell process "TorBrowser"
                                  if isFullScreen then set value of attribute "AXFullScreen" of front window to true
                        end tell
      --end TorRestoreState
              end if
    end tell
    into this
    tell application "TorBrowser"
      activate
              if front window exists then
                      TorGetURLs()
                      TorNewIdentity()
                      TorRestoreState()
              end if
    end tell
    with the handlers outside the tell block.

  • HT1203 i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    It is almost as if the program does not exist on my computer. If I search for it, the only thing that comes up is the installer. I cannot find it anywhere despite the fact I have installed it numerous times, uninstalled it and conducted a fresh install, and the Adobe website checks says that it is installed.

  • Converting between types in Web Dynpro

    Is it possible to convert between data types in web dynpro?  I am trying to covert a string to another data type (int, BigDecimal, etc.)?  I have found no documentation on how to do this?
    Any help will be greatly appreciated.  Thanks

    Hi Eric,
    If You use Web dynpro for Java, It's same as datatype conversion in java.
    For ex: if you want to convert from double value to float pls follow like this.
    float floatvar;
    double doublevar;
    floatvar= (float)doublevar;
    For more Information on data type conversion pls refer this URL
    http://www.unf.edu/~rzucker/cop3540dir/jdtconvt.html
    Hope this help. pls award points if you satisfied
    Thanks
    Praveen

  • The type of the value being assigned to variable ... differs from the current variable type

    I am trying to load a variable on SSIS Execute SQL Task with a string value. I keep on getting an error message :-
    “The type of the value being assigned to variable “User::LegacyColumns” differs from the current variable type”.
    Below are the settings on my package:
    Execute SQL Task Result Set –
    Single Row
    Variable Data Type –
    String
    The data to be loaded on the variable is a single row shown below:
    FirstName,LastName,MiddleName,PatientType,Title
    Can someone kindly help me to solve this as I’m lost for ideas.
    Thanks,
    Mpumelelo

    Thank you Sorna. I think I have managed to solve it. After a long search I have found a solution which advises that I should use a Foreach Loop Container. The help is on this link:
    https://social.msdn.microsoft.com/Forums/en-US/f46dea91-c26b-4ffe-ab1c-ebeef57c90b6/error-0xc001f009-at-mypackage-the-type-of-the-value-being-assigned-to-variable?forum=sqlintegrationservices
    Mpumelelo

  • Different File Types to Import - To Conver or not to convert?

    I have a project that I am dealing with which is requiring several different file types. Mainly .avi exported from VEGAS and footage ripped from a DVD.
    I have heard that it is best to use MPEG Streamclip to convert everything to a DVPro format (I am outputting in SD for broadcast) but wouldn't that just cause more compression?
    What is the best way to handle multiple file formats and the best output settings for broadcast when dealing with multiple formats? Thanks!

    The Avi's might work OK as they are, but the DVD footage has to go through MPEG streamclip. You might have to do this with the Avi's too, but not always... depends on the codec that was used to capture them in Vegas.
    Might try putting the AVI's in Compressor for the conversion if need be, as it might look a bit better in the end. But you've no choice with the files ripped from the DVD.
    Jerry

  • Problem with converting data types

    Hi Experts,
    I am stuck up with a little problem, i need your help
    i am converting all the data types to CHAR but i am not getting the expected data out.........
    My code is as below...where do i go wrong...
    LOOP AT <T_ITAB> ASSIGNING <FIELD>.
    DO.
       ASSIGN COMPONENT SY-INDEX OF STRUCTURE <FIELD> TO <RECORD>.
       IF SY-SUBRC = 0.
          LV_FIELD = <RECORD>.
          N = STRLEN( LV_FIELD ).
          IF N = '8'.
               IF LV_FIELD IS NOT INITIAL.
                      LV_DATE = LV_FIELD.
                      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
                              EXPORTING
                              DATE                     = LV_DATE
                             EXCEPTIONS
                                    PLAUSIBILITY_CHECK_FAILED = 1
                                    OTHERS                     = 2.
                             IF SY-SUBRC <> 0.
                                     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                             ENDIF.
                         IF SY-SUBRC EQ 0.
                            CONCATENATE LV_FIELD+6(2) LV_FIELD+4(2) LV_FIELD+0(4) INTO LV_FIELD SEPARATED BY '.'.
                        ENDIF.
                ENDIF.
             ENDIF.
                IF LV_RECORD IS INITIAL.
                         LV_RECORD = LV_FIELD.
                ELSE.
                       CONCATENATE LV_RECORD LV_FIELD INTO LV_RECORD SEPARATED BY '  * '.
               ENDIF.
           ELSE.
         EXIT." DO
        ENDIF.
       ENDDO.
      APPEND LV_RECORD TO LT_OUTPUT.
    CLEAR LV_RECORD.
    ENDLOOP.
    THE TABLE LT_OUTPUT     LIKE     THENV(CHAR 255)
    My output looks some thing like this:
    04  36876   15.09.2011  39600   1999
    06  36960   15.09.2011  39600   2632
    07  36874   15.09.2011  39541   9232
    My expected output
    04    36.876  15.09.2011    39.600  1.999
    06    36.960  15.09.2011    39.600  2.632
    07    36.874  15.09.2011    39.541  9.232
    Regards
    sam

    At run time you can see all the data........ like what i have shown...
    but if you clearly see, DATE will be in the internal format..but if you print it, it will be in dd:mm:yyyy
    can you suggest me if i have a dynamic field symbol (table data) ,,,, How can i convert data types dynamically..
    if it is a static internal table i am achieving with WRITE TO statement.....but i have huge data in field symbols...
    Instead of all these , please specify the exact problem your are facing . What is it with date field ? . In SAP while printing the internal format will be converted to external. What is your requirement with this date field?
    My output looks some thing like this:
    04 36876 15.09.2011 39600 1999
    06 36960 15.09.2011 39600 2632
    07 36874 15.09.2011 39541 9232
    My expected output
    04 36.876 15.09.2011 39.600 1.999
    06 36.960 15.09.2011 39.600 2.632
    07 36.874 15.09.2011 39.541 9.232
    I dont see any problems mentioned in your date field. Both your actual and expected outputs reflects the same in date field.
    In SCN you will only get solutions if your question is precise.
    Kesav

Maybe you are looking for

  • Unable to create cofile from data file

    Hi All, I am trying to create a cofile with the commane **** tp createcofile <TR>**** and getting the following error ..... ---> tp CREATECOFILE DC1K900012 pf=/usr/sap/trans/bin/TP_DOMAIN_DC1.PFL This is tp version 372.04.65 (release 701, unicode ena

  • Mail.app 4.4 (1082) - EXC_BAD_ACCESS (SIGSEGV) + KERN_INVALID_ADDRESS

    Hi all, Mail.app has been crashing ever since the latest update to 4.4 (combo update). Crash reports have been sent to Apple. Below an excerpt: Process: Mail [199] Path: /Applications/Mail.app/Contents/MacOS/Mail Identifier: com.apple.mail Version: 4

  • Syncing a new iPad 2

    I am going to buy an iPad 2 whilst on holiday in the USA, I am from the UK. Do I need to take my home laptop with me to sync the new iPad 2 to my iTunes account or will it work straight out of the box without syncing?

  • Transfering information from a Treo 650 to a 800W.

    I was told by Palm tech support that I would be able to transfer the OS information on my Treo 650 to Outlook and then downloaded into my 800W.  After hours of trying to do this, I am turning to you for help.  Is this in fact possible and if so how i

  • Save game and load game??

    i wrote a simple word base Rpg game, try to save some data and positions to a file, but dont know why it just allows me to save integer from 0-255?? why?? can anyone help? the code is following, public void Save () throws IOException {           x =