How to know the type of a variable??

how to know the type of a variable??
For example, give you a variable s, how to determine if it is
a primitive type, of an object?? If this is primitive type,
any ways to determine if it is integer, boolean, double, ...??

I am currently working on a project where this happens. I have a main type of object that all of my other types extend. While working on the objects in a method, any type of other object could be coming through. To test I try to cast the object and catch class cast exceptions. This only works because I know the different type that will be coming through....
public void testObject(classX object){
  try{
    classY object = (classY)object;
  }catch(ClassCastException CC){
    try{
      classZ object = (classZ)object;
    }catch(ClassCastException CCC){
      /// the object fails to be cast as the types I tested for.
}

Similar Messages

  • How to know the type of mobile?

    how to get the type of mobile model mean under nokia asha 308(rm 352/ rm 838) which model i have when i am buying this mobile .no option to check the *#0000# option then how to get this..

    Check the label on the box or under the battery.

  • How to know the type of accounting i.e., Cash or Accrual

    Dear Members,
    How can we know which accounting type is used _(i.e., cash basis or accrual basis)_ in Oracle e-Business Suite 11i and R12?
    Please throw some light on the above question.
    Many thanks in advance.
    Best Regards,
    R4S.

    Hi,
    When you enter accounting options in payables, you can apply which method, cash or accrual, you need for a particular set of books.
    Also, you can check which method a Ledger is following by viewing the Activity summary or T format representation of invoice entry. If the enteries are debiting expense and crediting cash, than it is cash method of accoutning. If the entry is debiting expense and crediting liability account, then it is using accrual method of accounting.
    Please let me know if above information was of any help to you.
    Regards
    Pooja

  • How to know the type of transactions by seeing the data in IP_IN_QUEUE

    Hi B2B gurus,
    I am Using EDI X12 over internet. Our suppliers processing inbound transactions to us,After receiving from B2B its storing in IP_IN_Queue, The documents which we are sending it storing in IP_OUT_Queue.
    We want to see the data in in IP_IN_QUEUE, Could you please tell in which table the data will store, And can we see the payload or can we know actually which transactions by seeing the data in table? Could you please help by giving this information...?
    regards
    srinivas k

    As I mentioned earlier view "b2b_instancemessage" has "payload" column which stores the payload of both incoming and outgoing messages.
    Below query will return all the rows of this view which has payload -
    select * from b2b_instancemessage where payload is not null;
    Remember, it's a BLOB type field so either use a client like PL-SQL Developer or TOAD otherwise write a java client to view the content of this column.
    Regards,
    Anuj

  • How to know the type of a control

    Hi,
    Here's a hard one.
    The column 14 (Document Type) in the Stages of Sales Opportunity.  What kind of control it is.
    Here's what I tried that doesn't work yet :
    SAPbouiCOM.EditText DocType = (SAPbouiCOM.EditText)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.ComboBox DocType = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Matrix DocType = (SAPbouiCOM.Matrix)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Grid DocType = (SAPbouiCOM.Grid)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Item DocType = (SAPbouiCOM.Item)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    SAPbouiCOM.Field DocType = (SAPbouiCOM.Field)Matrix.Columns.Item(14).Cells.Item(Matrix.RowCount).Specific;
    This one works tho :
    SAPbouiCOM.ComboBox Stage = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(4).Cells.Item(Matrix.RowCount).Specific;   // 4 is the Column for Stage

    What doesn't make sence here is that
    SAPbouiCOM.ComboBox Stage = (SAPbouiCOM.ComboBox)Matrix.Columns.Item(4).Cells.Item(Matrix.RowCount).Specific;   // 4 is the Column for Stage
    For the column 4 it works perfectly and for the column 14 it doesn't work at all.
    but what is the difference between the 2 columns as I look at them they look idendical in fonctionalities.
    if I use a Try Catch I get this :
    Unable to cast COM object of type 'System.__ComObject' to interface type 'SAPbouiCOM.EditText'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{AE1C43FF-0F2B-4130-A0B7-40E38D5EC60E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    Now who will be able to tell me what type of object is in the column 14 of the stages in Sales Opportunity ?

  • How to know the proxy type??

    How can I know the type of proxy I am connecting to?? like whether its SOCKS, or HTTP etc...which all are enabled....
    thanks in advance....

    I get an error java.net.SocketException: Malformed reply from SOCKS server while connecting through the proxy.That indicates that there isn't a SOCKS proxy at the indicated host:port.
    Is there any other chances of errors than socks not being enabled?You could have got the host or port wrong.
    and how can I know if it is really enabledThe connection will work ...

  • How to know the printprogram and output type for perticular standard script

    how to know the print program and output type for perticular standard script and wt the proceure we will fallow to modifie the standard script..if possible u have any sample code plz share with me.....

    Hi Phani,
    To know the print program and output type for a standard script we have a table called TNAPR. So just you go to SE11 and provide the table name as TNAPR and choose display option.Then go with display entries option and in selection screen you have to provide the form name for whic you want to know the print program and output type.
    To modify a standard script first of all you have to copy the standard form for which you need modifications into Zform. Once you done this you can modify the layout set as per your requirement.Then what ever the modifications you have done in layout set for that you need to populate the data.For this you also need to do some modifications to the print program.so you have to options like directly you can modify the print program as per your requirement and other one is you can create a subroutine and do coding in that subroutine. Then you need call this subroutine in the Script Form.like this you can do modifications to the standard script........................... Reward me if its helpful..........
    Thanks & Regards.
    Laxman.P
    B'lore.

  • How to know the output type for particular tcode

    Hi
    how to know the output type for the VL10D & VAL TCODES.
    Can anybody help me out.
    Thanks and Regards
    Krishnarao

    Hi Krishna,
    GO to NACE and select your application and click on output types and in the next screen select your output type and and dbl click on Processing routines.
    Here you will come to know about which driver program is used for which smartform or Script.
    and for Program details you can refer table: REPOSRC
    Regards,
    Sachin

  • How to know the Control type using event param???

    Hi,
    I wrote a function on MOUSE OVER EVENT. I called this
    function from a LIST and DATAGRID using addEventListener.
    Now i got a requirement like on event fire.. i wanna alert
    the control type i.e., whether the action fire from LIST or
    DATAGRID. I can create two different function for both LIST and
    DATAGRID. But requirement is like cannot reapeat the code.. code
    minimization.
    Is there any property to know the type of control(Like its
    LIST or DATAGRID) using event parameter??
    Thanks & Regards
    PRatap

    You can try using flash.utils.describeType or
    flash.utils.getQualifiedClassName on event.target property and
    figure out the control type.

  • 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 to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • With a contract number, how to know the total PO release value against it?

    Usually one contract corresponds to multiple PO records, now we know the contract number, then how to know the total PO release value against this contract.  In other word, we would like to know the total release value of all the POs with the same contract number.  To just input the contract number in EKPO table? but then look for which field in this table to add these PO release values up?
    We will give you reward points!
    Thanks!

    hi Mohammad,
    By following your instruction, input the contract number 4800000112 into Document number field, then hit Enter, get the following (only copy two records here for example), but kind of a mess.  Could you let us know which one is the PO release value for this contract?
    Contract   Type Vendor     Name                                 PGp Agmt. date
      Item  Material           Short text                               Mat. group
      D I A Plnt SLoc                 Targ.qty. Un       Net price  Curr.   per Un
    4800000112 WK   2000012012 GULF INTERSTATE FIELD SERVICES       QBH 06/20/2006
    Agreement start06/20/2006 Agreement end 12/31/2007
    Tgt. val.        1,000,000.00  USD   Open          1,000,000.00 USD   100.00 %
      00001                    Inspection Svcs, Construction            R3VNI
      L   U                                  0  UL            0.00  USD       1 EA
      00002                    Chief Inspector                          R3VNI
      L   U                                  0  DAY         390.00  USD       1 DAY

  • How to transport the BW query's variable to BO  webi report

    Hi all
    I'd like to know how to transport the BW query's variable to BO 's webi . today ,I created a sap customer varible in my bw system to get the max calmonth in the active table.The varible in the BW side run's well ,but I use this query to build a new univers ,and created a new webi report base on this univers ,but the question is the webi report can't get the varible's value I wann to know how to transport the bw varible value to BO webi report
    Thanks and regards,
    Peter .zhu

    I have changed my variaable in my bw query ,I found if you use SAP default variable it is ok in BO side . So I get a guidline by SAP default variable ,I changed my customer variable in variables edite ,don't use 'ready for input' .And then the variable can be useful in BO side .
    Edited by: peter zhu on Jun 16, 2008 11:43 AM

  • How to know the run time of a program..?

    Hi Gurus,
    How to know the exact run time of a program....?
    Suppose i've a program....I've changed the code to improve the performance.
    Now i want to compare run time of older and new one...How to do this...?
    Pls help me ....
    Thanks and Regards,
    Nagarjuna

    Hi,
    go thru the below mentioned code............
    data:   start TYPE i,
              end TYPE i,
              dif TYPE i.
    GET RUN TIME FIELD start.
    SELECT SINGLE bukrs belnr gjahr blart budat
    FROM bkpf
    INTO (cc, doc, fy, doc_ty, pst_dt)
    WHERE bukrs = p_bukrs
    AND belnr = p_belnr
    AND gjahr = p_gjahr.
    GET RUN TIME FIELD end.
    dif = end - start.
    WRITE: /001 'Time for select',
    067 ':', dif, 'microseconds'.
    Reward all helpful answers.
    Thanks

  • How to specify the type of table in the form parameters

    How to specify the type of table in the form parameters. for example, how to specify the type of table "vacancies".
    FORM getcertainday
                       USING
                       vacancies TYPE STANDARD TABLE
                       efirstday LIKE hrp9200-zfirst_day
                       lfristday LIKE hrp9200-zfirst_day.

    Hi
    Are you asking about subroutine program to declare a variable for perform statement etc
    if it so check this coding
    DATA: NUM1 TYPE I,
    NUM2 TYPE I,
    SUM TYPE I.
    NUM1 = 2. NUM2 = 4.
    PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.
    NUM1 = 7. NUM2 = 11.
    PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.
    FORM ADDIT
           USING ADD_NUM1
                 ADD_NUM2
           CHANGING ADD_SUM.
      ADD_SUM = ADD_NUM1 + ADD_NUM2.
      PERFORM OUT USING ADD_NUM1 ADD_NUM2 ADD_SUM.
    ENDFORM.
    FORM OUT
           USING OUT_NUM1
                 OUT_NUM2
                 OUT_SUM.
      WRITE: / 'Sum of', OUT_NUM1, 'and', OUT_NUM2, 'is', OUT_SUM.
    ENDFORM.
    If your issue is some other can u explain me clearly
    Regards
    Pavan

Maybe you are looking for

  • Connecting my iphone to my wireless internet

    i have a livebox and am struggling for the password. have tried doing it the way i would if it was a laptop (by pressing the number 1 on the box) but still nothing. i can connect my mac to my boyfriends internet though (which is static and diff to mi

  • NPV of FX Forward Contracts

    Hi coleagues We currently have forward contracts 60A and forward hedge accounting transactions (60B). With the current configuration we are able to execute NPVs for 60Bs (hedge accounting transactions) but on 60As NPVs are  not generated. I would lik

  • MacBook Pro (retina display)is it upgradeable

    I am planning to purchase the new introductory model MacBook Pro (retina display). However, I like to be able to upgrade to a large flash storage module in the future. Will that be possible?

  • CR on VS2010 / SetDataSource error on Client

    Hallo, i've got a Problem with the CR 13_0_2 Runtine on a 32bit XP System. I've designed a Report on my System (Win7 64bit / Visual Studio2010 /CR13 IDE). On my System everything is fine, but when i run the Application on the Client my App stops an W

  • Help creating buttons with actions

    I am looking for a way to program buttons with actions and conditional outputs. As an example: After populating a set number of cells, I would like to be able to program a button to copy the contents of those cellsto another set of cells. Also, a but