Can we change the data type of a field based on the value of the field

HI Gurus,
My Requirement is as below -- Could you please guide me
in the Printable Adobe form -- for ex - as usual for dates fields in the Object Pallette the object type is a date/time field  and for quantity/currency fields corresponding fields are taken
now in case the either the date, quantity or currency is initial in place of displaying 0.00 or empty date we need to display N/A (Not Applicable)
for this I would like to change the data type of the field
to put it simply --
we need to change the data type of date field from DATE&TIME to Char type to hold N/A or  Quantity field to Char field to hold N/A
how can we realize this in SAP adobe forms
Thanks in Advace
Ramchander Rao.K

Hello Ramchander,
     You cannot change the data type of the field at run time in Adobe forms because the type of field you choose at the time of design level is associated with the data type itself.
If you want to achieve your requirement, then your main idea should be to set the data type as CHARACTER itself while designing the field in the adobe form itself. CHAR field will comfortably hold the value of Calculation/amount field, Currency field, Amount, Date, Time HHMMSS, Unit Accuracy, Currency key, Floating point number, Numeric text, Client, Language and many other data types.
After designing the field as TEXT field in Adobe form you have two options.
Option 1:
Select the Date field initially as type TEXT field or CHAR field in Adobe forms.
Suppose the name of the field is TEXTFIELD1, then write the Javascript code on this field in Initialize event as below.
if ( this.rawvalue == null )
     this.rawvalue = "N/A";
If the field is not blank, then it will show the date. Else it will show "N/A".
Option 2:
Select the Date field initially as type TEXT field or CHAR field in Adobe forms. Do the formatting part in ABAP itself. It will increase the performance. Avoid Javascript as much as possible.
Suppose you have a DATE variable l_dats of type DATS. Then take another variable l_date of type CHAR. Then write the below ABAP code.
MOVE l_dats TO l_date.
IF l_date IS INITIAL.
     l_date = 'N/A'.
ENDIF.
Bind the l_date to the TEXT field in the form.
Even in this case, if the field is not blank, then it will show the date. Else it will show "N/A".
But I will suggest you to use Option 2 of keeping the AMOUNT, QUANTITY, DATE, TIME fields etc as CHAR or TEXT fields in Adobe form and do the required formatting in ABAP itself.

Similar Messages

  • Can't change column data type

    Hi, i am using Sybase IQ 16.0
    I have created a table, when I want to change one of the data type for a column for example from char to varchar, the list box is grey color and not allow me to change.
    Right click table > Properties > Columns > Data Type
    I have granted all permission for dba, but still not able to edit. (please see the attached file)
    Any help?
    Thanks.

    Hi Nelson.
    You can not change the datatype of an existing column.
    The doc reference is here: Altering Tables
    "After you create a column, you cannot modify the column data type. To change a data type, drop the column and recreate it with the correct data type."
    If you already have data in the column, you can try this:
    create the new column with a slightly different name
    copy the data in to the new column
    drop the original column
    rename the new column to the old column's name.
    --Kirby

  • The data type of "output column "Cookies" (7371)" does not match the data type "System.Int32" of the source column "Cookies"

    I have the following data flow:
    ADO Source
    Input Column: Cookies       ID: 7371      Datatype: DT_NUMERIC
    Output Column: Cookies     ID: 7391      Datatype: DT_NUMERIC
    DATA CONVERSION TASK
    Input Column: Cookies       ID: 1311     Datatype: DT_NUMERIC
    Output Column: Copy of Cookies   ID: 1444    Datatype: DT_I4
    SQL Server Destination
    Input Column: Copy of Cookies    ID: 8733    Datatype: DT_I4
    Output Column: Cookies       ID: 8323     Datatype: DT_I4
    This looks fine to me. Why am I getting the error?
    This is SQL Server 2008 and I am working at this point only in BIDS, so it is not a question of dev vs prod server or anything. One environment, running in BIDS. Other similar data flows seems to be working ok. It seems the error is referring to a datatype
    mismatch in the source--but how can that be?
    Thanks!

    Actually, I am wrong in that Visakh. I think you are correct.
    There are two versions of all tables, one with 15 minute rollups and one with daily rollups. Otherwise the tables are the same--same exact fields. I use a loop with a data flow inside to get data from one version of the rollup and then the other.
    The problem is, for some of the fields with larger values the datatype is NUMERIC instead of INTEGER. (This is Cache database). SO:
    dailyCookies:   Field: CountOne   Datatype:  NUMERIC
    15minCookies:   Field: CountOne   Datatype: INTEGER
    A variable dynamically creates the query so it appends "daily" or "15min" to the beginning of the tables. So on the first loop it does the 15min tables and on the second the daily tables. When I created this particular table I have to plug a default query
    in so I used the daily. It picked up the datatype as NUMERIC so when I run the package it loops through 15min first and sees the datatype is INTEGER.
    How to deal with this? I suppose I could convert the datatype in the source query, but that would be a hassle to do that for some fields and not others. This tables has hundreds of fields, BTW. Can one source object deal with a change of datatypes? SSIS
    is so picky on datatypes compared to other tools....
    Thanks,

  • What is the data type for the Data Dashboard XY Graph?

    Hey all,
    I am playing with the new Data Dashboard (!!) on my iPad 2 and am having trouble setting up the shared variables that host data to the XY Graph.
    On my PC, in my Project (inside of a variable library) I have set up shared variables for all of the other controls/indicators available in the app; They all work great. However, I have not been able to identify the data type that is for the XY Graph in Data Dashboard. Of course, inside LabVIEW, I use a cluster of 2 arrays; this is not an available data type that I can select while creating a new variable on the hosting side. I have even gone so far as to create a custom control from my XYGraph in LabVIEW and then creating the data type "From Custom Control..." with no success.
    What gives? Am I missing something obvious? Thanks for the help!!
    Tom
    Solved!
    Go to Solution.

    Great question, Aerogoob.
    The XY graph can be bound to a 1d array of "points", where each point is a cluster of two numerics (X and Y). To create a shared variable of this type, you can set the data type to "From Custom Control..." in the shared variable properties dialog. Of course, first you'll have to build the custom control of the correct type: array of cluster of two numerics.
    If any of that doesn't make sense, please post back and we can walk you through it in more detail.
    Also, just for completeness, the chart indicator can be bound to a scalar numeric or to an array of numerics. The graph indicator can only be bound to an array of numerics.

  • The Date type - a good practise

    I am new to JDBC and have some problem using the Date type. When I deal with DB, I use the java.util.sql.Date, otherwise, I use the java.util.Date. Somehow, I need to do the conversion between date and year, month, and day. For some reason, a result of the conversion is total wrong in some situation but not all. Any advise on a good practise of using the two Date typies?
    Thanks in advance.
    v.

    Just continue using the java.util.sql.Date instead of using the java.util.Date because the latter has a lot of deprecated methods. Try using java.util.Calendar to do your conversion between date and year, month, and day. Try using its setTime(java.util.Date) of the java.util.Calendar to set the current date. From there you can do the conversion. Don't attempt to convert the Date object you got from DB to java.util.Date. It's ok to use java.util.sql.Date for the Calendar.setTime() function since java.util.sql.Date is a subclass of java.util.Date.
    I hope this helps.

  • 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 can I read the data type of a field in an MS Access database

    I need to be able to determine if a field in an Access database is of a certain data type, and if it isn't, to change it to what it should be.
    I can't seem to find any way of reading the data type of any field in any table - can anyone give me a metod of getting this info?
    Thanks
    ..Bob

    Does <cfdbinfo> work for Access DBs?
    You might be better off asking this on a MS Access forum.  It's more of an Access issue than a CF one.
    Adam

  • How to change the data type of an item in administrator

    Hi,
    A summary folder was created. One of the item in the summary folder is a sum. That sum item was created in the business area (based on another item). I can't refresh that summary folder because it gives me an oracle error (Ora-12008 and Ora-01401 the value is too large for the column). The column that this item is based on is of data type Number(13). How can I fix this problem without changing the column's data type of the original table? I already tried altering the data type in the EUL table via TOAD.
    Thanks!

    You really don't need to sum the item before hand if you are going to create a summary!

  • 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.

  • Change the Data Type of a Standard Required Field

    Hello Experts,
    Need to know if is it possible to change the data type of a standard field. The field is marked as a required field.
    For example: If a standard field is an Object Picker and I would like to change it to a string field. Is it possible? How can I do it?!
    Many thanks,
    Igor Nakamura

    Hi Igor,
    Since you cannot hide a required field, what you can do is move the standard required field to someplace less noticable (like the bottom of the page) and then use a validation script to set it to some benign value.
    -Howie

  • The output of my mathscript node is not changing the data type ?

    hi
    iam attaching my .vi iam having problem that my math script function is not changing it data type in its output
    iam uisng labview 2009
    what reason it will be?/
    thanks
    Attachments:
    mathfunct.zip ‏4 KB

    First off, there is a dedicated mathscript forum that might be better to get your problems answered. (I see if I can have this thread moved from the LabVIEW board, else you can re-post over there.)
    I see the same problem that (1) the outputs have no datatype and (2) all datatypes are greyed out, so they cannot be selected manually. (The input is trivial, just wire something and it will adapt).
    I am not a text programmer, but I suspect that there is something wrong or incompatible with your code. I have not looked at the statements. Is this copied from an existing matlab program, for example?
    LabVIEW Champion . Do more with less code and in less time .

  • Can I modify the data type of a dynamic parameter?

    I am using CR2008 against an Oracle 11 db and have a report with dynamic parameters.
    One of the report sources is a custom view that selects all of the possible 'pay ending dates' where one of the fields from this view is used as the source for the dynamic parameter.
    The view performs a TRUNC on the date field in an effort to eliminate the TIME component.
    The problem is that the parameter definintion defaults to DATE/TIME (vs. just DATE). I'm wondering if there is any way to modify the data type of the parameter to be DATE only.
    I've searched several forumns but have not found anything.
    One solution I can think of is to have the custom view format the date field as a VARCHAR (sans the time component) which I assume would force the dynamic parameter data type to string, and then have the report perform a todate function on the value when applying the criteria.
    Anyone else have an idea? Just seems like CR should allow the developer to specify the data type- especially b/w Date and Date/Time, rather than make an assumption.
    Thank you in advance-
    emaher

    emaher,
    Here's what you can do:
    Leave the existing date column as it is in the view...
    Just add another column to the view that casts the the date as a VarChar data type and formats the date as you would like it to be.
    So now you'll have 2 date columns in the view... 1 that's still a date and another that a character string.
    Now for your parameter, use the date version as the parameter value and the text version as the parameter description.
    Be sure to set the "Prompt with description only" is set to true.
    This way the user sees the LoV in the desired format but there's not need to wrangle it back into a date for data selection.
    HTH,
    Jason

  • How to change the data type in the table ESLL for the field USERF2_NUM ?

    Hello Friends,
    I have a requirement in which one of the change is to convert the data type of the field 'USERF2_NUM' in the table 'ESLL'  from 'QUAN' to 'CHAR'. 
    How do i do it if i have an access to change it..........i think i should also check the impact of the change if done.
    Kindly tell me as my requirement starts with this small change.
    Regards,
    Rajesh Kumar

    Thanks for the reply Sowmya.
    I would like to know 2 things.
    1. Is it ok to change the data type of the field 'USERF2_NUM '  which is in the table ESLL. from quan to char.
    2.  The table ESLL  already has entries. if we change the data type from QUAN to CHAR what is the  effect on the existing entries of the table .
    Kindly reply me back.
    Thanks & Regards,
    Rajesh Kumar

  • Activation error while changing the data type of a field of a table

    hi friends,
    i am facing one problem while changing a data type of a field of a table.
    i just created one table(Yqm32) .i have assigned charcter data type to one field(ztotal_count) .now i want to change this charcter data type to numeric data type.
      while changing to NUMC data type activation error is comming as below.
    Table is not yet classified                           
    Field ZTOTAL_COUNT: Type change                       
      ALTER TABLE is not possible                         
    Structure change at field level (convert table YQM32) 
    Check on table YQM32 resulted in errors   
    Table YQM32 could not be activated                       
    (E- Structure change at field level (convert table YQM32)
    plz suggest.i need to change the data type from char to numc.
    Thanks & Regards

    Hi Pabitra......
    From the SE11 change the table as u wanted and then from menubar select
    UTILITIES--> DATABASE UTILITY
    It will open database utility
    there u select the Activate and adjust database button.
    then the database table will get adjusted.
    just try it once.........
    Suresh......

  • Any idea what this errorr means? the data type of the reference does not match the data type of the variable

    I am using Veristand 2014, Scan Engine and EtherCat Custom Device.  I have not had this error before, but I was trying to deploy my System Definition File (run) to the Target (cRio 9024 with 6 modules) and it failed. It wouldn't even try to communicate with the target. I get the 'connection refused' error.  
    I created a new Veristand project
    I added the Scan Engine and EtherCat custom device.
    I changed the IP address and auto-detected my modules
    i noticed tat Veristand didn't find one of my modules that was there earlier. (this week)
     So, i went to NiMax to make sure software was installed and even reinstalled Scan Engine and Veristand just to make sure.
    Now, it finds the module, but when i go to deploy it getsto the last step of deploying the code to the target, and then it fails.
    Any thoughts?
    Start Date: 4/10/2015 11:48 AM
    • Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
    • Initializing TCP subsystem...
    • Starting TCP Loops...
    • Connection established with target Controller.
    • Preparing to synchronize with targets...
    • Querying the active System Definition file from the targets...
    • Stopping TCP loops.
    Waiting for TCP loops to shut down...
    • TCP loops shut down successfully.
    • Unloading System Definition file...
    • Connection with target Controller has been lost.
    • Start Date: 4/10/2015 11:48 AM
    • Loading System Definition file: C:\Users\Public\Documents\National Instruments\NI VeriStand 2014\Projects\testChassis\testChassis.nivssdf
    • Preparing to deploy the System Definition to the targets...
    • Compiling the System Definition file...
    • Initializing TCP subsystem...
    • Starting TCP Loops...
    • Connection established with target Controller.
    • Sending reset command to all targets...
    • Preparing to deploy files to the targets...
    • Starting download for target Controller...
    • Opening FTP session to IP 10.12.0.48...
    • Processing Action on Deploy VIs...
    • Setting target scan rate to 10000 (uSec)... Done.
    • Gathering target dependency files...
    • Downloading testChassis.nivssdf [92 kB] (file 1 of 4)
    • Downloading testChassis_Controller.nivsdat [204 kB] (file 2 of 4)
    • Downloading CalibrationData.nivscal [0 kB] (file 3 of 4)
    • Downloading testChassis_Controller.nivsparam [0 kB] (file 4 of 4)
    • Closing FTP session...
    • Files successfully deployed to the targets.
    • Starting deployment group 1...
    The VeriStand Gateway encountered an error while deploying the System Definition file.
    Details:
    Error -66212 occurred at Project Window.lvlibroject Window.vi >> Project Window.lvlib:Command Loop.vi >> NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Connect to System.vi
    Possible reason(s):
    LabVIEW: The data type of the reference does not match the data type of the variable.
    =========================
    NI VeriStand: NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> NI VeriStand Engine.lvlib:Initialize Inline Custom Devices.vi >> Custom Devices Storage.lvlib:Initialize Device (HW Interface).vi
    • Sending reset command to all targets...
    • Stopping TCP loops.
    Waiting for TCP loops to shut down...
    • TCP loops shut down successfully.
    • Unloading System Definition file...
    • Connection with target Controller has been lost.

    Can you deploy if you only have the two 9401 modules in the chassis (no other modules) and in the sysdef?  I meant to ask if you could attach your system definition file to the forum post so we can see it as well (sorry for the confusion).  
    Are you using any of the specialty configurations for the 9401 modules? (ex: counter, PWM, quadrature, etc)
    You will probably want to post this on the support page for the Scan Engine/EtherCAT Custom Device: https://decibel.ni.com/content/thread/8671  
    Custom devices aren't officially supported by NI, so technical questions and issues are handled on the above page.
    Kevin W.
    Applications Engineer
    National Instruments

Maybe you are looking for