How do determine data type?
I am trying to write my own binary file saver and I need to list the data type in the custom header. How do you do this in labview?
kameronrausch wrote:
The data acquistion spits out data in several different formats so a priori, I do not know the data type. It can be either a 32-unsigned int, 16-bit unsigned int, 8-bit unsigned int or the signed version of each one of these. To make the program general purpose however, I would like to incorporate floating point data points as well.
At some point you have to know what the data type is before start collecting data. If all you have is a stream of bits there is no way to determine what the data type is. What controls how the data acquistion is getting its data? If it is test specific you could use an external configuration file to store this and use that to determine how the data should be interpreted. If you have arrays of specificdata types you could use a polymorphic VI for your data writes. Based on teh wire type of the input the appropriate VI would be called. How is your data being passed from your data acquistion to the VI that will write it to a file?
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Similar Messages
-
How to determine data type of cell in Excel file
I have a company standard Excel file that needs to be read to determine what tests to run. I have no control over its format. I need to be able to tell what the data type is in order to read it using the LabView sample code. It is a hodge poge of numbers and strings. Some of the numeric fields are formated as hex while some are floating point. There does not appear to be a vi that I can call to determine info about the cell formating. As I remember it, the Windows Active X control for accessing Excel support that. I really was hoping to avoid dealing with the Active X control for Excel directly.
Any help/ideas?
Outputting it in CSV or similar is not an option.
Solved!
Go to Solution.If you have to deal with Excel directly, I don't see how you're going to get around using Active X.
MSDN page on using ActiveX -
Hi all,
I've got procedure for inserting data into value1 column of table1.
My need is to determine data type entered by user.
If data type is not number then user should receive error.
How do I perform it?The easiest and most reliable way would be to declare the formal parameter as a number like:
SQL> create procedure p (p_num in number) as
2 begin
3 null;
4 end;
5 /
Procedure created.
SQL> exec p('a');
BEGIN p('a'); END;
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 1If you cannot do that, or want to be more "user friendly", then the only alternative is to test it and raise an error like:
SQL> create procedure p (p_str in varchar2) is
2 l_num number;
3 begin
4 l_num := to_number(p_str);
5 exception
6 when value_error then
7 raise_application_error(-20001, 'I know I said it was a string, but I really want a number');
8 end;
9 /
Procedure created.
SQL> exec p('a');
BEGIN p('a'); END;
ERROR at line 1:
ORA-20001: I know I said it was a string, but I really want a number
ORA-06512: at "OPS$ORACLE.P", line 7
ORA-06512: at line 1John -
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 -
How to change data type of attribute in caf
hi.
this is my problem.
i been added a attribute in an entity service called emloyee. named "Birthday", use the data type "com.sap.caf.core.date".
when i tried modify the entity service, i hit exception about "DST Daylight Saving Time".
because of DST, the date will add an hour such like "1957/04/01 00:00:00.0" to "1957/04/01 01:00:00.0", and com.sap.caf.core.date will throw an exception.
is anyone had same problem like me?
how to fixed it(if passable)?
and, how to change data type?
thanks.Hi Sruthi,
all you need to do on this is open the report go to the parameters, select the parameter that you wish to change and click "Edit". This will allow you to change thefield to a date rather than a date time.
Regards,
Noel -
How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java
How to determine IE type(32 bit or 64 bit) in a task sequence
Hi,
Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007.
we have both 32 bit and 64 bit browser in the environment. I am stucked in determining whether the browser is of 32 bit or 64 bit.
How to determine IE type(32 bit or 64 bit) in a task sequence so that respective java can be installed for that IE browser.
will highly appreciate quick response.
Thanks in advance.
DayaBut you also need to install JRE x86 on x64 systems, since most people actually use the 32bit browsers on x64 systems.
The detection logic is actually pretty simple -- just check the right registry hive to find the installation location of the BIN\JAVA.DLL. Both pathnames are stored in HKLM\Software\JavaSoft\Java Runtime Environment\1.7 in the registry value "JavaHome",
but the x86 path is stored in the 32-bit hive and the x64 path is stored in the 64-bit hive.
Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
SolarWinds Head Geek
Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
http://www.solarwinds.com/gotmicrosoft
The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds. -
How to crete data type from XSD
Hi All,
can anyone tell me ...how to create data type from agiven xsd.
I need urgently....
thanks in advance....import this XSD, load this in your mapping editor and then use this to crate the datatype manually.
Or, use XML spy, load this XSD and then you should be able to see the Structure, or,
Look into the XSD data and decipher things yourself
Regards
Bhavesh -
How to check data type of the field symbol at run time
Hi,
My code is as following:
LOOP AT <fs> ASSIGNING <wa_covp_ext>.
ASSIGN COMPONENT 86 OF STRUCTURE <wa_covp_ext> TO <f_zzname>.
IF sy-subrc = 0.
ASSIGN COMPONENT 158 OF STRUCTURE <wa_covp_ext> TO <f_pernr>.
IF sy-subrc = 0.
SELECT SINGLE sname INTO <f_zzname> FROM pa0001
WHERE pernr = <f_pernr>
AND endda GE sy-datum
AND begda LE sy-datum.
ENDIF.
ENDIF.
ENDLOOP.
This query is giving dump when <f_zzname> is type P length 8 and decimals 2, because it tries to put PA0001-sname into it which is type C length 30. So I want to check the type of <f_zzname> before the select statement. If it is character 30, then I will write the select statement else not.
How to check data type of the field symbol at run time? If it's not possible, then can somebody suggest a workaround? Thanks.check this ...
write describe statement ...
field-symbols : <f_zzname> .
data : sname like pa0001-sname,
typ(10).
assign sname to <f_zzname>.
describe field <f_zzname> type typ.
write : typ. <-- typ contains character type in this case ..
U can check if typ is of character(C) if so .. write the select statement ... -
Need to determine data type of free characteristic in multiprovider
Hi,
I need to determine the data type (e.g. numeric vs alpha numberic) of a free characteristic in a multiprovider. Can this be accomplished in BEx Query Designer?
If not, can it be accomplished in RSA1? How?
Thanks,
Kevinits not possible via Query designer..
give that object name if it is infoobject then you can get via RSD1 -
Determining data type of existing column in table
Hi
I've done some googling on this, and I know I've done it before, but i cant find/remember how to determine the data type of a column in an existing table..... i tried select dump(column_name) from table but it didnt work.
any suggestions?
Thanks in advanceHi try this
SQL> select data_type from user_tab_columns
2 where COLUMN_NAME='EMPNO'
3 and table_name='EMP';
DATA_TYPE
NUMBER -
How to determine itab type at run time
I need to write a subroutine that organizes data in internal tables for presentation by a smartform. There are a few similarly structured internal tables all with the same field name ("recipe_type") by which the data is sorted. My problem is that how I can determine the type of the itab inside my subroutine at run time? Is it ever possible in ABAP?
The subroutine code is attached below. Thanks for any help.
FORM beautify_itab TABLES itab_in TYPE table
USING v_type TYPE any
CHANGING itab_out TYPE table.
Data declaration
DATA: v_data_row LIKE LINE OF itab_in, " THIS WON'T COMPILE!
v_blank_row LIKE LINE OF itab_in. " blank row
Organize the display of the table data
LOOP AT itab_in INTO v_data_row.
IF v_type <> itab_in-recipe_type. " 'recipe_type' is the sort key for the incoming itabs
v_type = itab_in-recipe_type.
IF sy-tabix > 1.
APPEND v_blank_row TO itab_out.
ENDIF.
APPEND v_data_row TO itab_out.
ELSE.
CLEAR v_data_row-recipe_type.
APPEND v_data_row TO itab_out.
ENDIF.
ENDLOOP.
ENDFORM. "beautify_itabThe following code does what I want, but only if the input itab structure is declared first in the program. It won't work if the itab is declared as itab_in TYPE TABLE OF sflight. This is because the function 'GET_COMPONENTS_LIST' only can load the structure of a field declared explicitly in the program. Does anybody know of any method to load the structure of an itab based off a dtab?
Thanks you guys for answers. Points have been rewarded.
*& Report Z_GET_ITAB_TYPE_AT_RUN_TIME
REPORT z_get_itab_type_at_run_time.
DATA: BEGIN OF itab_in OCCURS 0,
seatsocc_b LIKE sflight-seatsocc,
fldate LIKE sflight-fldate,
END OF itab_in,
itab_out TYPE TABLE OF string,
wa_itab_out TYPE string.
SELECT seatsocc_b fldate
INTO TABLE itab_in
FROM sflight
WHERE carrid = 'AA' AND
connid = '0017'
ORDER BY seatsocc_b.
PERFORM beautify_itab
TABLES
itab_in
USING
sy-repid
'itab_in'
'SEATSOCC_B'
CHANGING
itab_out.
LOOP AT itab_out INTO wa_itab_out.
WRITE: / wa_itab_out.
ENDLOOP.
*& Form beautify_itab
text
-->ITAB_IN text
-->V_KET_FIELD text
-->ITAB_OUT text
FORM beautify_itab TABLES itab_in TYPE table
USING v_prog_name LIKE sy-repid
v_itab_in_name TYPE any
v_key_field_name TYPE rstrucinfo-compname
CHANGING itab_out TYPE table.
DATA: itab_fields TYPE TABLE OF rstrucinfo,
v_field_name LIKE rstrucinfo-compname,
v_old_key TYPE string,
v_field_value TYPE string,
v_data_line TYPE string,
v_tabix LIKE sy-tabix,
c_blank_row TYPE string VALUE ''.
FIELD-SYMBOLS: <fs_field>,
<fs_data_line>,
<fs_field_list> TYPE rstrucinfo.
gets all of the components of a structure
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = v_prog_name
fieldname = v_itab_in_name
TABLES
components = itab_fields.
LOOP AT itab_in ASSIGNING <fs_data_line>.
v_tabix = sy-tabix.
LOOP AT itab_fields ASSIGNING <fs_field_list>.
v_field_name = <fs_field_list>-compname.
ASSIGN COMPONENT v_field_name OF STRUCTURE
<fs_data_line> TO <fs_field>.
v_field_value = <fs_field>.
IF v_key_field_name = v_field_name.
IF v_old_key <> v_field_value.
v_old_key = v_field_value.
IF v_tabix > 1.
APPEND c_blank_row TO itab_out.
ENDIF.
ELSE.
CLEAR v_field_value.
ENDIF.
ENDIF.
CONCATENATE v_data_line v_field_value INTO v_data_line
SEPARATED BY space.
ENDLOOP.
APPEND v_data_line TO itab_out.
CLEAR v_data_line.
ENDLOOP.
ENDFORM. "beautify_itab -
How to determine employee type (management vs nonmanagement) in WebDynpro
Hi,
I am running SP14.
In my WebDynpro application, I need to hide/show a link based on if the employee is management or nonmanagement.
What is the easiest way to determine the type of employee in a WebDynpro? Is the management/non-management attribute already exposed and available to the WebDynpro? Or do I need to invoke a BAPI/RFC to retrieve that information from SAP (eg Employee Group or Personnel Area)?
Thanks for any help you can provide.
KevinYou only need to call this RFC once and share the results with other views via context binding!
In my applications I follow the Floorplan manager architecture and have one web dynpro component for all the frontend logic e.g. FcAddress
In the component controller of FcAddress I setup model nodes for the RFC e.g.
Address_Input (mapped to input RFC model class with all the import parameters of the RFC)
Address_Output (mapped to either the output RFC model class with all the export parameters of the RFC or it includes another model node for Address_Records which is mapped to the export table parameter.)
Address_Messages (mapped to the return parameter of the RFC (BAPIRET2).
All other views with their component controllers are mapped to those model nodes to allow access to the RFC data.
You can pass the userid to the RFC and then the RFC will get the related employee number via IT105/ST10. You just need to have the userid defined as an import parameter in the RFC. -
Determine data type of string field
I am trying to determine the data type of input strings in a data flow task. For each column in the input (all of which are strings) I want to sample X number of records, try to cast them as money, date, boolean, etc and if 100% of X records pass then
use the first data type that passes the test. I looked into row sample but this doesn't appear to be the right data flow task. Can anyone point me in the right direction?
Thanks!You have two tasks: find the datatype by looking at X rows; cast all rows to the popular datatype.
What I use is the TryParse method that occurs on several datatypes in .Net (http://msdn.microsoft.com/en-us/library/f02979c7(v=vs.110).aspx). It returns true if it parses
and false if it doesn't. I have used this in a profiling package that reads a CSV and stores counts of values that can be converted to different datatypes.
The second piece is trickier. If you can afford, I would add a second dataflow. The first dataflow looks at a sample of the data and determines the datatype. You assign that to a variable. Then the second one has a derived column that has
a set of derived columns, each with a formula like this:
@DataType == "Int"?(DT_I4)[Column]:NULL(DT_I4)
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
How to change data type of input parameter
Hi
In my procedure i declared the data type of "Value Date" Input parameter as Date where as in CR it is showing data type as "Date Time". Can any one please specify how to change to Date.
While prompting for input parameter in description it is showing message as
Please enter Date time in format"yyy-mm-dd hh:mm:ss" . To change the content selected "format field" option. But is there any way to change input parameter data type.
Please suggest how to change.
Thanks SruthiHi Sruthi,
all you need to do on this is open the report go to the parameters, select the parameter that you wish to change and click "Edit". This will allow you to change thefield to a date rather than a date time.
Regards,
Noel -
How to determine the type of the jobject... similar to instanceof
hi,
I would like to know how to determine the jobject reference of an instance is of which class.
this is something similar to instanceof we use in java.
is there any thing like 'instanceof' in JNI. if there how to use it?
i got this as objective question for which answers were(i do not remember exactly)
1.instanceof
2.assignedto
i could nt het much help in googling.
thanks in advanceHi
The JNI provides a native version to the java instanceof operator, this function takes two arguments
an object refrence and a class refrence and reports JNI_TRUE.
jclass myclass = env->FindClass("your class name");
if(env->IsInstanceOf(obj,myclass) == JNI_TRUE)
// obj is of type myclass
}Regards
pradish
Maybe you are looking for
-
Security popup accessing applet with https
I have a website that serves everything over https. One of the things being served is an applet. I've found that just before the first request is made for the applet's .class files, I get a popup from the Java plug-in saying: Warning - Security The w
-
Why use Class.forName() ?
Why is it always adviced to use Class.forName( nameOfTheDriver ). Why dont we simply import the driver via the import statement ? Please note that this topic is part of a bigger topic I published in Java programming about difficulties I had importing
-
LDAPRealmV2 using group members as entries
Hi all, we have configured our ldaprealm v2 (wls 6.1) to have group members as entries below the group as opposed to the normal setup with group members as attributes of one group. This has imposed some strange problems. We have several groups mapped
-
Error for maintaining parallel currency
hi all, while posting the transaction in f-43 the error is: Ledger is not created for currency type 60 and valuation 0 Message no. GI814 Diagnosis You activated (in FI-SL customizing) currency and valuation type 60 in company code 1818. In order to
-
Hi, I have two r3 systems running on two different servers but they share the same network.I am trying to configure (Two system landsacpe ie,DEV--> PROD tms configuration).Having said that, i followed the guide lines from help.sap.com to configure..b