Assigning a string value to a decimal data type field.

Hi,
I want to assign a value 'N/A' to an internal table field 'itab-field1' which is of data type dec.
How can I do this?.
Your help is really apprieciated
Thanks & Regards,
Soumya.

hi,
on what condition do u want N/A to be displayed, i hope when ever that field is empty...
so u can do in this way..in stead of changing in internal table...
when ever u r writing the values from internal table to output list..
ther put a check like if  itab- field1 = 0.
                                  write :/ 'N/A'.
                              else.
                                 write : itab-field1.
hope this is helpful, because we can not pass char values to internaltable field of type dec..
Rgds.,
subash

Similar Messages

  • Runtime conversion of a string value to a primitive data type in java

    can anyone of you give me an idea to convert a string value to a primitive data type during run time...i have the value and the type to which it has to be converted as String values...do you have any idea ,...pls share

    String recvalvalue = inputval;
                    String recvartype = inputtype;
                   if (recvartype.equals("int")){
                   value0 = Integer.parseInt(recvalvalue);
             else
             if (recvartype.equals("double")){
                    value1  = Double.parseDouble(recvalvalue);
             else
             if(recvartype.equals("float")){
              value2 = Float.parseFloat(recvalvalue);
             else
             if(recvartype.equals("Boolean")){
              value3 = Boolean.parseBoolean(recvalvalue);
             else
             if(recvartype.equals("char")){
               value4 = (char)recvalvalue.charAt(0);
            else
            if(recvartype.equals("String")){
              value5 = recvalvalue;
             else
             if(recvartype.equals("byte")){
               value6 = Byte.parseByte(recvalvalue);
                  //listA.add(6, value6);
                  //     listA.g = value6;
             else
              if(recvartype.equals("long")){
               value7 = Long.parseLong(recvalvalue);
             else
              if(recvartype.equals("short")){
              value8 = Short.parseShort(recvalvalue);
             } yes i can do this but the resultant value has to be assigned to a variable of a specific type which is here recvartype .....it has to be done dynamically automatically..if we know what type of data is that we can convert and assign to the type but we donot know when we run the program as the program will be supllied by someone and has to be executed

  • Can't assign a string value to a member of type TEXT in Calculation Manager

    I can assign a string value to that member of type TEXT using a run-time prompt of type StringToNumber.
    Example: "My Text Member" = {string_rtp};
    However, I need to accompllish the same function without using a run-time prompts.
    I have a planning application and I know that text along with all other non-numeric
    values are stored on the relational side in the planning application schema.
    It seems reasonable to assume that if this can can accomplish
    with a run-time prompt that I could do also do it without a run-time prompt.
    What appears to be lacking is a function like:
    "My Text Member" = @StringToNumber(<String Literal>);
    Clearly, this is already being done "under the covers" for run-time prompts. If
    would appear to be a minor enhancement to expose such a function to developers.
    NOTE: I suppose you would also need to add new syntax/function to identify a string
    literal from say a member name. I'm wondering if this is the more difficult challenge
    from a product perspective????

    When executing a Calculation Manager rule in Planning, the run-time prompt (RTP) is populated by looking up the outline information present in the relational Planning application database. If the RTP is of type TEXT, the strings displayed in the member select are from the from the relational Planning application database too. Subsequently when executing the Rule, the RTP's value is in fact the record ID (a number) which is then saved into the appropriate intersection in Essbase.
    You need to bear in mind, the Rule is executed in Essbase. If Essbase needs to "write" a text, it would then need to connect to the Planning relational database to create a new record. The newly created record ID then needs to be feed back to Essbase, in order to store it in the appropriate intersection.
    What you are suggesting, comes with a big overhead causing Essbase and the rule to slow. Thus, the disadvantages outweighs the advantages.

  • Can "SPML Web Service Complex Data Type field" take multiple values ?

    In Generic Technology Connector's -SPML design parameters section, Can we give multiple values in SPML Web Service Complex Data Type field?
    If not, how can i call methods directly instead of calling them through a values of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type?
    I need 'SPML Web Service Complex Data Type' to hold multiple values.And based on the request it has to initiate appropriate method of action.
    Presently i have three methods add,modify and delete which i am calling through a single value of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type.
    I want to replace this single value with multiple menthods , so that a direct interaction between the method,OIM and target can be established.
    Edited by: 821054 on 16/02/2011 04:23

    Thanks Robert.
    You'll need to create your own interface to the webapp database for those kind of data operations
    by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
    I'm curious if anyone else has tried this?
    Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
    Web App item field value (as recorded against the List (Checkbox List) field type:
    8294877,8294878
    Web App Search value (for this same field):
    8294879,8294877,8294885
    The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
    The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets).

  • How to Update Date data type field value in oracle

    I want to update records in a table that has a Date data type field. It's a oracle databse. I use the oracle thin drive to connect to the database. The everything works well, only when i try to update records that have date type value, something doesn't work.
    I use the following stmt to update DB:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Conn = DriverManager.getConnection("jdbc:oracle:thin:@hostname:portnumber:schname", "uid","pwd");
    stmt=Conn.createStatement();
    String updStr = "UPDATE Article SET Archive = ' Disable' WHERE ArticleDate = # " + sqlDate +"# " ;
    stmt.executeUpdate( updAStr ) ;
    But I always got the SQLException run time error, which is "ORA-00911: invalid character"
    Who can help me to find out how to write the above Update statement correctly? esp. that how to present the Date type variable in the statement.!
    BTW, sqlDate is a Java.sql.Date variable, Is it "# " + sqlDate + "# " the right way?
    Many thanks

    What do you get out of Oracle's TO_DATE that java.sql.PreparedStatement.setDate()
    won't give you? - MODWell, I don't know that I've used all capabilities of either, but when it comes to managing Date Strings my Oracle bias :) would be to code using Oracle's TO_CHAR and TO_DATE functions. Perhaps someone can tell me vendor neutral ways to do something simiilar to managing these input date/times (and hopefully just as easily, pretty much all done in a single line, single function)?
    WHERE aDATE > TO_DATE('2010','YYYY')
    WHERE aDATE > TO_DATE('2010 AUG 22','YYYY MMM DD')
    WHERE aDATE > TO_DATE( 'January 15, 1989, 11:00 A.M.', 'Month dd, YYYY, HH:MI A.M.')
    I believe most databases have something similar to this, although I have found Oracle's to be the most flexible and consistent, if not the most intuitive. Other vendors (DB2, SQL Server, Access) don't force you to always be explicit, and can accept a variety of date strings without masks. The problem is that while you might not be getting an error, it also may not be parsing your date as expected.
    One could argue that this vendor specific hodgepodge of literal date/time strings is only one program modification away from disaster. They might be right.
    Just to be clear. I'm not recommending using a vendor specific approach, but it's not a perfect world and somtimes you have to use what works easiest or best or fastest, and in some cases, that is the vendor specific alternatives.

  • Dynamically Find out the Integer and Decimal Data Type of a Column

    Table: test (INTE number, DECI number(7,2))
    Try to dynamically determine the column type.
    Using select data_type from user_tab_columns. It only returns NUMBER which does not indicate if the column is an integer or decimal data type.
    Is there a way to dynamically determine if a column is integer or decimal type?
    Thanks

    First of all your column INTE stores not just integers but any franctional numbers too:
    SQL> create table test(INTE number, DECI number(7,2))
      2  /
    Table created.
    SQL> insert
      2    into test
      3    values(
      4           10.99,
      5           10.99
      6          )
      7  /
    1 row created.
    SQL> select  *
      2    from  test
      3  /
          INTE       DECI
         10.99      10.99
    SQL>If you want to declare column as integer you use either NUMBER(n) or INTEGER. And, as others already pointed out, you can check DATA_PRECISION & DATA_SCALE in data dictionary view USER/ALL/DBA_TAB_COLUMNS.
    SY.

  • To find the date type fields in the row and validate those date fields

    TYPES : BEGIN OF TY_MARA,
              MATNR TYPE MARA-MATNR,
              ERSDA TYPE MARA-ERSDA,
              ERNAM TYPE MARA-ERNAM,
              LAEDA TYPE MARA-LAEDA,
              MTART TYPE MARA-MTART,
            END OF TY_MARA.
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
          it_mara1 TYPE STANDARD TABLE OF ty_mara,
           wa_mara TYPE ty_mara.
    loop at it_mara into wa_mara.
      describe field wa_mara-ersda type c_data.
    if c_data eq 'D'.
      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
        EXPORTING
          date                            = wa_mara-ersda
       EXCEPTIONS
         PLAUSIBILITY_CHECK_FAILED       = 1
         OTHERS                          = 2
      IF sy-subrc eq 0.
    wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
        else.
            wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
      ENDIF.
      endif.
      endloop.
    This issue regarding how to find the date type fields in the row and validate those date fields.If its not a valid date ,i have to assign initial value to that.
    I've tried that for single field using describe field.Please help me do that for all fields.

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Importing an SQL Server TEXT data type field in Oracle - problem with LONG

    Hello,
    I work in Oracle 9i and I created a view on a distant SQL Server database that contains a TEXT data type field. But I have a problem when I select that field in Oracle; I have the following error message: "ORA-00997: forbidden use of LONG data type".
    Could anybody have a solution for me, to solve that problem?
    Thanks a lot!

    It is very difficult to suggest anything without seeing your code.  I don't even know if what you are seeing is the actual value or an error code.  Often, negative numbers are indicative of error codes. 
    For instance -1 could mean that you have an invalid reference or path, etc...
    Can you post your code?

  • Insert current date and time into Oracle date type field

    I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
    For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
    The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
    Here is what I have for my JDBC inserts and I also tried something with DateFormat:
    PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
    I also tried:
    PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
    Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
    Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.

    sportsMarkr wrote:
    Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
    [http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
    If you want a date and time then use java.sql.Timestamp.

  • Infotype 0041  - Date type field in display mode always

    Hi All,
    Please help in find out solution for the below enhancement
    In infotype 0041 we have date type and date field. We need to make the date type field to be display mode always.
    Thanks for your help in advance.
    Thanks,
    Karthikeyan

    Hi Karthikeyan ,
    Please find the resolution as below :
    Userexit - EXIT_SAPFP50M_001 . In Include ZXPADU01. Write the below code .
    DATA: w_P0041 TYPE P0041.
    IF  ipsyst-massn <> space AND
      ( ipsyst-ioper = 'INS'  OR
        ipsyst-ioper = 'INSS' OR
        ipsyst-ioper = 'COP'  OR
        ipsyst-ioper = 'MOD').
    CASE innnn-infty.
    WHEN '0041'.
    *convert prelp to pnnnn structure
    CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
    EXPORTING
    PRELP = INNNN
    IMPORTING
    PNNNN = w_P0041 .
    *Here you can have more conditions like for which Action Types you want the
    IT0041 to default .
    w_P0041-dar01 = 'Z1'.
    w_P0041-dar02 = 'Z2'.
    w_P0041-dar03 = 'Z3'.
    *convert pnnnn to prelp structure
    CALL METHOD CL_HR_PNNNN_TYPE_CAST=>pnnnn_to_prelp
    EXPORTING
    PNNNN = w_P0041
    IMPORTING
    PRELP = INNNN.
    *Display mode
    LOOP AT SCREEN.
              IF screen-name = 'P0041-DAR01' OR
                 screen-name = 'P0041-DAR02'  OR
                 screen-name = 'P0041-DAR03'  .
                CLEAR screen-group2.
                screen-input = 0.
                MODIFY SCREEN.
              ENDIF.
            ENDLOOP.
    WHEN OTHERS.
      ENDCASE.
    ENDIF.
    Thanks ,
    Sucharita Das

  • Want to Have INT4 Data type field in IT

    Dear All,
               I want INT4 Data type field in my Customized infotype field.
               Is it possible to have it with signs.
    Thanks
    Satya.

    Hello Satya
    you cant have INT4 as datatype in your custom infotype
    Reward points if helpful

  • Store the value  in BLOB column data type

    Hi All,
    I have a file of about 5MB. I want to store this in BLOB column data type of a table.
    Can we compress this file to store and when we take uncompress the same...or how do we do it.
    and what is the procedure to store this....
    pls. help me
    Thanks,
    Naresh

    Hi skud
    i juast want to store the agent code to variable.if i did get ur point...
    Why don't u just use a simple assign statment for example...
    DECLARE
    V_VALUE  NUMBER;
    BEGIN
    V_VALUE := LC354 ; -- IF it was a value as LC354 static i mean
    -- or u could use any value
    V_VALUE := :ur_form_item_name; --- if it was dynamic
    END;That's it .
    Hope this helps...
    Regards,
    Ammatu Allah.

  • Decimal data type multiplied by quantity data type

    Hi all,
    i have a requirement where i have to multiply 3 fields, and get that result into fourth field.
    example:
    data: f1 type dec,    [Data type - Decimal; length 7]
            f2 type dec,    [Data type - Decimal; length 7]
            f3 type quan.  [Data type - Quantity; length 17]
    data: f4 type ??
    f4 = f1 * f2 * f3.
    what will the data type of field f4?
    Will field f4 be of decimal type. If yes, then what is the declaration syntax of f4.
    can i declare it as:
    data: f4 type dec.
    When i do this, i get an error saying type DEC is unknown.
    NOTE: For your information.I AM IMPLEMENTING THIS IN A  method inside a BADI.
    Points will be rewarded.
    Thanks in advance.

    Hi
    U need to use a reference to a dictionary field (like MSEG-MENGE) because there isn't an abap type to be used, the data type are only these:
    C     Character     
    N     Numeric string 
    D     Date        (YYYYMMDD)
    T     Time:            HHMMSS) 
    X     Byte (hexadecimal)         
    I      Integer                    
    P     Packed number       
    F     Floating point number
    STRING  String         Variable empty string
    If there isn't a dictionary field good for you, u can only use the type P.
    So or:
    DATA F4 TYPE MSEG-MENGE. (this field has 3 decimals)
    or
    DATA F4(16) TYPE P DECIMALS 2.
    Max

  • Decimal data type

    Hi,
    I know this is a very silly thing to ask.
    But i got a doubt regarding the data types.
    look at this:
    <b>tables: zap.</b> " this is a custom table
    in this custom table "zap" the field "price" is defined like this:
    <b>field</b>| <b>field type</b>| <b>data type</b>| <b>length</b>| <b>dec. point</b>|
    price| zap_price| dec       | 11    | 6
    now in the program there is a field declared like this:
    <b>data: zap like zap-price.</b>
    now my doubt is:
    for the field <b>zap-price</b> is the value can be like this?
    a)     46578.654876
    or
    b)     4687.645478
    which one is correct.
    Please let me know.
    thnx for the help.,

    Hi,
    You a) point is right & so is point b).
    Your definition means..
    the total length of the field is 11,out of which a max of 6 places for decimals & ofcourse 1 will be assigned to the sign(- or +).
    Message was edited by: Phani Kiran Nudurupati

  • Handle null value in char infoobject -data type DATE(ora-01722 invalid num)

    Hi,
    We have a DSO with a info object in the Data fields. The char info object has the data type DATE and most often it has the null value. but some times  it has data in it.
    When ever we were trying to run a report on the DSO it throws a error  as  ORA- 01722 INVALID NUMBER.
    we tried editing PSA data and placing 00000000 for null values - and had a message  invalid date.
    suggestions pls
    Regards.

    Hello,
    Please check the note given below
    https://service.sap.com/sap/support/notes/1327167.
    If null value is the problem,  change the query setting for not to show the null values. Just add a filter in ZDAT to exclude "NULL"
    Thanks
    Nidhi

Maybe you are looking for

  • Need help for cursor

    Hi I have a pl/sql block..which is having one cursor with a select statement. This select statement will return values when proper values passed..sometimes it will return null. When it return null, I have to insert "invalid code " value into a table.

  • Consumption and Production qty and value report

    Any one knows t-code for report that can give porduction order wise consumption in qty and value and production order wise production in qty and value.

  • Clients not able to connect to MS exchange server over a cisco switch

    Hello, I have a Cisco L3 switch. I have a Exchange server and until i split the network into every thing was working ok, meaning the clients can connect to the Exchange without issues. But after i split the network into 2 vlans, moving the exchange i

  • Availability of N80 internet edition in the UK

    When is this phone likely to be available for purchase in the UK? There seems to be no indication of it appearing yet, and I'm getting fed up of looking online every day.

  • Quest for a good music phone

    Hi there! I have been a loyal user (and fan) of Nokia Symbian phones. currently i have two which is the Nokia X2 and the Nokia E5. I use my X2 as a sort of back-up phone just in case my main phone (the E5) has started to bog down or my secondary phon