How to dynamically change data type
Hi
Let say I have 1 byte in the folowwing hex format (1F )
Then if I say convert it to 24 bit then the number should become 1F 00 00 and if I say convert it 32 bit the number should become 1F000000
Could you please help me to implement this in LabVIEW ?
Thanks
Ah right, now I see why you mentioned dynamically changing the data type - LabVIEW is a strictly typed language which means you must end up with one of the numeric formats in LabVIEW (with 64-bits being the largest). If you're going to have more than 8 bytes, I'm not sure what the solution would be, if you're going to have 8 bytes or less then I would just assume the worst case and convert/fit the numbers into a U64.
Here's an example:
I am starting off with an empty U64, taking each input byte and shifting the U64 left by one byte and then adding the input byte.
I guess that leads to my next question - what are you going to do with the numbers? Would having an array of U8's or converting the bytes to a character string not be better? If you have a string or array these can have a dynamic length so you can more easily manipulate the data (e.g. by performing string/array indexing functions).
Certified LabVIEW Architect, Certified TestStand Developer
NI Days (and A&DF): 2010, 2011, 2013, 2014
NI Week: 2012, 2014
Knowledgeable in all things Giant Tetris and WebSockets
Similar Messages
-
Dynamically change data type of a field
Hello,
I'm trying to dynamically create a SQL statement which will insert record sin to my SQL data base.
I dynamically bring field name sand values. then concatenate them in a string and then Execute the SQL string in a native SQL eXEC statement.
It all worked fine till I used signle quotes for all field values.
but now I wante dto insert a field of type "Money" is SQL which is nothing but AMount/currency in SAP.
Now If I remove this quotes it is working fine. but If I have a negative number the "-" sign comes in the end in my abap code and gives a short dump in insert statement.
now I wante dto make that variable dynamic in to currency rather than String.
Please let me know how Can I change it dynamically.
EG: w_field_value = 3000.25- (value in SAP / w_field_value is of TYPE String)
Before I concatenate this , I wanted to change its type to AMOUNT ...
thanks.Just Use the field Symbols.
Regards
Rusidar S -
How to edit/change data type on report that was selected by mistake
Hello there
I created a report in APEX and one column is giving error because the data type of one column supposed to be a varchar2 but somehow the report was created with a Date data type. I want to change the data type without recreating the whote report. Can someone help? I tried to edit the report but couldn't be able to figure out.
HELP....I found a solution for this, thank you.
-
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 get changed data in ALV in Web Dynpro for ABAP
METHOD on_data_check .
DATA:
node_spfli TYPE REF TO if_wd_context_node,
node_sflight TYPE REF TO if_wd_context_node,
itab_sflight2 TYPE if_display_view=>elements_sflight.
node_spfli = wd_context->get_child_node( name = if_display_view=>wdctx_spfli ).
node_sflight = node_spfli->get_child_node( name = if_display_view=>wdctx_sflight ).
CALL METHOD node_sflight->get_static_attributes_table
IMPORTING
table = itab_sflight2.
this code is ..get all data(changed and not changed)
but i want get changed data only, not all data.
how to get changed data?
Edited by: Ki-Joon Seo on Dec 27, 2007 6:04 AMHi,
To get only the changed data in the ALV grid of a WD, you need to capture the "ON_DATA_CHECK" of the ALV grid.
To this please do the following in the ALV initialization of the ALV table settings :
lr_table_settings->set_data_check(
IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CELL_EVENT ).
You may also do this:
lr_table_settings->set_data_check( IF_SALV_WD_C_TABLE_SETTINGS=>DATA_CHECK_ON_CHECK_EVENT)
The above two ways would depend on when do you need to check for the changed data. If you want to check the data as soon as it is entered, then use the first method. Else, use the second method.
You need to register an EVENT HANDLER for this event.(You may do this in your VIEW or Component Controller).
In this Event handler, you would find an importing parameter R_PARAM which is a ref type of IF_SALV_WD_TABLE_DATA_CHECK.
The attribute T_MODIFIED_CELLS of this interface IF_SALV_WD_TABLE_DATA_CHECK will contain the modified cells of the ALV with the old & new values. -
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 PMhi,
you can use get_item_property built-in
eg:
declare
l_item VARCHAR2(10);
begin
l_item := Get_Item_Property('item_name',DATATYPE);
end; -
How to use same Data Type and Length for two fields
How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
FROM bsik
INTO TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr IN s_lifnr.
IF it_bsik IS NOT INITIAL.
SELECT belnr gjahr awkey awtyp
FROM bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_bsik
WHERE belnr = it_bsik-belnr
AND gjahr = it_bsik-gjahr.
IF it_bkpf IS NOT INITIAL.
SELECT belnr gjahr lifnr xblnr
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-awkey+0(10)
AND gjahr = it_bkpf-awkey+10(4).
ENDIF.
ENDIF.
Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
Kindly clarify.Hi Saurabh,
Please see the example code that I have developed for you. It will help you solve the problem.
REPORT ZTEST_3 .
tables : BKPF.
data : begin of it_bkpf occurs 1,
belnr type RE_BELNR,
awkey type awkey,
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf.
data : begin of it_bkpf1 occurs 1,
belnr type RE_BELNR,
awkey type gjahr, " change the data type
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf1.
data : begin of it_rbkp occurs 1,
belnr type BELNR_D,
gjahr type gjahr,
lifnr type LIFRE,
xblnr type XBLNR,
end of it_rbkp.
select belnr
awkey
awtyp
gjahr
from bkpf
into table it_bkpf
where BUKRS = 'TELH'.
loop at it_bkpf.
it_bkpf1-belnr = it_bkpf-belnr.
it_bkpf1-awkey = it_bkpf-awkey+10(4). "Here only append the required length.
it_bkpf1-awtyp = it_bkpf-awtyp.
it_bkpf1-gjahr = it_bkpf-gjahr.
append it_bkpf1.
clear it_bkpf1.
endloop.
select belnr
gjahr
lifnr
xblnr
from RBKP
into table it_rbkp
for all entries in it_bkpf1
where belnr = it_bkpf1-belnr
This is just an example. Change the fields according to your requirement.
Regards
Abhii
Edited by: Abhii on Mar 9, 2011 9:08 AM -
How to dynamically changes items properties
How to dynamically changes items properties likes position order in tabular view, width, prompt
Many object properties can be set programmatically at runtime. For example, each window object has a Visible property that can be set to either Yes or No to show and hide the window. At runtime, you can call the built-in procedure SET_WINDOW_PROPERTY to show or hide the window dynamically, as shown here:
Set_Window_Property('my_window',VISIBLE, PROPERTY_ON);
The following built-in procedures are available for setting object properties at runtime:
- SET_BLOCK_PROPERTY
- SET_CANVAS_PROPERTY
- SET_FORM_PROPERTY
- SET_ITEM_PROPERTY
- SET_LOV_PROPERTY
- SET_MENU_ITEM_PROPERTY
- SET_PARAMETER_ATTR
- SET_RADIO_BUTTON_PROPERTY
- SET_RECORD_PROPERTY
- SET_RELATION_PROPERTY
- SET_VIEW_PROPERTY
- SET_WINDOW_PROPERTY
The built-in procedure SET_ITEM_PROPERTY can be used to set the properties of any type of item, including buttons, text items, check boxes, radio groups, etc.
Note: Radio group items include individual radio buttons; use SET_ITEM_PROPERTY to set the properties of the radio group, and SET_RADIO_BUTTON_PROPERTY to set the properties of the individual buttons in the group.
Each built-in SET procedure has a corresponding GET function that allows you to programmatically determine the current setting of an object's properties. The following example uses GET_WINDOW_PROPERTY to determine if a window is currently hidden (VISIBLE = FALSE). If the window is hidden, SET_WINDOW_PROPERTY is called to show the window.
If Get_Window_Property('my_window',VISIBLE) = 'FALSE' THEN
Set_Window_Property('my_window',VISIBLE,PROPERTY_ON);
To determine if a particular property can be set programmatically, refer to the property descriptions in online Help. -
Changing data types of fields in structures
Hello,
Currently we are working for upgrade to ECC 6.0 .
In some transactions we are using BAPI_MATERIAL_SAVEDATA to create material.
We have some additional fields in MARA and MARC table , which we fill using BAPI_TE_MARA and BAPI_TE_MARC structures.
In these structures we have different data types for fields earlier in 4.6C
Now this function module is only working if we change data types of fields in these structures only to char type. It is going for dump , if we maintain any other data type.
Could any body tell me why should we change for char data type ?
Regards,
SATYAHi,
Check enhancement category (Extras --> Enhancement Category) for structures before enhancement. For example, for BAPI_TE_MARA structure, enhancement category is given as character type or numeric type. That means you can add the fields of data type only C and N. No other data types are allowed. If you select as not classified then you can add any data type. This option plays important role while enhancement.
Regards,
Prasanth -
How to get change date in Production Order ?
Dear Friends,
I want to know it, how to get change date in Production Order "Administration-TAB".
F1-Help, It is displayed with "Change date for Order Master". and Structure table "CAUFVD".
But, CAUFVD is not Transp. Table.
Which table should I read ?
Thanks in advance
Yamazaki-HDear Friend
Thank you for an answer.
It was settled.
Best regards. -
How to add TIMESTAMP data type in Enterprise Architect...?
Hi all
There is no data type of timestamp in Enterprise Architech. There is only
DATE type. I have ERD prepared from Enterprise Architech. How to modify
DATE type to TIMESTAMP type.
How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
Thanks in advance,
PalHave you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
Justin -
How to avoid changing material type in MIGO & J1IEX ?
Dear all,
How to avoid changing material type in MIGO & J1IEX ?hii
i think u asking about the , if the material is excisable , then it will ask for material type , not all material type , onle like asset , raw material, consumable, non cenvatable , finished oods and tools.
There i hope its standard SAP system setting , because some time the if do consumable procurement with excisable material .
While doing Gr or J1IEX system will consider that material is capital item, that we cancahge to raw material and we can utilize the cenvate credit in the same year .
so it cannot be hide or making gray mode is difficult in practical.
So revert any clarification
Thanks -
How can I change dates to the UK format, DD/MM/YY, in Mac Numbers?
How can I change dates in Mac Numbers to the UK format of DD/MM/YY? When I correct them individually they automatically return to the US format.
Open System Preferences, then click the "Languages & Region" pane in the first row.
Change the Region from "United States" to "United Kingdom" -
If you use the WCF-SQL adapter it is recommend that you set UseAmbientTransaction to true if you are changing data. I think this requires MSDTC to be enabled on the SQL server that you are changing the data on. (http://msdn.microsoft.com/en-us/library/dd787981.aspx)
I think that Availability groups does not support MSDTC. (http://msdn.microsoft.com/en-us/library/ms366279.aspx).
How can you change data on a SQL 2012 application database that uses availability groups from BizTalk server?Hi,
Yes, Availability groups doesn't support MSDTC. Please refer to the similar discusison which maybe helpfull:
http://dba.stackexchange.com/questions/47108/alwayson-ag-dtc-with-failover
http://stackoverflow.com/questions/17179221/msdtc-in-always-on-availability-groups -
How to read XI Data type in Java code and populate as array list, using UDF
Hi,
How to read XI Data type in Java code and populate as array list, using UDF?
Is there any API using which the XI data types can be read?
Kindly reply.
RichaInput Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
<CUSTOMER>
<item>
<CUSTOMERNO/>
<MDMCUSTOMER/>
<CREATE_DATE/>
<RETURN>
<TYPE/>
<MESSAGE/>
</RETURN>
<PT_CONTPART_RETURN>
<item>
<MDM_CONTACT/>
<CONTACT/>
</item>
</PT_CONTPART_RETURN>
<PARTNERS>
<item>
<CUSTOMERNO/>
<PARTNER_FUNCTION/>
<PARTNER_NUMBER/>
<DEFAULT_PARTNER/>
</item>
</PARTNERS>
</item>
</CUSTOMER>
</ns0:CustomerCreateResp>
Output structure
(Sample output structure.This actually needs to be mapped and generated using UDF)
<?xml version="1.0" encoding="UTF-8"?>
<ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>
Maybe you are looking for
-
Blue screen of death with HDD Hardware Test error on iMac HELP!!
My iMac is not starting up. It just get the blue screen of death during startup. It is a 2.66 mghz duo with 2gb 800 ram. I was able to get the Hardware test to run and got an error of 4M0T/2/40000004: HDD-1560. I am assuming it is an error with t
-
Im sorry to ask this questioon, but am new to apple. Should i as recommended by apple buy and install intigo av, and can anyone advise me on Rapport as offered by the bank free of charge. Can anyone tell me how to increase the font size of the menu b
-
My iTunes is not allowing my ipod restore or update is there any way i could fix this problem?
Oce i forgot my ipod at a frineds hose and it randomly apears today and now im tring to restore it and give it the up dates but its not responding is says that there is a error or that network sever isnt working and i really don know what is happenin
-
[Solved] Installing Gnome
I've got Arch x86 running in the latest VirtualBox to limit the damage caused by my noobness. I'm stuck with installing gnome. Specifically the step where gnome-session is called. I've not done the exec steps after that. As a normal user: gnome-sessi
-
Hi all, I am trying to run full payroll for a single employee. I made an assignment set and ran PAYROLL PROCESS, PRE-PAYMENTS, PAYROLL ARCHIVE(everything went well). Now when I run CHECK WRITER and give the assignment set as one of the parameter, it