Field type string and I

Hi,
I have a data :
data:quantite_typeI type I.
data:quantite_typeC type string.
i have a data  : var_remise1 type ZKBETR.
but when i'm doing this code to change : var_remise1 to a strin :
quantite_typeC = var_remise1.
quantite_typeI = quantite_typeC.
When i have var_remise1 = -0.25  ( value < 1 ) i have  quantite_typeC = 0 and quantite_typeI = 0.
when i have var_remise1 = -1 or -2... that's work.
I don't understand why i have a problem with value <1.
Thanks for your reply.

Oh sorry, a mistake.
quantite_typeC = var_remise1.   ---> ook i have 0.25-
quantite_typeI = quantite_typeC. -
error i have 0
quantite_typeC = quantite_typeI.----> error i have 0 and not 0.25-

Similar Messages

  • Field type String (long length more than 1500)

    Hi All,
    we have requirement like one custom table with field string type(1500 length) should update through the report.
    problem is, it is not updating that many characters through the report.
    (till 255 chars only updating in the table)
    i have to update full string in the custom table.
    the code is below, please help me any one come accross the situation.
    thanks in advance.
    data: lv_test type string,
          lv_test1 type string,
          lv_num type i,
          it_test type table of ZFEILD_TEST,
          wa_test type zfeild_test.
    do 10 times.
    lv_test = 'thptjpojtgpeojygpeojhpoewjhpojwhjwpohjopsjhoptrjhopjwhopjwpojhpowjhopwjojwpojhpowjhpowjkahglfdglkaglkahklrhlfhslhkalklklhkalhalkhlahlkajljhlajhlajlajlkajlhjaljlajlhjaljhlajhlahpojwpohjwopjhojhwjhojopjwopjhwojhotjhwojwhojwpojhpwojhpowjophjwpojh'
    lv_test1 = lv_test.
    concatenate lv_test lv_test1 into lv_test1.
    clear: lv_test.
    enddo.
    lv_num = strlen( lv_test1 ).
    wa_test-STRIN = lv_test1.
    wa_test-znumber = '001'.
    append wa_test to it_test.
    loop at it_test into wa_test.
    write: / wa_TEST-strin.
    modify zfeild_test from wa_test.
    endloop.

    Hi,
    I assume you have chunks of the string and you need to concatenate it and put it to the table.
    You can try this.
    data : begin of w_string occurs 0,
             string type string,
             end of w_string.
    data  : w_char1(255) type c value 'BLAUGBUSSUSSF',
              w_char2(255) type c value 'GSIUHFSHF',
    w_string-string+0(255) = w_char1.
    w_string-straing+255(255) = w_char2.
    so on....
    append w_string.
    Regards,
    Pramod

  • Problem with field type STRING in table

    Hi Experts,
             I am new to ABAP. I have created a new transparent table which hold error info. One of the field has to store data of size about 1500 char.
    Since CHAR type is not acceptable for this field So I gave STRING type. Now when I try to create a TABLE parameter in a RFC enabled functional module using "LIKE YERROR" Then I get a error:
    "YERROR must be a flat structure. You cannot use internal tables, strings, references, or structure as component" 
    Why is this error? How to resolve it? Is it because I have used a field of type STRING in the table? If this is the problem then what other type can I use?
    What are other know problems with using STRING type?
    Please help!
    Thanks
    Gopal

    Hi,
    Try to declare it as type LCHR , it can hold up to 32000 chars.
    Regards
    vijay

  • How to resolve Comparison between a value with static type string and a possible unrelated type numb

    I am new to this and any help would be greatly appreciated, Im trying to display custom numbers for values of a Hslider.
    Here is my code so far:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
                        <![CDATA[
                                  import mx.events.SliderEvent;
                                  protected function ValueSlider_changeHandler(event:SliderEvent):void
                                  ValueLabel.text = String(ValueSlider.value);
                                            if(ValueSlider.value == "0")
                                            ValueLabel.text = "150";
                                            if(ValueSlider.value == "1")
                                            ValueLabel.text = "333";
                                            if(ValueSlider.value == "2")
                                            ValueLabel.text = "543";
                                            if(ValueSlider.value == "3")
                                            ValueLabel.text = "9342";
                        ]]>
      </fx:Script>
              <s:Panel x="199" y="141" width="250" height="200">
                        <s:HSlider id="ValueSlider" x="74" y="68" maximum="5" minimum="0" stepSize="1"/>
                        <s:Label id="ValueLabel" x="109" y="38" text="Label"/>
      </s:Panel>
    </s:Application>

    Thank you for your help, I was using quotes around the number from a suggestion on another forum. Now how to I display the result on valueLabel? "valueLabel.text"? {valueLable.text}, "const"?,
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
      <fx:Script>
                        <![CDATA[
                                  import mx.events.SliderEvent;
                                  protected function ValueSlider_changeHandler(event:SliderEvent):void
                                            const CONVERSION:Array = ["150","333","543","9342"];
                                            valueLabel.text = CONVERSION[valueSlider.value];
                        ]]>
      </fx:Script>
              <s:Panel x="199" y="141" width="250" height="200">
                        <s:HSlider id="valueSlider" x="78" y="69" maximum="3" minimum="0" stepSize="1" value="1"/>
      <s:Label id="valueLabel" x="109" y="38" text= "(valueLabel.text)"/>  <-----what do I place here?
      </s:Panel>
    </s:Application>

  • ClassCast Exception while casting to type String

    Dear Java users
    While coding a parse routine in a session EJB , I created a vector and added some elements to it.
    Naturally these elements are of type object.
    Now, while extracting elements out of the vector I tried to cast them to the actual type that the elements are.
    Most of the elements are of type String and some of type Long and Double.Note that these are all Object wrappers not primitives.
    The code compiles fine, however at run time I get the following error:
    java.lang.ClassCastException : java.lang.String
    I tried to do the casting two ways: (String) object and object.toString(). In both cases I got the same error.
    Here is a snippet of my code where I get the error:
    RETAIL_TRANX retail_db = retail_home.create(columns.elementAt(0).toString(),
    columns.elementAt(1).toString(),................
    Any ideas on why this is happening and how best should I cast to String.
    Thank you for any help you can provide
    Best
    Naveen

    RETAIL_TRANX retail_db = retail_home.create(columns.elementAt(0).toString(),
    columns.elementAt(1).toString(),................
    I'd say that the code above calls the toString() implemented in the Object class because that's what elementAt() returns. If you want String objects as arguments to the create method, you want the toString() implemented in the subclasses String, Long, and Double. To achieve this, try the following:
    RETAIL_TRANX retail_db = retail_home.create(((String)columns.elementAt(0)).toString()...
    This code casts the Object class object returned by elementAt to a String first and then it calls the toString() method on the String object resulting from the cast. The toString() that executes should be the one in the String rather than Object class.
    This is going to fail if elementAt() doesn't return an object that can be cast to a String. In this case, what you might want to do first is test the type of object returned with the instanceof operator. Then cast to the appropriate type, in each case calling toString() after the cast has been made.
    Regards,
    Steve

  • Altering the field type in an AWT/Swing App

    Hi ,
    I have developed a simple Swing/Jclient application for ADF. All the fields produced on the panel are of type JTextField. Is it possible to alter some of them to JTextArea for example....????
    I have not noticed something relative to it in the property palette of each field.....!!!!
    Can i do that...????
    Note: I use JDev10.1.2
    Thanks....
    Sim

    So... if the fields are generated by the wizard then there is no manner to change the field type...????
    You can just drag a component from the data control palette and when you'll drop it on the panel it will give you various options of field types that you can drop it as.Yes... but how to relate it to a db column...(to bound to a db column of the selected table)????
    I have noticed that the fields generated by the wizard do have the "Document" property as the name of the object view + the db column produced as a step of the wizard.....
    For the item i have added as you have written the document property does not have this object view.name of db column as in the other columns....
    The possible values are:
    default
    defaultStyledDocument
    htmlDocument
    plainDocument
    Sorry , my question on this you have described....But , what about if i add another swing field type first and then i want to bound to a db column....???
    By the way, why are you using 10.1.2 and not 10.1.3?Does the newer version deal with these 'problems' better...???
    Thanks.. a lot for your constant help
    Sim
    Message was edited by:
    sgalaxy

  • Passing internal table with a field of type string to & from BAPI

    Hello ABAP gurus,
    I have a simple BAPI which has to send back an internal table.
    Internal table structure is as follows
    DATA: BEGIN OF itab OCCURS 0,
            config_id(8),
            blobdata like zstring,
    END OF itab.
    where zstring is a string of variable length.
    When I try to activate the BAPI I get a message
    "itab" must be a flat structure. You cannot use internal tables, strings, references or structures as components.
    However, just for testing, I changed blobdata to type of char and I can successfully activate and use the BAPI.
    But, our requirement is to pass a string of variable length.
    How can I resolve this issue? I have searched sdn and other blogs but didn't help so far.
    Any feedback on this will be highly appreciated.
    Thanks
    Ram

    Hi Prasad ,
         Try this way :
    Acc to your requirement ,create a structure with a parameter and a string , create a table type for that structure .
    use that table type in the changing parameter as you need that bapi to accept and return a table .
    for the below example ,  ZTEST_05 is a structure , ZTT_TEST_05 is a table type of ZTEST_05 .
    ZTEST_05 has got 2 fields , one is a param of type char(8) and another is a string of type STRING .
    I created the below mentioned BAPI and I was able to activate it without any errors .
         FUNCTION ZTEST_BAPI_ITAB_01.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(BAPI_P1) TYPE  ZTEST_05
    *"  CHANGING
    *"     VALUE(BAPI_CP1) TYPE  ZTT_TEST_05
    ENDFUNCTION. 
    Revert if any issues .
    Regards,
    Ranjita

  • Field Symbols, Field String, and Field Group.

    Hi,
    Can you differentiate between filed symbols, field strings and field groups,
    With regards,
    Bharath Mohan B

    Hi,
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    FIELD GROUPS
    are used to hold/handle large amount of data when the internal table are not useful
    we use EXTRACT statement, HEADER structure in them
    see the example
    REPORT demo_extract.
    NODES: spfli, sflight.
    FIELD-GROUPS: header, flight_info, flight_date.
    START-OF-SELECTION.
      INSERT: spfli-carrid spfli-connid sflight-fldate
                INTO header,
              spfli-cityfrom spfli-cityto
                INTO flight_info.
    GET spfli.
      EXTRACT flight_info.
    GET sflight.
      EXTRACT flight_date.
    END-OF-SELECTION.
      SORT STABLE.
      LOOP.
        AT FIRST.
          WRITE / 'Flight list'.
          ULINE.
        ENDAT.
        AT flight_info WITH flight_date.
          WRITE: / spfli-carrid , spfli-connid, sflight-fldate,
                   spfli-cityfrom, spfli-cityto.
        ENDAT.
        AT flight_date.
          WRITE: / spfli-carrid , spfli-connid, sflight-fldate.
        ENDAT.
        AT LAST.
          ULINE.
          WRITE: cnt(spfli-carrid), 'Airlines'.
          ULINE.
        ENDAT.
      ENDLOOP.
    FIELD STRING is nothing but a string with  one row of records.
    Reward points if useful
    regards
    Anji

  • Number field type mapped as String

    Oracle Number field is mapped as CSTRING when using CRECORDSET class in VC++.
    Any ideas why? or what I should do?

    How big is the number column defined? ANything larger than a NUMBER(14) will map to a character string since there isn't a datatype large enough to hold say a NUMBER(30).
    Here is the mapping as I rememeber it (it is old information and may not be quite up to date with the latest drivers):
    if Scale = 0 then if Precision <= 4 then
    Number Size: Integer
    if Precision <= 9 then Number Size: Long
    Integer
    if Precision <= 15 then Number Size: Double
    if Scale > 0 then if Precision <= 15 then
    Number Size: Double
    Any other field types mapped to Text (Field
    Size = 255).

  • Storing a xml excel file in a field of type string in a transparent table

    Hello Experts,
    I have a program to maintain. There is a transparent table which stores a XML excel file. I have used where used list option to find out if there is an existing program which used that table but couldnt find one.
    In debugger mode, when I view the contents of the field, i can see list of characters, when i choose the option of viewing in xml browser, it opens me the excel file.
    My requirement is to make a simple change to the excel file and store it back to the table in the same format it is.
    Can someone explain to me, how to convert that xml excel file into string so that it is stored in a field of type string.
    Thanks Nitish.

    You can use the parser method provided in CL_XML_DOCUMENT class. Search for this particular class in the forums, you'll find many relevant post.
    BR,
    Suhas

  • Issue to make mandatory field(SELD/BBD and Date of manufactor)in migo for particular Material type and material Number starting with'1' series.

    Hi friend,
    i have issue regarding mandatory  self life field (SELD/BBD and Date of manufactor)in migo for Batch Tab for particular Material start with '1' Series and material type.
    i want to make mandatory above field during GR from migo..any one let me know exit or badi for that to full fill this goal..
    Regard's,
    shaikh Khalid.

    Hi Shaikh
    First of all Thread is not closed seconldy as a good practice if you have resolved your issue kindly document it here so that it may help someone in future
    Nabheet

  • Hide/Suppress Cost center field in MIGO and MB1A for movement types 551&552

    Hi All,
    Can anybody tell me how to suppress or hide the cost center field in MIGO or MB1A for movement types 551 and 552?
    I did below settings and it worked fine for only MB1A and for MIGO still it is showing cost center field.
    IMG > Materials Management > Inventory Management and Physical Inventory >Goods Issue/Transfer posting > Define screen layout > select movement type to change the option.
    Also I did gothrough the settings for Enjoy transaction (MIGO) there we have only option to make fields either  "Required entry" or "Optional entry" and we don't have an option to hide/suppress.
    Please advise or help me .
    Thanks in advance!
    Regards,
    Praveen

    Hi
    The cost center field is a required field in mvt type 551 as you are scrapping materials, some cost center will need to take the cost of this operation.
    Anyway, you first need to make the field as optional for example, before you move.
    One option is that you create a screen variant in Tcode SHD0 for MB1A, where 551 is setup as constant (with content) , and mark Cost center as invisible and assign this screen variant to a transaction in SE93.
    regards
    Sidi

  • Regarding mandatory fields, Context Objects and Fault Message Types

    Hi All,
    1) I am creating a structure with fields "Name", "Street" and "City". While creation i want to make "Name" fields as mandatory. Is it possible. If so how to achieve this.
    2) What is the purpose of Context Object and in which situation we will use this.
    3) What is the purpose of Fault Message Types and in which situation we will use this.
    4) I am doing file to file scenario, at sender side i have set the adapter as file and transport protocol as "FTP" . It is asking for "Server", "PORT" and "Login Details". What is this FTP, for this do i need to take any login details. I am totally not aware of FTP, could please explain more about this.
    Kindly look into the above points and respond point by point.
    Thanks in advance.
    Regards,
    Prem.S

    Hi prem,
    <b>1) I am creating a structure with fields "Name", "Street" and "City". While creation i want to make "Name" fields as mandatory. Is it possible. If so how to achieve this.</b>
    give occurence 1..unbounded. for the field name.
    <b>2) What is the purpose of Context Object and in which situation we will use this.</b>
    If u have multiple receiver system then to determine the reciever u can use context object.....
    the alternative of context objetc is X-Path...
    Check out these
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/content.htm
    /people/prasadbabu.nemalikanti3/blog/2006/09/20/receiver-determination-based-on-the-payload-of-input-dataextended-xpathcontext-object
    Here is a scenario where context objects were used for BPM
    Technical Context Object in ccBPM
    Get the details here:
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm
    Technical Context Objects :
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/e44fcf98baa24a9686a7643a33f26f/frameset.htm
    A list of the Technical Context Objects names can be found here:
    http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/content.htm
    Difference between context object and x-path:
    diff between context object and x path
    <b>3) What is the purpose of Fault Message Types and in which situation we will use this</b>
    whenever u want to catch some exception u can use fault message types.Just for a example u r sending some data to SAP system.But due to some reason the R/3 system is down.so in this case if u have implemented fault message ..u can get a error message specifying r/3 is down....
    Fault message implementation.
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    How to Guide
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40574601-ec97-2910-3cba-a0fdc10f4dce
    <b>4) I am doing file to file scenario, at sender side i have set the adapter as file and transport protocol as "FTP" . It is asking for "Server", "PORT" and "Login Details". What is this FTP, for this do i need to take any login details. I am totally not aware of FTP, could please explain more about this.</b>
    there are two transport protocol for File adapter
    1)FTP(File transfer protocol)
    to know abt FTP check here
    http://help.sap.com/saphelp_nw04/helpdata/en/43/0e16bfd7b021aee10000000a1553f6/content.htm
    2)NFS(Network File System)
    in server :Enter the host name or IP address of the FTP server.
    in PORT:Specify the port number of the FTP server.
                 The default is the standard port for the FTP server (21)
    check here
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    Regards
    BILL
    <b>***reward with points if ity helps u!!</b>

  • Material type questions and fields on the MRP tabs

    Hi Gurus,
    Can anybody please answer these questiosn for me?
    1) material types determine what views will be created in the materil master right?
    2) for materail types can we have procurement type as F, E or both?
    3) MRP controller and purchasing group fileds on the material master, what are their significance? like which field will take importance in what ccase is my questions?
    Can anybody please help me in answering these
    thanks
    Anmusha

    All the materials which can be produce inhouse that only can have Procurement type E and The materials which can be procured externally always can have F.
    The materials which can be manufactured inhouse as well as procure from external source can have both type procurement
    eg. Raw material will always have F
    Finish goods will have E
    and SEMI finish can have both procurement type
    the reason you can prodice inhouse, procure from outside or you can do sub contracting.
    Yes, the material should have MRP controller to pull in MD07

  • 'Join' two different field types together into a String - possible in Java?

    Not entirely certain whether this is a straightforward Java or more of a JDBC question:
    I have two fields, one is a String and one an integer. I need to concatenate these fields together to form one String, prior to performing an insert on a table. ie:
    String s = dbRS.getString("partition_name");    //get full string
    String partstr = s.substring(0, 14);      // get first 14 (alpha) characters
    int new_partition_number = max_partition_number + 1;      //create new unique partition number, incremented by 1Now I have
    - a String (partstr - i.e. "TN1234567890_")
    - an integer (i.e. 50)
    (NB. The number has to be an integer because it is subject to calculation elsewhere.)
    I wish to join these together into a String ("TN1234567890_50") and use the field in an inserted row. I've tried using
    String partition_string = new StringBuffer(partstr).append(new_partition_number ).toString();... but this doesn't work.
    I read on a forum that it's impossible to cast an integer to a String in this way in Java, which sounds pretty incredulous from where I am! However my Osborne Java 2 Complete Reference doesn't mention it at all.
    Any assistance will be very gratefully received!
    Thanks.

    wonder why he thinks you can't append an int to a StringBuilder.
    Works fine. Might of course not yield the expected result depending on expectations, but it works just fine.
    But then, the coding conventions reminiscent of C don't bode well.

Maybe you are looking for

  • BlackBerry Desktop Software Is their a download for Mac desktop Os 10.5.8

    Hi I was wondering if their is an archive within Blackberry where I could download a BlackBerry Desktop Software for my mac. I am useing 10.5.8, the new version is for 10.6 or higher. Regards Vintage Tec head 8088

  • Urgent!!  How to call a custom transaction or an ABAP program in BSP?

    Urgent!!  How to call a custom transaction or an ABAP program in BSP? We are pretty new on BSP.  Would be very appreciated if any expert here give us the detailed steps on how to build up the application to just call a custom transaction (e.g., t-cod

  • External dvd drive won't work w/ iMac (10.5.8)

    Just bought a new LaCie dvd rw w/ lightscribe.  When I plug it into my iMac, the system profiler "sees" it through the firewire connection, but any disk I put into it won't mount.  I plugged it in to my daughters PC & it was instantly recognized & di

  • Cannot find download for DS 5.2 P4 or P6 for Sol 10, x86

    Can someone get me a URL that allows me to download the Directory Server v5.2 p6? I gather that I need to download v5.2 P4 and patch to P6, but I can't even get the install package for P4! Every time I do I get transferred to the "Sun Java System Dir

  • RSS feed implementation in APEX

    Hi all, I'm trying to implement RSS (Really Simple Syndicate) feed in the APEX . There's a page which shows data from the table in the database. The RSS feed has to reflect changes made to the database. Like if any data is added to the Database any R