How to maintain default values for custom table fields --  Urgent

Hi all,
I've a requirement wherein i need to create a Z table (with maintainence view) in which i'll have date and time as two of its field which should have current date and current time as default value. Can somebody suggest as how am i to maintain the date and time fields defaulting to current date and current time.
Incase if someone is unable to intrepret what i'm trying to say, please query me, i'll elaborate it further.
Please give in your quick inputs which is highly valuable to me and also will be highly appreciated.
Thanks in advance,
Vaishnavi Varadarajan

We have a following custom table which contains the fields “Date on which record was created” and “Name of the person who created the object”. We would like to have these to be filled up with SY-DATUM and SY-UNAME respectively.
Using the events, we can achieve this.
Please refer the following link:
http://abapliveinfo.blogspot.com/2007/12/events-in-table-maintenance-in-sap.html
Also,
Write a form routine in table maintanance generator.
1. SE11 > utilities > table maintenance generator
2. environment > modification > event
define the event and form routine to make use of the tigger. in the form routine define an object for the class and call the relevant method.
Or u can do it as:
Table maintenance generator is basically used to do table operations like (insert, delete, modify...).
if you create table maintenance for your table it will build a module pool program, by using you do the above operations.
below is the procedure to create table maintenance generator.
1) Create one function group.
2) after activating your Ztable, choose 'Utilities'----> 'Table maintenance genrator'.
3) then give the authorization group and function group created abobe in the next screen.
4) Then choose the "create" button in your application tool bar, which will creates the module pool program.
5) then create one Tcode by chosing "Transaction with parameters( parameter transaction)".
6) in transaction field give "SM30", select the check box "Skip initial screen".
7) in the below of that screen you can find the "Default values" frame.
8) there under the "name of screen field" select the "View name' and 'update".
9) in value column against to "view name" give you table name, and against to "Update" put 'X' in capital letters.
save it then you can straight away use this newly created Tcode to maintain your table.
Note:- 1) make the modification while saving the data into your table using this newly generated program to carry out your validation (even though it looks like standard program; no need to enter the access key).
2) if you do any changes to your table and press the activate button automatically the table maintenace generator will be goes off, you need to create this again.
cheers,

Similar Messages

  • How to maintain default values to the screen fields.

    hi,
    i m creating screen in se51.
    when i press New button the screen is filled with default values
    nrart = 'h' and proz1 = '100' .
    how can i set default values.
    plz give me a response

    HI,
              You can set default values on to screen fields using SET and GET PARAMETER command, You need to assign a PARAMETER ID for that screen field and then use SET PARAMETER before the screen is called or in the PBO of the screen, you can set default values direcly in PBO of the screen but then you have hard code those value or read the data from database.
    You need to have a TABLES statement to create a strucutre that you used to create your screen fields, then when you set value to these strucutre fields these values will get tranported to the screen fields automatically.
    Regards,
    Sesh

  • Default value for a table field?

    Hi,
    I have a table which contains the fields USER_NAME and DATE_CHANGED_AT.
    here's what i want to do:
    When we use se16 to enter data into the table, i want these fields to have default values .
    user_name should contain the currently logged in user.
    date_changed_at should contain todays date.
    The aim is to eventually have these fields contain the person who last changed the row and the date when it was changed.
    It doesnt matter if se16 doesnt contain it and we have a way of defaulting these values thru the table creation process.
    something similar to the mandt field. When we create the table data, MANDT field is pre-populated.
    Any thoughts?
    Regards
    Vandana

    Entering data using SE16 is not a good practice .
    YOu have to use table maintenance generator to maintable the table entries.
    This also provides with options to write your own code to meet requirements like this.
    EVENTS in table maintenance generator
    Regards,
    Ravi

  • How to change default value in a table using ALTER TABLE

    Hi,
    How to change default value in a table
    I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
    I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
    Any help will be needful for me
    Thanks and Regards

    user598986 wrote:
    Hi,
    How to change default value in a table
    I have a table TEST which has 2 fields CODE of Datatype VARCHAR2(10) and Indicator as VARCHAR2(1).
    I want to change the default value using ALTER TABLE TEST of field Indicator to 'I'.
    ALTER TABLE  test
    MODIFY (indicator DEFAULT 'I'); 
    Incidentally, INDICATOR is a keyword in Oracle, so you may have problems using it as a column name. If so, you'll have to enclose the column name in double-quotes, and be careful to use capital letters inside the quotes.
    Edited by: Frank Kulash on Aug 26, 2009 11:42 AM

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set default value of a table using sequence number

    Dear all,
    Does any body know that how to set default value of a table
    using sequence number.
    But I don't want to use trigger to do that.
    Please help!!!!
    Eldon

    Andrew is essentially correct. You can get around the trigger,
    but not the sequence, if (and this may be a very big if) you can
    guarantee that every time an insert is done into the table, from
    whatever source, the statement looks something like
    INSERT INTO tbl VALUES (sequence.nextval,other_columns_values)

  • Maintaing a default value for a particular field in the selection screen

    Hi all,
    How to maintain a default value for a particular field in the Selection Screen of a Standard report
    Regards
    Ajay

    >
    ajay babu wrote:
    > Hi all,
    >
    > How to maintain a default value for a particular field in the Selection Screen of a Standard report
    >
    > Regards
    > Ajay
    Create a variant for your standard program and assign this variant to the field 'Start with variant' while creating transaction code for the standard program in the transaction 'SE93'.
    Regards
    Rajesh.

  • How to set default value in Profit Center field of Tcode F-02.

    Hi!
    Is it possible to set a default value for 'Profit Center' field in t.code F-02? Is there a way wherein the value will be copied in reference to the entered Business Area?
    For example, if during parking/posting of document, user input a value of 300 in the Business Area field, the system will automatically put 300 in the Profit Center field. Is there a way to do this?
    Hoping for your feedback.
    Thanks,
    April

    Hi
    Using the substitution this can be achieved.
    TC:GGB1
    Step-1: Prerequiste select the Company code for which this requirement is needed
    Step-2: In Substitution field, select the the "Profit center" field on selection of the field - system'll asks you -  How would you like to substfield BSEG-PRCTR ? with the 3 options
      i.constant value
      ii.exit
      iii.Field-Field assignment
    Select the 3rd option on selecting 3rd option before going to save that substitution it'll ask you to input which field should input the field BSEG-GSBER:Business area
    Step-3: activate the above substitution in TC:OBBH
    With the above settings whenever any value inputs in Business are field then the same value will be substituted in the Profit center field.
    Note: Make sure in all FSG - business area & profit center having the field status optional
    Can you tell me onething why this requirement has came ? Is business area and profit center are same in number and prupose
    regards
    Ramana
    Edited by: Ramana on Jan 8, 2008 9:33 AM

  • Default value for selection screen field

    Hi all,
      I am using LDB PNPCE. I want to give default value for field Personnel area on selection screen.
    How can I do it?
    Thanks
    Rahul

    Hi Rahul,
    In the INITIALIZATION event we can set the default values for selection screen fields.
    INITIALIZATION.
    loop at screen.
    if screen-name = 'S_MATNR-LOW'.
    CLEAR S_MATNR.
    s_matnr-low = '1234'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr.
    CLEAR S_MATNR.
    s_matnr-high = '5678'.
    s_matnr-option = 'EQ'.
    s_matnr-sign = 'I'.
    append s_matnr
    clear s_matnr.
    endif.
    endloop.
    Hope it helps.
    Mark if useful
    Regards,
    Saumya

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • How to set default value for vc2_255_arr in plsql parameter directive?

    Hi,
    I would like to set a default values for a plsql parameter which is of vc2_255_arr type. How to do that?
    Below is the example from PL/SQL Server Page.
    +" To set a default value, so that the parameter becomes optional, include a default="expression" attribute in the directive. The values for this attribute are substituted directly into a PL/SQL statement, so any strings must be single-quoted, and you can use special values such as null, as in the following example:+
    +<%@ plsql parameter="p_last_name" default="null" %> "+
    My plsql parameter is p_arr which is of "TYPE vc2_255_arr IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER"
    *<%@ plsql parameter="p_arr" type="PMP_LIB.VC2_255_ARR" %>*
    Thanks in advance!
    kwong

    My plsql parameter is p_arr which is of "TYPE vc2_255_arr IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER"You need to declare it in a package specification and initialize in the package body:
    SQL> create or replace package pmp_lib
    as
       type vc2_255_arr is table of varchar2 (255)
                              index by binary_integer;
       vc2_255_arr_default   vc2_255_arr;
    end pmp_lib;
    Package created.
    SQL> create or replace package body pmp_lib
    as
    begin
       vc2_255_arr_default (1) := 'abc';
       vc2_255_arr_default (2) := 'def';
    end pmp_lib;
    Package body created.
    SQL> declare
       arr   pmp_lib.vc2_255_arr := pmp_lib.vc2_255_arr_default;
    begin
       for i in 1 .. arr.count
       loop
          dbms_output.put_line (arr (i));
       end loop;
    end;
    abc
    def
    PL/SQL procedure successfully completed.so in your case it would probably be sth like (assuming pmp_lib is a package):
    <%@ plsql parameter="p_arr" type="PMP_LIB.VC2_255_ARR" default = "PMP_LIB.vc2_255_arr_default" %>

  • ADF 11g - Query Component - How to set default values for search criteria

    I have defined a VO with named query (with 2 search criteria). I created a page and drop a query with table. It works just fine until this point. My requirement is to set a default values for the two search criteria. For example, I have release and category criteria where they are set to use a drop down. I would like to default the values for the drop down when the page is shown up the first time and query the result right away. Is there a way declaratively or I have to create a custom query?
    Thanks.

    I figured this out. Thanks.

  • Hiii help to put default values on custom table

    Hiii
    Please advise how to put assign a default values on a custom table.
    Can you please indicate me the path to navigate to do that

    Please give more details
    where do you want default value while updating table entry or while using table maintenance ?

  • How to make default values for date range?

    Dear Colleagues,
    My customer is asking for a default value for a date range prompt.
    The FromDate should contain the 1st of current month, the ToDate should contain current date.
    Does anyone have any idea how I can meet this demand?
    Regards Silje

    Hi Federico,
    Thank you for the answer, we are back to the challenge after summer vacations!
    I have created a variable in the universe: SELECT current date  as TODAY FROM SYSIBM.SYSDUMMY1. I Called it TODAY.
    Then I created a prompt in the query based on Date. In Prompt Properties I tagged for "Set Default Values" and I typed in TODAY.
    When I try to run the query I get the error message:  The date for the query filter based on 'Date' is invalid (WIS10704).
    What is wrong? What do I have to do differently?
    My goal is to have a default for Date that gives me today..
    Regards Silje

  • How to set default value for html:file in struts

    hi
                   i am working on an application using struts situation is i am using the
    <html:file property="" /> to allow the user to upload file. but i need that a default file should be set so that even if the user donot click browse ie                the user wish to upload that default file the default file get uploaded on page submition.     Is it possible to set any default value for html:file ...if yes plz provide any suggestion or links how to achieve this.     thanks in advance

    www.google.com?q=STRUTS+DOCUMENTATION

Maybe you are looking for