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.

Similar Messages

  • How to find the Data Type of a column

    Dear All,
    How to find the Data Type of a Column dynamically in oracle Form.
    Thanks and Regards,
    Fazil
    Edited by: user11334489 on Aug 25, 2012 9:06 PM

    hi,
    you can use get_item_property built-in
    eg:
    declare
       l_item VARCHAR2(10);
    begin
       l_item := Get_Item_Property('item_name',DATATYPE);
    end;

  • 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

  • How to Find the Data Type of the Field In a Database Table

    Hi Experts,
    I'm currently working on a program which needs to find out the data type of the given field in a database table. In addition to accessing DD03L directly, is there any other workaround such as function module to help me achieve this? It would be helpful if a demo example could be provided.
    Thanks a lot.

    Hi,
    Use this..
    DESCRIBE FIELD dobj  TYPE typ.
    write typ.
    type will contain the data type of the object.
    and check this thread also....
    Re: How to get datatype of fields in dynamic structures
    Cheers,
    Simha.
    Reward all the helpful answers..

  • I want to find the data analysis pack that is an add on to excel

    how do i find the data analysis pack on numbers? on excel you go to the tool bar and the list of add ons would be listed but i cant find it on numbers.

    i,
    Numbers doesn't have a Data Analysis Pack add on.
    Jerry

  • How to get the data type of a variable

    Hi
    I'm new to java and I'd like to put some variables with different data type into the HashMap. But when I'm going to get the value
    of the variable I want to know its data type (int,String,long,float etc.) before I do some processing.
    here's my sample code:
    //start...
    Map m = new HashMap();
    String s1 = "String1";
    String s2 = "String2";
    int i1 = 5;
    int i2 = 10;
    m.put(1,s1);
    m.put(2,i1);
    m.put(3,12);
    m.put(4,s2);
    //end...
    when I'm going to retrieve the variable, I'd like to assign it to another variable with the same data type. but the problem is, before
    I assign it I must know its data type so that I could not have an error.
    thanks in advance

    I don't think you will be able to put primitives (ints, floats, etc) in, without wrapping 'em first (java.lang.Integer, java.lang.Float...).
    You can get the type with
    Object biggles;
    // Get biggles
    if( biggles instanceof String )
       System.out.println( "Biggles is a string, yeah biggles" );or with refection
    Class bigglesClass = biggles.getClass();
    System.out.println( "Biggles is of type: " + bigglesClass.getName() );

  • Having trouble assigning the Data Type to Shared Variables

    I have some type definitions that I need to use as shared variables.  When making the shared variable, I create it and then name it.  I then select "From Custom Control..." in the Data Type field and select the applicable type definition.  The problem is that it displays some other type definition.  Am I doing something wrong?  I am using LV v.8.6. I don't recall having this problem with v.8.5.1.

    Hi Hunter,
    All the custom controls are set to Type Def.  Since sending my question, I noticed that the system uses the first similarly used custom control and it's name.  For example, I have several clusters that each have four numeric controls in them.  When creating a shared variable for each of the various clusters, it uses the first custom control that was set up as a shared variable.  I hope this makes sense to you.  I have not had a chance to see if the shared variables are working because I have other issues to deal with first. 
    What troubles me is that I don't recall seeing this with v.8.5.1.
    I suppose I could and perhaps should use a common type def for all similarly used shared variables.
    Dave

  • How to know the data type of a variable?

    Hi,
       Can anyone tell me which function can return the name data type of a variable?
        Thanks!
    Message was edited by: Long Zheng

    Hi long,
    1. I don't know whether this will serve your purpose.
    2.
    REPORT abc.
    DATA : components     LIKE     rstrucinfo OCCURS 0 WITH HEADER LINE.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        program    = sy-repid
        fieldname  = 'T001'
      TABLES
        components = components.
    LOOP AT components.
      WRITE :/ components-compname , components-type.
    ENDLOOP.
    regards,
    amit m.

  • How to retrieve the data type of a column of a table?

    Hi,
    I want to retrieve the data type of a column of a table. At the moment I am querying "OCI_ATTR_DATA_TYPE" attribute but it is returning SQLT_CHR for both varchar2 and nvarchar2 data type columns. I need to distinguish between these two data types columns separately. Is there any API through which I could get the exact data type of a column i.e. "nvarchar2"?
    Thanks in advance.
    Hashim

    Hi,
    This is the Oracle C++ Call Interface (OCCI) forum - I'm not sure if you are using OCCI or OCI (Oracle Call Interface - the C interface) since you reference "OCI_ATTR_DATA_TYPE" which is more of an OCI focus than OCCI.
    In any case, you might take a look at "OCI_ATTR_CHARSET_FORM" which takes the following values:
    #define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
    #define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */So, if you have a datatype of SQLT_CHR and OCI_ATTR_CHARSET_FORM is SQLCS_IMPLICIT then you have a varchar2 if it is SQLCS_NCHAR then you have an nvarchar2.
    If you are using OCCI and not OCI then take a look at MetaData::ATTR_DATA_TYPE and MetaData::ATTR_CHARSET_FORM which expose OCI_ATTR_DATA_TYPE and OCI_ATTR_CHARSET_FORM respectively.
    Perhaps that will get you what you want.
    Regards,
    Mark

  • How to Change the data type of infoobject from NUMC to CHAR

    Hi Experts,
    I have created an infoobject with data type as NUMC, i used in DSO as a key figure and i have loaded data up to PSA.
    Now i want to change the data type of this Info Object from NUMC to CHAR.
    Can anyone suggest me the solution for this issue.
    Regards,
    Venu Gopal.K

    Hi pavan/binu,
    I have not loaded data into DSO i just added IO in Key fields and i started editing this IO then im facing error like
    1.Master Data Table /BIC/PZCUSTOMER contains data: Characteristic ZCUSTOMER cannot be activated     
    2.SID Table /BIC/SZCUSTOMER contains data: Characteristic ZCUSTOMER cannot be activated
    Im also unable to edit the P & S tables in SE14.
    NOTE:I have data only in PSA and when im trying to load data to DSO Im facing these issues.

  • Why the objects of sysman are created with the data type varchar2 CHAR

    Hi,
    I have an environment with the following properties,
    NLS_LENGTH_SEMANTICS BYTE
    NLS_CHARACTERSET AL32UTF8
    After I have created the db control repository, I find the data type of the sysman's objects are
    VARCHAR2 (64 CHAR)
    Why?

    NLS_LENGTH_SEMANTICS does not apply to tables in SYS and SYSTEM. The data dictionary always uses byte semantics.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams127.htm

  • Findind Data type of a variable in Run Time

    Hi Experts,
        I am trying to find the data type of variable in runtime with "DESCRIBE FIELD" statement.
        but it always shows data type C by default. i have written this code.....
        DATA: w_value TYPE d.
        DESCRIBE FIELD p_value TYPE w_value.
       My requirement is that if  i pass a variable of any type(like date, time , char, Integer , Decimal etc.) from selection screen i  will   give the correct data type of variable.
    Please let me know how to acheive this problem.
    Regards,
    Shri

    Hey Raj,
    In this code it always ask a date type variable.
    Still my problem i snot getting solve.
    check the below one which might give u a fair idea
    DATA: Desc_object         TYPE ref to cl_abap_typedescr.
    Parameters:   p_char           TYPE char10 ,
                  p_date           TYPE d,
                  p_int            type i.
    Field-symbols : <any_type> type any.
    START-OF-SELECTION.
      If p_char is not initial.
         assign p_char to <any_type>.
      elseIf p_date is not initial.
         assign p_date to <any_type>.
      elseif p_int is not initial.
         assign p_int to <any_type>.
      endif.
    IF <any_type>  is assigned.
      desc_object = cl_abap_typedescr=>describe_by_data( <any_type> ).
      WRITE: / desc_object->absolute_name.
      WRITE: / desc_object->type_kind.
    ENDIF.
    The Catch lies in assigning the variables to field symbol. I think you already have that part of code
    Edited by: A J Raj on Dec 9, 2009 7:12 PM

  • I WANT TO FIND THE EXPIRY MATERIAL LIST DATE WISE

    I WANT TO FIND THE EXPIRY MATERIAL LIST DATE WISE

    Hi Prashant,
    Use TC - BMMC (Batch Cockpit)
    or Find all TC in one place
    SAP Easy Access
    Logistics
    |____ Central Functions
            |_________Batch Management  (Here you find all and suit your requirment)
    Note: Please assign valuable point in orde to encourage contributors for every answer to your queries.
    Best Regards,
    Silky

  • Hi, i want  to find the difference in days of two students Date Of Birth

    hi, i want to find the difference in days of two students Date Of Births
    how can i find.
    please help me

    i didn't find what u saidLet me help you:
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=difference+between+dates&subCat=siteforumid%3Ajava54&site=dev&dftab=siteforumid%3Ajava54&chooseCat=javaall&col=developer-forums

  • HT201493 I use Friend finder. I just want to know the date when I added my friends? Can anybody tell me how?

    I use Friend finder. I just want to know the date when I added my friends? Can anybody tell me how?

    bobseufert wrote:
    I thought it was a great way to lose friends. I don't know one person that would want me to be able to track their location.
    I absolutely agree. I use Glympse if I need to let someone know my whereabouts for a short period of time. But, beyond that, ick!

Maybe you are looking for

  • Installing Windows 7 on iMac via external superdrive resultes in "No bootable device-insert boot disck an dpress any key".

    I previously had Windows 7 on my Mac, but removed it after returning from deployment because it had a virus that I could not remove.  The only way to remove was to insert a CD/DVD with the anti-virus on, but in my absence, the optical drive was not c

  • FOTY0001: type error

    Hi, I have a case where I have to read a database table and in that table I have a field of long type (contains a xml payload). I have to parse the payload and assign it to another variable so that it updates in another table. I am using the parseEsc

  • Mail PDF attachments hide typing in emails

    Has anyone come across a bug in mail whereby when you type out an email and add an attachment the attachment just plonks itself on the page and covers over the words of the email you have typed. It also appears like this in the sent items. Quitting m

  • Tax Condition Type Problem

    hello Folks i tried to have the CST and VAT calculation running form the customer master record, but i could not finish it. i created two conditions types, ZCST, ZVAT & with proper access sequence and placed the condition types onto my tax procedure.

  • Singleton service

    Hi guys I tried to create singleton service by implement SingletonService interface which provided by weblogic. And configure singleton service in weblogic-application.xml file. And define singleton service in environment->cluster->singleton service