Find the datatype of a variable

I see exceptions thrown while there is a data mismatch.
Is there any way in java to find the data type of an declared variable.
Thanks

slashercopec wrote:
getClass() returns the Class object, which you can call getName() on
e.g.
variable.getClass().getName();
Not if it's a primitive type.
db

Similar Messages

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • How do I get the datatype of a variable or a field in table?

    Dear Friends,
    In Pl/SQL, How do I determine the datatype of a variable or a field in a table?
    While writing pl/sql code, I need to determine the datatype. Is there any option or function in pl/sql or in d2k.
    waiting for your response...
    Sanjai

    write a function based on this code with column_name and table_name
    as parameter and you get the data type as output.
    SQL> create table mytable(empno number, ename varchar2(32))
      2  /
    Table created.
    SQL>
    SQL> set linesize 100
    SQL> column table_name format a32
    SQL> column data_type format a32
    SQL>
    SQL> select table_name, data_type
      2    from user_tab_columns
      3   where table_name='MYTABLE'
      4  /
    TABLE_NAME                       DATA_TYPE                                                         
    MYTABLE                          NUMBER                                                            
    MYTABLE                          VARCHAR2                                                          

  • Chnfind unable to find the decimal type by variable and sometimes "Round" command

    Dear all,
    During the work with Diadem I got two troubles. Could you please take a look and show me the wrong if you find the issue?
    1.) Here is my trouble as we see the photo below. It is most important problem which I have. I really have no idea why it could happened. It is alway happened to find a value with decimal type's variable, and even that variable is changed  to "str()".
    setlocale("en-gb")
    dim Min_point,Index_low,result
    Min_point=val(Data.Root.ChannelGroups(1).Channels("CopyYangle").Properties("minimum").Value)
    Min_point=round(Min_point,6)
    Min_point=str(Min_point)
    msgbox("The Min.Value is: "&Min_point)
    Index_low=Chnfind("ch(""CopyYangle"")<="&Min_point&"", 1)
    msgbox("Index No. of Min. Value is: "&Index_low)
    Index_low=Chnfind("ch(""CopyYangle"")<=-0.11374 ", 1)
    msgbox("Index No. of Min. Value is: "&Index_low)
    2.) Still the problem with ChnFind()  or  ChnFindreverse().   If I change the Rounds off a number to the nearest integer with the function "Round()" it might not work in ChnFindreverse(). Such like it works under 4, 6, 8 and even 7 but doesn't work with 3 and 5. Is this logical?
    setlocale("en-gb")
    Dim XE, Xchannel, Ychannel,round_N0
    Xchannel = "[2]/Right"
    T1 = Xchannel
    R1 =val(Data.Root.ChannelGroups(2).Channels("Right").Properties("maximum").Value)
    round_N0=4 ' <========= 3 and 5 Not work, 4, 6, 7, 8 .... work
    R1 =round(R1,round_N0) ' <=========
    msgbox("Max. point is: " &R1 &VbCrlf& "Round Nr is: "&round_N0)
    L1 = ChnFindReverse ("Ch(T1)>=R1",0)
    msgbox("Index number for Max.Point is: "&L1 &VbCrlf& "Round Nr is: "&round_N0)
     .tdx is a valid extensions for an attachement?
    If you couldn't open the TMD file. Please remove ".tdv" the attacments file name to make sure it is "ChnFind.tdx" but not "ChnFind.tdx.tdv".
    Kind regards / Mit freundlichen Grüßen
    J.Huang
    Attachments:
    ChnFind.TDM ‏5 KB
    ChnFind.tdx.tdv ‏39 KB

    Hello J.Huang,
    I downloaded the files and was able to get it to work. It looks like when you format the minimum value to a string, you loose precision and then ChnFind doesn't find the value your are looking for. He is an example which worked for me :
    Set oChnY = Data.Root.ChannelGroups(2).Channels("Right")
    sgValue = str(oChnY.Properties("minimum").Value,"d.ddddddddddddddd")
    Index = ChnFindReverse("Y<="&sgValue,,Array("Y"),Array(oChnY))
    LogFileWrite(Index)
     Using symbols (parameters 3 and 4) is not necessary to get the solution. The key is teh second value for "str" which formats using more digits. As soon as you reduce the number of digits, you may no longer get a result.
    Ther is an alternative to ChnFind, in case there is only one occurance in teh signal which has the minimum value
    Set oChnY = Data.Root.ChannelGroups(2).Channels("Right")
    Index = PNo(oChnY,oChnY.Properties("minimum").Value)
    LogFileWrite(Index)
     I hope one of the two options works for you. I tested the approach with teh first channel too and it worked as well

  • How to find the previous path environment variable in windows 2008

    I am reconfiguring the Hyperion 11.1.2, and later, I installed the ODI. And them when I come back to reconfigure the Hyperion, it cannot be reconfigured, and say cannot find the path parameter. And I check the PATH environment variable, and find it is showing a dumy value, do we have a way to recover the previous PATH envirnment variable?

    To get the source IP address, you will need to enable File Share auditing: http://technet.microsoft.com/en-us/library/dd772690%28v=ws.10%29.aspx
    Otherwise, you can simply disconnect the user session.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Function to find out datatype of a variable

    hi
    can anyone tell me a function that can find out what type of datatype a variable belongs to...
    thank u
    rajiv

    You can overload the function in a package.
    SQL> create or replace package say_kids as
      2    function what_type_is_it (p number) return varchar2;
      3    function what_type_is_it (p varchar2) return varchar2;
      4    function what_type_is_it (p date) return varchar2;
      5    function what_type_is_it (p sys_refcursor) return varchar2;
      6  end;
      7  /
    Package created.
    SQL> create or replace package body say_kids as
      2    function what_type_is_it (p number) return varchar2 is
      3    begin
      4      return 'It''s a number.';
      5    end;
      6    function what_type_is_it (p varchar2) return varchar2 is
      7    begin
      8      return 'It''s a string.';
      9    end;
    10    function what_type_is_it (p date) return varchar2 is
    11    begin
    12      return 'It''s a date.';
    13    end;
    14    function what_type_is_it (p sys_refcursor) return varchar2 is
    15    begin
    16      return 'It''s a cursor.';
    17    end;
    18  end;
    19  /
    Package body created.
    SQL> select say_kids.what_type_is_it ( 1 ) from dual;
    SAY_KIDS.WHAT_TYPE_IS_IT(1)
    It's a number.
    SQL> select say_kids.what_type_is_it ( 'test' ) from dual;
    SAY_KIDS.WHAT_TYPE_IS_IT('TEST')
    It's a string.
    SQL> select say_kids.what_type_is_it ( sysdate ) from dual;
    SAY_KIDS.WHAT_TYPE_IS_IT(SYSDATE)
    It's a date.
    SQL> var c refcursor
    SQL> select say_kids.what_type_is_it ( :c ) from dual;
    SAY_KIDS.WHAT_TYPE_IS_IT(:C)
    It's a cursor.
    SQL>

  • How to find the field name of variable system information on SAP B1

    Hi All,
    I recently wanted to create a simple SQL query to list all ITEM MASTER DATE where the weight is blank.  This is so i can get a list of all items with the weight information missing from the system to investigate. 
    It turns out the weight field within the SALES DATA tab is a system variable.  When i pull the OITM table up within the query generator i can not identify where this variable name come up without guessing which can give me the wrong information.
    Can someone point me into the direction on how to assisocate variable to a field name within SAP B1. This is also another problem if i wanted to display variable within Crystal report layout.
    Regards

    Hi Nick Dang,
    Try This
    SELECT T0.[ItemCode], T0.[ItemName], T0.[SalUnitMsr], T0.[SHeight1],  T0.[SWidth1], T0.[SLength1], T0.[SVolume], T0.[SWeight1] FROM OITM T0 WHERE T0.[ItemCode] =[%0]
    Thanks,
    Srujal Patel

  • How do I find the code behind these variables for 0COSTELMNT?

    0N_COEL
    0N_ANPER
    0N_ANMAT
    0N_ANDEP
    0N_ANTRV
    0N_ANITC
    I have already looked in RSVAREXIT* and  RREX_VARIABLE_EXIT.

    If I right-click "CE" on the left-most panel (InfoProvider), I get the following options:
    Display, New Variable, Cut, Copy, Where-used
    If I right-click "0N_COEL" on the left-most panel (InfoProvider), I get the following options:
    Restrict, Save-as, Cut, Copy, Remove
    If I select-values and right-click I get:
    Exclude Selections, Save Selections, Upload Selections, Download Selections

  • Formula Variable - where to find the coding?

    Hi Experts,
    how can I find the coding of a variable type formula used in query calculation?
    I don´t know the CMOD Project the variable would belong to....
    Thank you,
    Angie

    Hi,
    In CMOD transaction instead of searching for BW, you can press F4 when your cursor is in the Box where we are supposed to enter the implemented project for customer exit variable. Once you do this all the projects would be listed, each one will have a brief description for which area it has been implemeted and it implements what.
    From the list select the relevant enhancement and select components from radio buttons below and then click on display. This will give you the include that has been implemeted for the same. Search for the variable name that is used in the query for the search. You will find the code in there.
    This structure is similar for most enhancements.
    Regards,
    Adarsh Mhatre

  • What is the datatype to store the value of variable of  UTL_HTTP.resp

    Hello,
    I am using Oracle 11g R2 SOE.
    I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
    the datatype of TEXT column is varchar2.
    What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
    Please see the following example if it was not clear;
    Declare
      l_url2 SMS.RESPONSE%TYPE;
      l_http_request2   UTL_HTTP.req;
      l_http_response2  UTL_HTTP.resp;
    begin
      l_http_request2  := UTL_HTTP.begin_request(l_url2);
      l_http_response2 := UTL_HTTP.get_response(l_http_request2);
      insert into SMS (text,response) values (l_url2,l_http_response2);
      UTL_HTTP.end_response(l_http_response2);
    end;Regards,
    Fateh

    Fateh wrote:
    Hello,
    I am using Oracle 11g R2 SOE.
    I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp
    the datatype of TEXT column is varchar2.
    What should be the datatype of the column RESPONSE that is supposed to store the value of a variable of type UTL_HTTP.resp ????
    Please see the following example if it was not clear;
    Declare
    l_url2 SMS.RESPONSE%TYPE;
    l_http_request2   UTL_HTTP.req;
    l_http_response2  UTL_HTTP.resp;
    begin
    l_http_request2  := UTL_HTTP.begin_request(l_url2);
    l_http_response2 := UTL_HTTP.get_response(l_http_request2);
    insert into SMS (text,response) values (l_url2,l_http_response2);
    UTL_HTTP.end_response(l_http_response2);
    end;Regards,
    Fatehutl_http.resp is a record type Its defined like this
    TYPE resp IS RECORD (
       status_code    PLS_INTEGER,
       reason_phrase  VARCHAR2(256),
       http_version   VARCHAR2(64));http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/u_http.htm#i1012713
    I would suggest in your table you split the RESPONSE column into 3 different column and store the fields STATUS_CODE, REASON_PHARSE and HTTP_VERSION accordingly.

  • What is the system variable to find the name of the current window in S.F

    hi
    what is the system variable to find the name of the current window in S.F

    Hi ,
    SFSY_PAGEWINDOW
    regards,
    Prashant

  • What is system variable to find the current list line in list processing

    hi
    what is system variable to find the current list line in list processing

    Hi,
    Please find below the system variable related to list processing
    LILLI    INT4     10     Processing lists       List line selected
    LINCT  INT4     10     Creating lists           Page length in a list
    LINNO INT4     10     Creating lists            Current line
    LINSZ  INT4     10     Creating lists          Line width in a list
    LISEL  CHAR     255     Processing lists       Contents of the chosen line
    LISTI    INT4     10     Processing lists       Index of the chosen list
    Thanks,
    Muthu.

  • I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforwaHow to find the frame exposure time of a variable frame rate mov file

    I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforward by looking at how much the propeller moves between each frame and using the exposure time of each frame.
    However the .mov file is from an iPhone 4S and looking at the details, has a variable frame rate.  What I need to know is the duration that each frame is displayed for in order to do my analysis.  Does anyone know how to find out this information?

    I want to step through a .mov file frame-by-frame looking at geometry of an aircraft in the video to establish the rotational speed of the propeller.  This should be fairly straightforward by looking at how much the propeller moves between each frame and using the exposure time of each frame.
    However the .mov file is from an iPhone 4S and looking at the details, has a variable frame rate.  What I need to know is the duration that each frame is displayed for in order to do my analysis.  Does anyone know how to find out this information?

  • Want to find the Data type of a variable at runtime ?

    Hi,
    I Want to find the Data type of a variable at runtime ?
    I think there is a function module... But i forgot ..... Can you please help me out.
    Points are rewarded immediately.

    hi,
    do this way
    REPORT ysantest LINE-SIZE 350.
    DATA : v_num TYPE n,
    v_type(2).
    DESCRIBE FIELD v_num TYPE v_type.
    WRITE : v_type.

  • How to find the existing hierarchy variable?

    Dear SAP gurus,
    In this existing query, there is a Cost Element hierarchy variable created. When I run the query (second attempt by refreshing the query selection screen), the Cost Element Node variable field was not available to be changed again. Believe this has to do with the option 'Changeable with query navigation' option in the variable created. I was trying to confirm on this via the variable properties, but I had trouble identifying where it is located, because there are just too many cost element hierarchies available for reporting.
    Anyone can help me? Thank you in advance.
    Regards,
    Adelynn

    HI Nagesh,
    Thanks for your highlight, I found the variable, however, I didnt see any option "Changeable with query navigation" for this hierarchy variable. Any reason for this?
    The issue I am facing was, say, when I run the query for the first time with Cost Element Node 1, and i was trying to change my selection to CE node 2, so I refreshed my variable screen but the field to select CE hierarchy Node was no longer there. Normally this happens to variable that has the option "Changeable with query navigation" unchecked.
    But in this case, I did not see this option for the hierarchy variable used, how do we justify the scenario in this case?
    Please kindly assist, thanks again.
    Regards,
    Adelynn

Maybe you are looking for