Get type of variable dynamically

Hi,
i want to get the type of a variable. For example, the following code :
data: my_var type zmystruct.
In ABAP, i want to get type 'zmystruct' and after to create dynamically a new variable of this type.
Thanks for help.

HI,
You use the following syntax to define reference types:
<b>TYPES dtype {TYPE REF TO type}|{LIKE REF TO dobj}.</b>
The syntax for a direct declaration of a reference variable is as follows:
<b>
DATA ref {TYPE REF TO type}|{LIKE REF TO dobj}.</b>
The addition REF TO defines a data type dtype for a reference variable and declares the reference variable ref. The specification after REF TO specifies the static type of the reference variable. The static type constricts the object set to which a reference variable can point. The dynamic type of a reference variable is the data type and the class of the object respectively, to which it currently points. The static type is always more universal or equal to the dynamic type
You can use the TYPE addition to define data types for data and object reference variables. The LIKE addition exclusively defines data types for data reference variables.
The syntax and meaning of the additions TYPE and LIKE are completely equal for both statements with the exception that TYPES creates an independent reference type, whereas DATA creates a bound reference type.
Regards
Sudheer

Similar Messages

  • How to get data type of variable in program..

    Hi ABAP Guru.
    I need to know how to get data type of variable or any structure field.. because I got short dump when use command REPLACE ALL OCCURANCE ... with variable/structure field that has data type I or P, I think it should be used with data type CHAR only, So I need to check the data type first.
    Please give me your advice
    Thank you all.
    Nattapash C.

    data : v_value type i,
             v_char(10) type c.
    v_value = 10.
    move v_value to v_char.
    REPLACE ALL OCCURRENCES of '#' from v_char....
    Best regards,
    Prashant

  • Getting the value of variable dynamically

    Hi Gurus,
    How can i get a value of a variable dynamically through user input?Is it possible to get it interacively?
    my reqiurement is to control my loop according to the user supplied value for the flag variable.
    if the user gives the flag as 'Y' loop should continue.else loop should terminate in a PL/SQL block
    here is a piece of code
    CREATE OR REPLACE procedure c is
    flag1 varchar2(10):='Y';
    begin
    while flag1 <> 'N' loop
    dbms_output.put_line('Enter the value.....' );
    +*<< Here I have to get the value of flag1 from user .How to get the user value>>*+
    end loop;
    end;
    Please advice
    Edited by: user5203944 on Nov 18, 2008 3:01 AM

    To add my 2 cents worth you can not get where you want with sqlplus calling PL/SQL
    You have 2 problems
    SQLPLUS has no loop construct and not much in the way of conditional capabilities.
    PL/SQL can not talk to a terminal.
    If you use an &variable in an anonymous block, it is evaluated by sqlplus before the parse of the block takes place.
    Nothing you do in the block can change its value.
    dbms_output.put_line buffers everything output to it and then sqlplus outputs it all after the block completes.
    You can accept variables in sqlplus and pass them into an anonymous block for use, but you would have to exit the block if you wanted to ask something based on a condition determined in the block. You would then have no way to re-enter that block within the sqlplus session.
    Host language programs do not have this problem. You can use ProC ProCOBOL, OCI, Visual Basic, and web interfaces.
    Unless you are on windows you can use a shell script (Unix, Linux or VMS) to do what you want.
    You can accept the variable in the script within a loop. You can call sqlplus silently passing the variable on the command line. You can use the variable command to define variables that will be set in pl/sql blocks use selects of these :variables to set defined sqlplus &variables. You can spool files that will then be processed by the shell language. All this can be done in that shell loop.
    In other words you can do anything you need. You do need to understand your tools and their limitations. You can not use sqlplus commands in pl/sql for example.
    Edited by: Old DBA on Nov 18, 2008 7:31 PM

  • An error occured while creating the new dataset Could not get type informat

    Uses: Windows XP Pro SP3+; OracleXE; Oracle 8i Client; ODP.NET; Visual Studio 2005 PRO;
    I had OracleXE and was using OracleXE's Oracle.DataAccess Version 10.2.0.100 which was located in C:\oraclexe\app\oracle\product\10.2.0\server\BIN. Then to use Oracle Developer Tools for VS, I installed ODAC where the Oracle.DataAccess's version was 2.111.6.20.
    Everything connected via SqlPlus and even was able to Oracle XE Home page and was able to loginto it. Further, was even able to create connection with Oracle Dot Net Provider. The problem was created when I tried to create a datasource from DataSource Menu in VS.2005. It was giving an error saying "An error occured while creating the new dataset Could not get type information for dataset". However I wittnessed that Dataset is been created in Solutions Explorer but not in Data Source Tab. Further researching I was able to create Datasets with Microsofts Oracle Data provider with out any issue.
    My Path variable list the following:
    C:\app\Administrator\product\11.1.0\client_1;
    C:\app\Administrator\product\11.1.0\client_1\bin;
    C:\oraclexe\app\oracle\product\10.2.0\server\bin;
    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;
    C:\Program Files\Borland\BDS\4.0\Bin;
    C:\PROGRA~1\Borland\Delphi5\Projects\Bpl;
    C:\PROGRA~1\Borland\vbroker\jre\Bin;
    C:\PROGRA~1\Borland\vbroker\Bin;
    C:\PROGRA~1\Borland\Delphi5\Bin;C:\orant\bin;
    C:\WINDOWS\system32;C:\WINDOWS;
    C:\WINDOWS\System32\Wbem;
    c:\Program Files\Microsoft SQL Server\90\Tools\binn\;
    C:\Program Files\Microsoft SQL Server\80\Tools\BINN;
    C:\Program Files\java\jdk1.6.0_07\bin.
    Further I got 2 Oracle Homes one which C:\orant and other is located in C:\app\Administrator\product\11.1.0\client_1.
    Also noted that while deploying at client site I started gett'n this error:
    "Unable to install or run the application. The application requires that assembly Oracle.DataAcces version be installed in Global Assembly Cache First."
    Is it due to change in the production machine? Any help in this regard is greatly appreciated.

    Hi Pushpa,
    Which enhancement package are you on currently? This is observed in cases where originals in DIR's are invisible and sometimes error message 26296 occurs in transaction CV01n. Hence,please check your entries in the table SDOKPROP to avoid such a problem in your system.
    Further,suggest you explore if the below resolutions can be adopted in your case.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=10321987
    http://wiki.sdn.sap.com/wiki/display/PLM/OriginalsinvisibleafterEHP3or+EHP4
    Regards,
    Pradeepkumar haragoldavar

  • Getting Type Mismatch Error while passing Array of Interfaces from C#(VSTO) to VBA through IDispatch interface

    Hi,
    I am facing issues like Type Mismatch while passing Array of interfaces from .NET  to VBA and vice versa using VSTO technology.
    My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
    My Interface definition is somewhat like this
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
        [Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
        public interface IInterface1
            [DispId(0)]
            IInterface2[] GetObj();
            [DispId(1)]
            void SetObj(ref IInterface2[] obj);
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
        [Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
        public interface IInterface2
    IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
    Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
    Kindly provide some assistance regarding the same.
    Thanks

    Hi,
    I am facing issues like Type Mismatch while passing Array of interfaces from .NET  to VBA and vice versa using VSTO technology.
    My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
    My Interface definition is somewhat like this
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
        [Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
        public interface IInterface1
            [DispId(0)]
            IInterface2[] GetObj();
            [DispId(1)]
            void SetObj(ref IInterface2[] obj);
        [ComVisible(true)]
        [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
        [Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
        public interface IInterface2
    IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
    Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
    Kindly provide some assistance regarding the same.
    Thanks

  • How can you get  the public variables from object that extends JLabel?

    I'm using the mouseClickedListener method e.getComponent(); to get the component that is clicked on the sceen. The component i clicked is type "object" and extends a jlabel, and i really need to acces a variable from it. Heres the code i'm using-
    MouseListener listenerDown=new java.awt.event.MouseListener() {
            public void mousePressed(MouseEvent e){
                paintAll();
                mX=e.getX();
                mY=e.getY();
            public void mouseClicked(MouseEvent e) {
                Component c = e.getComponent();
                drawResizeBox(c);
                selected=c;
            public void mouseReleased(MouseEvent e) {
            public void mouseEntered(MouseEvent e) {
            public void mouseExited(MouseEvent e) {
    package javapoint;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.Line2D;
    import java.awt.image.BufferedImage;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    public class object extends JLabel{
        public object(Rectangle rect,int id){
            idNum=id;
            Rect=rect;
            BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = (Graphics2D) image.getGraphics();       
            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g.drawRect((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight());
            Icon icon = new ImageIcon((Image)image);
            setIcon(icon);
            setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);
            mainFrame.slideArr[mainFrame.sIndx].add(this);
            setVisible(true);
            r=true;       
        object(Oval oval,int id){
            idNum=id;       
            setBounds(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            getGraphics().drawOval(oval.getX(), oval.getY(), oval.getWidth(), oval.getHeight());
            o=true;
            setVisible(true);
        object(Line2D line,int id){
            idNum=id;       
            setBounds((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2()); //Not gunna work
            getGraphics().drawLine((int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2());
            l=true;
            setVisible(true);
        object(Icon icon,int id){
            idNum=id;
            setIcon(icon);
            setBounds(50,50,icon.getIconWidth(),icon.getIconHeight());
            i=true;
            setVisible(true);
        void drawObject(object obj){
            if(r){
                Rectangle rect=obj.Rect;
                setBounds((int)rect.getX()-1, (int)rect.getY()-1, (int)rect.getWidth()+1, (int)rect.getHeight()+1);          
                Rect=rect;
                BufferedImage image = new BufferedImage((int)rect.getWidth()+1, (int)rect.getHeight()+1, BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = (Graphics2D) image.getGraphics();           
                g.setColor(Color.red);
                g.drawRect(0, 0, (int)rect.getWidth(), (int)rect.getHeight());           
                Icon icon = new ImageIcon((Image)image);
                setIcon(icon);
            }else if(l){
            }else if(o){
            }else if(i){
        public boolean r=false;
        public Rectangle Rect;
        public boolean o=false;
        public Oval Oval;
        public boolean l=false;
        public Line2D Line;
        public boolean i=false;
        public Icon Icon;
        public JLabel label;
        public int idNum;
    }Edited by: ghostbust555 on Feb 12, 2010 2:14 PM

    ghostbust555 wrote:
    Well see the problem is i have an array of 200 objects.What does that have to do with anything? And if it does, why isn't it in the code you posted?
    I dont understand what you mean in your "Edit..." part. could you show some code/ explain farther? sorry if its a dumb question I'm still a bit of a novice at java.Yeah.
    object yuck = (object) e.getComponent(); // That's a cast.
    boolean yucksR = yuck.r; // Get the "r" variable from the object.

  • 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 can I use evaluate to get the instance variable in customized tag

    1.
    At first , I create a class called bean,and declared several params in it and do not define any getter function for the param.
    class bean{
    String param = "test";
    SomeClass scObj = new SomeClass();
    2.
    The second ,I use
    request.setAttribute("beanObj",new bean());
    3.
    And then I wanna use the customized tag to show a text box , then initialize it's value.
    <salt:text name="param" value="beanObj.param">
    <salt:text name="obj" value="beanObj.scObj.func()">
    4.
    I tried the evaluator provided by JexlContext ,Struts, JSTL and it seems that if I do not define the getter for the variable ,I can not get the bean's instance variable's value.
    Expression e = ExpressionFactory.createExpression( value );
    JexlContext jc = JexlHelper.createContext();
    jc.getVars().put(strInitBeanName, request.getAttribute("beanObj"));
    Object obj = e.evaluate(jc);
    the result of the obj is null....
    Can anybody recommand some other evaluator can get the value of a instance variable from an object?

    do you have any other suggestion ? Nops, somebody else may have though. AFAIK, all lookups of the type
    beanName.propertyNameuse reflection on the getXXX() methods to access the property.
    Having said that, I guess you could write one though in a custom tag, using the same - reflection (you will ahve to rely on the java.lang.reflect.Field class quite heavily) - but that would be reinventing the wheel for most other functionality that you would have to include (like looking up the bean in scope etc)
    cheers,
    ram.

  • Issue while Passing Values to Variable Dynamically in ODI

    Hi All,
    We are trying to pass values to ODI variable dynamically. The value passed is File path. We are successfully able to achieve this when we are passing the relative path i.e. ‘..\demo\xml’ but while we are trying to pass the absolute path i.e. ‘D:\ODI\oracledi\demo\xml\’ we are getting the below given error in the Load step of the interface..
    com.sunopsis.sql.SnpsMissingParametersException: Missing parameter
    at com.sunopsis.sql.SnpsQuery.completeHostVariable(SnpsQuery.java)
    at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
    at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
    at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
    at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
    at com.sunopsis.dwg.cmd.e.i(e.java)
    at com.sunopsis.dwg.cmd.g.y(g.java)
    at com.sunopsis.dwg.cmd.e.run(e.java)
    at java.lang.Thread.run(Unknown Source)
    Googling for the same has yielded the following results :-
    •     if the file name has : in it then ODI will consider it as a binding variable rather path. .. So try relative path. – Relative Path is working but we need to achieve this by giving absolute path.
    •     make sure you are using LKM File to SQL rather SQL to SQL. – We have tried by 3 different LKMS—File to SQL, SQL to SQL and SQL to Oracle but the error is same in all.
    Any pointers regarding the same will be very helpful.
    Thanks In Advance.
    Regards,
    Abhishek Sharma

    Hi Cezar,
    Thanks for the response. The issue here is we are picking this path from a table. We have FILE_PATH column in one database table and in ODI variable we have given SQL query as 'Select FILE_PATH from tablename'. Then we are taking the refresh value of this variable and passing it on to our interface.
    If the Path in table is given as relative path it works , else for absolute path it doesnt work. How can we achieve the solution recommended by you in this case. The FILE_PATH value in table may change, so we need to pick the file from whatever path it fetches from the select statement. Hence we cannot hard code it here.
    Please suggest.
    Thanks Again.
    Regards,
    Abhishek Sharma

  • Get BPM Container Variable?

    Is it possible to get the value of a BPM simple type container variable at Mapping time?

    Hi Ruben,
    you can use a trick:
    - datatype: extend the source container with one field (your simple type)
    - datatype: make all fields optional (0-1 or 0-unbounded)
    - process: create a new multiline container from this type
    - tranformation: fill the one line container with simple type
    - container operation: append to multiline
    - tranformation: fill the one line container with your message
    - container operation: append to multiline
    - transformation: merge the multiline to single-line
    - transformation: Now you have the value of your simple type in an additional field
    Regards,
    Udo

  • Type conflict during dynamic method call.

    While executing the following program I get the error "Type conflict during dynamic method call.":
    DATA: container_r  TYPE REF TO object,
          grid_r       TYPE REF TO object,
          itab_saplane TYPE TABLE OF saplane.
    * IMPORTANT NOTE: class names must be in UPPER CASE
    DATA: str_cnt TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
          str_gui TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
          meth_name TYPE STRING VALUE 'SET_TABLE_FOR_FIRST_DISPLAY'.
    TYPE-POOLS abap.
    DATA: ptab    TYPE abap_parmbind_tab,
          wa_ptab LIKE LINE OF ptab,
          ref     TYPE REF TO data.
    CREATE OBJECT container_r TYPE (str_cnt)
      EXPORTING container_name = 'CUSTOM_CONTROL1'. " Name of the custom control area (UC!)
    * Construct parameter itab
    GET REFERENCE OF container_r INTO ref.
    wa_ptab-name  = 'I_PARENT'.  " Must be upper-case
    wa_ptab-value = ref.
    INSERT wa_ptab INTO TABLE ptab.
    *   EXPORTING i_parent = container_r.
    CREATE OBJECT grid_r TYPE (str_gui)
      PARAMETER-TABLE ptab.
    SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE itab_saplane.
    * Cannot call set_table_for_first_display directly...
    CALL METHOD grid_r->(meth_name)
      EXPORTING I_STRUCTURE_NAME = 'SAPLANE'  " Type of the rows in the internal table  (UC!)
      CHANGING  IT_OUTTAB = itab_saplane.     " The internal table itself
    CALL SCREEN 100.
    Any help would be appreciated!

    Hi ...
    Apologies ... for confusion ... actually both are required ...
    the type 'E' as well as CL_GUI_CONTAINER.
    The below code worked for me ...
    check out how I cast it to the parent class type ...
      DATA : lv_container   TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
             lv_control     TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
             lv_method      TYPE string VALUE 'SET_TABLE_FOR_FIRST_DISPLAY',
             lt_par_tab     TYPE abap_parmbind_tab,
             ls_param       LIKE LINE OF lt_par_tab,
             lref_cont      TYPE REF TO cl_gui_container,
             lv_data        TYPE REF TO data.
    CREATE OBJECT lref_container
          TYPE
            (lv_container)
          EXPORTING
            container_name = 'ALV_AREA'.
        ls_param-name = 'I_PARENT'.
        ls_param-kind = 'E'.
        lref_cont ?= lref_container.
        GET REFERENCE OF lref_cont INTO lv_data.
        ls_param-value = lv_data.
        INSERT ls_param INTO TABLE lt_par_tab.
    **  Now create ALV Control.
        CREATE OBJECT lref_alv_ctrl
          TYPE
            (lv_control)
          PARAMETER-TABLE
            lt_par_tab.
    **  Set table for 1st display
        DATA : lv.
        lv = lref_alv_ctrl->mc_fc_print.
        CALL METHOD lref_alv_ctrl->(lv_method)
          EXPORTING
            i_structure_name = 'T001'
          CHANGING
            it_outtab        = lt_company.
    Cheers
    Edited by: Varun Verma on Aug 12, 2008 4:19 PM

  • Modbus register readings, double type Shared Variable 32000

    Hello
    I am new to labview and modbus and have been trying to communicate with a control card using the VIs in the standard modbus library in labview 8. This might be a very simple question, it relates to the output of the "read holding register" or "function code 0x03" . All the results I have been getting are in 5 digit decimal form, I have read in another post that this may be the "double type Shared Variable" and that it can be converted or typecasted to "ieee 754 type" i.e. as actual measurement values. I was wondering if it is possible for 5 digit "double type shared variable" that are greater than the 32000, i.e such as 50119 or 50294, to be converted to "ieee 754 type". Or even if there are standard methods that can perform this type of conversion in general.
    Thanks in advance

    Maybe this will help.
    http://forums.mrplc.com/index.php?showtopic=30
    http://www.simplymodbus.ca/FAQ.htm#Types
    What are data types?
    The example for FC03 shows that register 40108 contains AE41
    which converts to the 16 bits 1010 1110 0100 0001
    Great! But what does it mean? Well, it could mean a few things.
    Register 40108 could be defined as any of these 16-bit data types:
         A 16-bit unsigned integer (a whole number between 0 and 65535)
                        register 40108 contains AE41 = 44,609 (hex to decimal conversion)
         A 16-bit signed integer (a whole number between -32768 and 32767)
                                                            AE41 = -20,927
                  (hex to decimal conversion that wraps, if its over 32767 then subtract 65536)
         A two character ASCII string (2 typed letters)
                                                            AE41 = ® A
         A discrete on/off value (this works the same as 16-bit integers with a value of 0 or 1.
                                                  The hex data would be 0000 or 0001)
    Register 40108 could also be combined with 40109 to form any of these 32-bit data types:
         A 32-bit unsigned integer (a number between 0 and 4,294,967,295)
                                 40108,40109 = AE41 5652 =  2,923,517,522
         A 32-bit signed integer (a number between -2,147,483,648 and 2,147,483,647)
                                                           AE41 5652 = -1,371,449,774
          A 32-bit double precision IEEE floating point number.
          This is a mathematical formula that allows any real number (a number with decimal
           points) to represented by 32 bits with an accuracy of about seven digits.
                                                           AE41 5652 = -4.395978 E-11
          Here is a spreadsheet IEEE float calculator for inputs of 4 bytes or 2 words.
          To download a copy, right click and select Save Target As...
         A four character ASCII string (4 typed letters)
                                                             AE41 5652 = ® A V R
    More registers can be combined to form longer ASCII strings.  Each register being used to store two ASCII characters (two bytes).

  • Concatentating of variables issue - Getting Not a variable debugging.

    I'm building a insert statement based on a view I have by building
    while stepping thru a bulk collect. I'm Concatentating my 4 varibles to
    create a final sql statment that I want to use for Execute Immediate.
    However when Concatentating the four variables the last variables for some
    strang reason null out the variable.
    While debugging I see all 4 variables populated ok, I played with changing the
    variables lengths to see if that was the issue but I still have the issue.
    Any idea why I would get "not a variable" when Concatentating the final variable?
    Below is the Procedure with 2 lines showing the partial one that works and the
    full line that fails.
    CREATE OR REPLACE Procedure File_Load_Proc Is
    Type Fl_Tab Is Table Of File_Load%Rowtype Index By Binary_Integer;
    Recs Fl_Tab;
         ValCols Varchar2(1000);
         SelCols Varchar2(1000);
         SqlStatI Varchar2(200);
         SqlStatS Varchar2(200);
         FinalSql Varchar2(32767);
         v Integer;
    VMp# Map.Mp#%Type := Null;
    Procedure Get_Data
              Is
    Begin
    Select * Bulk Collect
    Into Recs
    From File_Load;
    End Get_Data;
    Procedure Perform_Insert
              Is
    Begin
    Null;
              --Execute Immediate FinalSql;
    End Perform_Insert;
    Procedure Process_FileLoad_Data
              Is
    Begin
    For Indx In 1 .. Recs.Count Loop
                        --First Record from Map
                             If Recs(Indx).RO# = 1 Then
                             If VMp# Is Null Then
                                       VMp# := Recs(Indx).MP#;
                                  Elsif VMp# <> Recs(indx).MP# Then
         v := Length(SqlStatI || Rtrim(ValCols,',') || ') ' || RTrim(SelCols,',') || SqlStatS);
    --This shows values the partial string values
         FinalSql := RTrim(SelCols,',') || SqlStatS;
                                            --When I add all the pieces to the sql statment the variable contains no data
    FinalSql := SqlStatI || Rtrim(ValCols,',') || ')' || RTrim(SelCols,',') || SqlStatS;
                                  Perform_Insert;
                                  End If;
                                  SqlStatI := 'Insert Into ' || Recs(Indx).SD_Into_Tb || ' (';
                                  ValCols := Null;
                                  SelCols := 'Select ';
                                  SqlStatS := ' From ' || Recs(Indx).SD_Select_Tb || ';';
                             End If;
                             ValCols := ValCols || Recs(Indx).SD_Name_Out || ',';
                             SelCols := SelCols || Recs(Indx).SD_Name_In || ',';
    End Loop;
                   --Insert last Map Records;
    FinalSql := SqlStatI || Rtrim(ValCols,',') || ')' || RTrim(SelCols,',') || SqlStatS;
         Perform_Insert;
    End Process_FileLoad_Data;
    Begin
    Get_Data;
              -- Loop Thru Records and build Insert Statements
    Process_FileLoad_Data;
    Commit;
    Exception
    When Others Then
    Rollback;
    Raise;
    End File_Load_Proc;

    This could be an artifact of whatever front end program you're using to debug.
    If I were you, I'd try adding debug statements (via your custom debug log package if you have one or via dbms_output.put_line if you haven't - not forgetting to set serveroutput on first *{;-) ) to record what each value was. That should help you to pinpoint what the issue might be.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Actual type of variable type in parameterized type

    Hi all,
    Is there way to find out what is actual type of the Variable type in Parameterized type, for example:
    class A<T> {
         //actual type of variable type T
         Class<T> tClass;
         public void setTClass() {
              // I don't know what should I do here
         public Class<T> getTClass() {
              return tClass;
         public static void main(String[] args) {
              assert((new A<Integer>().getTClass()).toString().equals("class java.lang.Integer"));
    Message was edited by:
    MjLaali
    Message was edited by:
    MjLaali
    Message was edited by:
    MjLaali

    yes ofcource I can't chenge the actual type of variable type T in run time, but I would like to get actual class of T in run time like this example :
    package test;
    import java.lang.reflect.ParameterizedType;
    abstract class B<T>{
         private Class<T> variableClass;
         public B() {
              this.variableClass = (Class<T>) ((ParameterizedType) getClass()
                        .getGenericSuperclass()).getActualTypeArguments()[0];
         public Class<T> getTClass(){
              return variableClass;
    class A extends B<Integer> {
         public static void main(String[] args) {
              assert(new A().getTClass() == Integer.class);
    but I don't want class A and I would like to move main method to class B.

  • Get all the variables declaration in a program

    Is there a possible way to get all the variables declarations ( name and type ) inside a java program and not only the fields that you can easily get with reflection mechanism but also local variables inside a method?

    Kayaman wrote:
    Jigsaw23 wrote:
    local variables inside a method?Nope, you'd have to get inside the call stack for that and there's no easy mechanism for that.Even that wouldn't do it, since not all code is on the call stack at all times. There are ways to do it, using bytecode engineering, but I'm not going to get into that because if you don't already know how to do it, I doubt you have a problem that genuinely requires it.
    It's a bogus requirement anyway. Whatever you're trying to do, OP, it's doomed to failure. What are you trying to do? I mean, what were you doing that led to you thinking "If I knew what those local variable were, I'd manage it!"?

Maybe you are looking for

  • Subtotal calculation display in ALV report

    hi, i had made a report n alv which is almost complete but i want to add the feature that when i click on a field when output is displayed den the subtotal of all qty fields should be shown also. plz provide me with useful example as i am using the c

  • Can I install windows 8 pro on my Yoga 13 ?

    Hello, I have a windows 8 pro version, and for proffessional raisons I want to install it on my yoga. It will not be a problem ? All drivers for this are available on download ?  Thanks Solved! Go to Solution.

  • Can I extend the scripting support through the SDK?

    I need to create an automated process of saving different layers from documents as different file formats. Unfortunately there is no scripting support for exporting to EMF-format, which I need to do. I glanced on the possibility of calling a self-def

  • Vendor master cannot copy to PO (sometimes)

    hi, When convering PR to PO in (MD04), Invoicing Party not found and need manual input.  The same issue found if input vendor code first during PO entry (ME23N).  But sometimes do not have this problem even using same vendor pls advice thanks

  • How to activate a TAB in the form

    hi all,          In my form 3 tab's are there....in each tab there is a matrix.Initially when the form opened tab 1 will be displayed.so in particular situation that is in validation point if null value is there in tab 2 means then the control should