Setting a default initial value to a CHAR type field in a custom table

Is it possible to set a default initial value to a field in a customer table(Ztable) that is not SPACE?  SAP sets the initial value to " " space for datatype CHAR.
I am looking at creating a field in a table that would always default to 'X' on creation of a new row.
Your response is appreciated..

Hi,
I believe this cannot be done..
If you are inserting the row through a program then you can insert the field value to be 'X'.. If the value is not passed ..Then it will be blank..
If you are using table maintenance then in the PAI ..you can insert values..
Thanks,
Naren

Similar Messages

  • Data truncation when using resultset.getString() to a char type field

    In my table ,there is a char type field,such as a char(4) field, for multilanguage use,I put two "double-byte" character in it,
    when I using resultset.getString() to this char type field,I can't get the right result,one char was truncated, so I only get three char, for "double-byte" it 's error code
    this only happen on IBM JVM on AIX 5 , when I use oracle jdbc on windows hotspot vm , it works fine (we use the same oracle on AIX)
    is there any further setting for JDBC driver on AIX ? but it 's thin driver
    and the varchar type works fine at any paltform
    any help ?

    Hi jul!!!
    write like this:
    DATA : wa_flight_data TYPE bapisfldat,
    wa_add_info TYPE bapisfladd,
    wa_availability TYPE bapisflava,
    it_ret TYPE STANDARD TABLE OF bapiret2,
    wa_ret TYPE bapiret2.
    PARAMETERS : pa_carr TYPE sflight-carrid,
    pa_conn TYPE sflight-connid,
    pa_date TYPE sflight-fldate.
    CALL FUNCTION 'BAPI_FLIGHT_GETDETAIL'
    EXPORTING
    airlineid = pa_carr
    connectionid = pa_conn
    flightdate = pa_date
    IMPORTING
    flight_data = wa_flight_data
    additional_info = wa_add_info
    availibility = wa_availability
    TABLES
    *EXTENSION_IN =
    *EXTENSION_OUT =
    return = it_ret.
    write : / 'Flight Data: ',
    wa_flight_data-AIRLINEID,
    wa_flight_data-AIRLINE,
    wa_flight_data-CONNECTID,
    wa_flight_data-FLIGHTDATE,
    wa_flight_data-AIRPORTFR,
    wa_flight_data-CITYFROM,
    wa_flight_data-AIRPORTTO,
    wa_flight_data-CITYTO,
    wa_flight_data-DEPTIME,
    wa_flight_data-ARRTIME,
    wa_flight_data-ARRDATE,
    wa_flight_data-PRICE,
    wa_flight_data-CURR,
    wa_flight_data-CURR_ISO.
    similaryly for wa_add_info and wa_availability.
    becoz u r using work area directly in WRITE statement and
    wa_flight_data TYPE bapisfldat,
    wa_add_info TYPE bapisfladd,
    wa_availability TYPE bapisflava,
    contains both int and char data so u can print all of them together..They can be printed field by field.
    if any doubts..let me knw.
    hope it helps.
    kindly rewrd.

  • To replace values of one of the field in the database table

    How to replace values of one of the field in the database table with a new values? Pls help to solve

    Hi
    You can use the UPDATE command to update one of the field value in a table
    see the UPDATE syntax and use it
    but in real time you should not do like this
    Regards
    Anji

  • How does the value filled in Appointment Date field reflect in IE_SHIPMENTSTATUS table?

    Hi Team,
    Just wanted to know : How does the value filled in Appointment Date field reflect in IE_SHIPMENTSTATUS table in OTM.
    Please help.
    Regards,
    John

    Sorry, wrong forum: created in ABAP forum instead.

  • Default initial value for opportunity field

    Hi all,
    What is the fastest and most elegant way to achieve this requirement:
    When user clicks create opportunity the field "Relevant for forecast" should be default unflagged. Currently it defaults it to be flagged. It should only happen at creation time. The user should be able to flag the field again before saving. So basically I need to make sure that the defaulting is only done once in the lifetime of an opportunity (i.e. at the very first creation).
    Br,
    Anders

    Hi,
    1) Enhance your component
    2) Enhance view "BT111H_OPPT"
    3) Generate GETTER/SETTER for "STRUCT.FORECAST_REL" in context node "BTOPPORTH"
    4) Add the following code at the end of the method "GET_FORECAST_REL"
    IF value IS INITIAL.
    * value = 'X'  -> to check the checkbox if initial
    value = ''.
    ENDIF.
    This should work, but I have not tested it in this case.
    Kind regards
    Michael

  • Possible to set a default column value to an expression?

    Hi,
    Is it possible to set a default column name to an expression when creating a table?
    For example, I wish to set the default value of a column to read from another table's column and do some arithmetic....is this possible?
    Thanks.

    Yes, you can, with trigger Before Insert for Each row
    But be carefull, you can hit the mutating table problem...

  • How to set a default integer value in a form

    I have a form defined as follows:
    =================================================
    public static class ProjectForm extends FormData
    private int idx;
    private String name;
    private String projectNumber;
    private String description;
    public void setIdx(int index)
    this.idx = idx;
    public int getIdx(){
    return this.idx;
    public void setName(String name)
    this.name = name;
    public String getName()
    return this.name;
    public void setDescription(String description)
    this.description = description;
    public String getDescription()
    return this.description;
    public void setProjectNumber(String projectNumber)
    this.projectNumber = projectNumber;
    public String getProjectNumber()
    return this.projectNumber;
    ======================================================
    When I add a new entry into the database, I have no issues. However, when I want to modify an entry I run into some issues with the idx entry. For some reason, I cannot set a default value into the netui:label tag. My jsp code is as follows:
    ===================================================
    <tr valign="top">
    <td>
    Index:
    </td>
    <td>
    <netui:label value="{actionForm.idx}"
    defaultValue="{pageFlow.project.idx}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    Name:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.name}"
    defaultValue="{pageFlow.project.name}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    ProjectNumber:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.projectNumber}"
    defaultValue="{pageFlow.project.projNum}"/>
    </td>
    <tr valign="top">
    <td>
    Description:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.description}"
    defaultValue="{pageFlow.project.description}"/>
    </td>
    </tr>
    ======================================================
    The the project class is passes into the page and has the appropriate values. The name, project number and description fields work as I would expect. However, the idx value is alway '0'. If I print out pageFlow.project.idx it has the correct value.
    How do I fix this? My feeling is that it is related to the form field being an int and not a string. The default parameter indicates that is only works with null values, and ints default to zero. Do I need to use an Integer value instead in the form, or just stay away from non-string form fields.
    Thank for the help!!
    --John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In the action which displays the edit page just set the form idx value before displaying the jsp.

  • How to set the default context value for flexfield in OAFramework pages

    Hi,
    I have a page which contains a contexxt value field i.e Flexfields
    To select the context value we have to select the value from drop down
    So Here we want to display the context value immediately when the page is called
    How to set the default valu in this case
    Regards,
    Krishna

    You can set the Attribute category view attribute to the Flexfield context value and call prepareforRendering in the flex bean. Check the dev guide for details.
    Regards
    Sumit

  • Setting Up Default DB Values

    ive just started using cold fusion this week and im making a
    product and delivery website,
    i have all the user inputs for the DB working
    but i dont know how to set up default values for non-user
    input fields
    please help me out, thanks in advance :)

    You just need one SET and sing the product_id filed is
    probably an integer you don't need the single quotes around it:
    <cfquery name="set_deli" datasource="#prm_DB_DSN#">
    UPDATE tblpmdmstproduct
    SET deli_cool_flag = 1 ,
    deli_express_flag = 1
    WHERE product_id = #product_id#
    </cfquery>
    Ken Ford
    Adobe Community Expert
    Fordwebs, LLC
    http://www.fordwebs.com
    "balote" <[email protected]> wrote in
    message news:et8ii7$17u$[email protected]..
    > thanks for the reply
    >
    > ive actually made it work using an UPDATE query but its
    displaying an error on
    > the webpage even though database was properly updated.
    >
    > this is my source code
    >
    > <cfquery name="set_deli"
    datasource="#prm_DB_DSN#">
    > UPDATE tblpmdmstproduct
    > SET deli_cool_flag = 1
    > SET deli_express_flag = 1
    > WHERE product_id = '#product_id#' <!--- this is the
    part that is highlighted
    > in the error, by the way the value for '#product_id#' is
    generated on the same
    > session i think this is what causing the error --->
    > </cfquery>
    >
    > i have tried using cfparam as well but i think its a bit
    too advance for me
    > right now, didnt get any correct results nor errors :))
    >

  • Setting a default date value for input controls

    Hi All,
    I have created a webi report that shows  - among other things - the activity between 2 dates. I have created 2 input controls where the user can select the start and end dates from a calendar for this.
    The displayed data is restricted by a date variable which 'unfiltered' contains 1 month of data.
    'out of the box' I can set these input controls and all works fine, but each time I open the report the same values that I set last time are set in the input controls. I want to have these default to being between today and 7 days ago with the user then able to move away from  this action, rather than the 'window of interest' slowly slipping into the past.
    I have looked at the forum posting Re: Default Input Control Values in WebI doc on Open which describes setting a default on the objects in the report filter pane, but this does not appear to be possible as these are 'grayed out' and i need both the input controls to run from a single object.
    Does anyone have any ideas how this might be achieved?
    Thanks in advance
    John

    Hi,
    Sorry, I've obviously not explained myself very well. Please let me try to elaborate...
    The report I am writting is to function as a dashboard (yes, i know - Xcelcius/Dashboard Designer - don't ask!) but asking the user to enter a prompt for the date range is not an option here. My only options for this are effectively the input controls or the report filters. I want to be able to achieve the effect of entering =CurrentDate() in the 'default value box in the same way that I would if writting a Reporting Services report. However the WebI controls do not accept expressions for this.
    So...
    I have one date object with a months worth of dates in it.
    I have two input controls associated with this date object to allow the user to select a narrowed date range from this month of data.
    I need one of these to default to 'today' and the other to default to '7 days ago' (I can do the calculations to get both dates, the bit I cannot get past is applying these dates as defaults)
    can anyone help me with step 3 (in bold) above?
    John

  • How to Add Values in INVOICE SUB-TYPE field at the Invoice Header Forms

    Hello,
    Does any body knows how could I add/modify values in the INVOICE SUB-TYPE field at the Invoice Header Forms?. This values are related to the Globalization, in this case for the Chilean Localizations.
    Thanks,
    Alejandro R.

    It gives any error or just does nothing?
    Have you tried making another simple form with just one block and one or two items?
    You can do this type of testing in these conditions.
    Which version of forms are you using?

  • Is there a way to set the default Initial View to Bookmarks Panel and Page on word documents that I save as PDF?

    When I save my word 2013 documents as Adobe PDF I have to open the PDF up, go to File>Properties>Initial View>Navigation Tab and then set the initial view as Bookmark Panel and Page; it gets pretty tedious.
    I use Save as Adobe PDF rather than Print to Adobe PDF Printer because I like being able to have the security settings automatically set.
    I just want to be able to save my word document as Adobe PDF with the initial view already set as Bookmark Panel and Page, and with security, so I can send it out immediately.
    Is this possible?
    Thank you.

    Use the Firefox Android Addon - Phony
    *https://addons.mozilla.org/en-US/android/addon/phony
    for more
    *https://addons.mozilla.org/en-US/android/

  • How to set a default date value

    I have this input field in a popup window, but can not get it to show a default value.  Any ideas?
    <cfinput type="datefield" name="blockDatePOP" id="blockDatePOP" value="#NOW()#" required="yes" message="You must enter a block date" mask="d mmm, yyyy"   />
    Thanks,
    Darrin

    Maybe you should post your entire code for the page and the popup window.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/
    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
    GSA Schedule, and provides the highest caliber vendor-authorized
    instruction at our training centers, online, or onsite.
    Read this before you post:
    http://forums.adobe.com/thread/607238

  • BPEL : Setting the default start value for instance ID

    The instance ID for the processes are generated by the system, is it possible to set the starting value for the instance id. for eg: when I deployed a new process on a fresh installation and created an instance through BPEL console, it created a new instance with instance ID #1.
    Is it possible for me to start the value from a different number say "5000"

    Hi ashutosh,
    I think you can achieve this by writing a small java code in this Java Embedding activity.
    For using Java Embed in BPEL, you can refer to the following blog:
    http://technology.amis.nl/blog/?p=2387
    Cheers,
    Abhi...

  • How to set locking for all values of a char other than using query

    Hi Friends,
    any suggestions?  I like to explicitly lock all possible values of a particular characteristic in a cube without using a filter.
    thanks!!
    Cran
    Edited by: Cranberry CranCran on Jan 31, 2008 4:48 PM

    If you dont restrict the characteristic using any value in the filter, then all values will be locked.

Maybe you are looking for