How to use default values of variables when data get varied

Hi Expert,
I want to use default value of variables var1.
for eg. if variable length is 20 char and value is abc , then i want to fill var1 by default 20 ( after printing abc value remaining length i.e.17 should be taken by var1 means total length 20 should be occupy by var1.)
plz reply
Regards,
Jyotsna

Hello Jyotsna,
I dont really understand the example you have quoted. Can you elaborate your example?
Vikranth

Similar Messages

  • How to use Default value in a column in Tabular form in insertion or upda

    Hello,
    I am trying to use Default values so that user need not have to enter data, but when I select default type and put a default value, I see an error message, if I try to add a new row.
    How can I use a default value in a Column in a Tabular Form?
    Gouri
    Edited by: user1046395 on Apr 3, 2009 9:58 AM

    Gouri,
    You can just simply edit to each column's report attribute. For example,
    To set default date,
    Default Type: PL/SQL Expression of Function
    Default: sysdate
    To set default text,
    Default Type: PL/SQL Expression of Function
    Default: *'CLERK'*
    If you still have an error, what is the error message?
    Ittichai

  • How to change default value of requested delivery date in va21 create quo

    hi experts,
    My requirement is simple, to add one day to the default value of the Req deliv date under "General header data" in VA21.
    I modified MV45AFZZ (an include in SAPMV45A).
    I added this code:
    if sy-tcode eq 'VA21'.
      case screen-name.
        when 'RV45A-KETDAT'.
         write reqdate to RV45A-KETDAT.
       screen-input = 0. "don't let user change it back.
       screen-active = 1. " but let user see the field and the
      endcase.
    endif.
    reqdate is the new value for RV45A-KETDAT which is sy-datum + 1.
    This code does'nt actaully change anything. I tried to change other values of other fields using the same code and it works. Is RV45A-KETDAT the correct field to use?
    Thank you in advance.

    You don't need to do that via user exit.  You can configure the RDD defautls by document type in SD config, and adding 1 day to the current date is very simple.  You can continue to use the FIELD_MODIFICATION user exit to lock down the field.
    Also, as a general practice in the sales exits, don't use SY-TCODE, use T180-TCODE or T180-TRTYP, even if you're not using BAPIs to create documents.

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

  • Default value for variable are not within permitted value range (precalc)

    Hello BW community
    Issue:
    I have created a variable (Characteristic Value/ Manual input-default value) and use the precalculated value set (details-basic settings). In the further variable definition I could select the  precalculated value set in 'Default values', which I have defined beforehand in the broadcaster..
    The precalculated value set in the broadcaster settings is just based on a master data query on 0CUSTOMER.
    Error:
    The variable gets the error E991/R9E Errors: Default values for variable 'XXX' are not within permitted value range.
    The detail description of the error is: You defined default values for variable 'Sold-to party precalc value set for manuel input' that are not appropriate for the variable type; for example, a range is defined as a default value for a variable that only permits a single value.
    So please has someone had the same issue and found out how to solve it? It would be excelent to get good solution for this issue.
    Best regards and thanks
    Christian
    PS-1: System BW 701 / SAPKW70105
    PS-2 : there has been a SDN entry with the same topic but not resolved too.
    link: /thread/980839 [original link is broken]

    Hello,
    Thanks for your response.
    I should have mentioned that in my post. I tried this very first time. I thought that this is the place where you provide default value. But I got following exception at that time, so I thought, may be this is used for something else.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.servlet.ServletException: OracleJSP error:
    oracle.jbo.NameClashException: JBO-25001: Object viewAllInd of type Control Binding Definition already exists.
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)Do I need handle something else when you put the default value?
    Thanks,
    Jai

  • How to populate default values for BP (FPP1 is  tcode in ECC 6.0)

    Hello ,
    I am creating BP in ECC 6.0 using Fpp1 tcode.  How to populate default values when i hit create BP person.   any badi  triggers when we are creating BP in ECC.
    guide me.

    Hi Premanand,
    To default fields, you need to do the following steps :
    1. Create a Z module e.g. : Z_DEFAULT_FIELDS_DIALOG.
    2. Enter suppose you want to default fiels Name, title, country, write code as follows  :
    DATA : ls_busdefault LIKE busdefault.     
      ls_busdefault-title = '0002'.
      ls_busdefault-mc_name1 = 'TEST'.
      ls_busdefault-mc_name2 = 'Default'.
      ls_busdefault-country = 'IN'.
        CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
        EXPORTING
          i_busdefault = ls_busdefalut.
    3. Now got to transaction BUS7, select event ISDAT, click on Event--> function modules.
    4. Register your Z module Z_DEFAULT_FIELDS_DIALOG in this list, Save.
    This should solve your problem. Please note : You can only default those fields contained in structure BUSDEFAULT.
    Cheers,
    Rishu.

  • How to make default values in selection field?

    hi,
          i have selection field date , using data element 'QENTST' using following code in view INIT Method. i get the input selection field when i test application.
    DATA: LT_RANGE_TABLE TYPE REF TO DATA.
    CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
      EXPORTING
        I_TYPENAME                     =     'QENTST'
      RECEIVING
        RT_RANGE_TABLE           =     LT_RANGE_TABLE.
    CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
      EXPORTING
        I_ID                                     = 'QENTST'
        IT_RESULT                         = LT_RANGE_TABLE
        I_OBLIGATORY                 = ABAP_TRUE.
    What i need now , to make default value in this selection field( low = sy-datum and high = sy-datum + 10 ) . I have checked , i found one method called... SET_RANGE_TABLE_OF_SEL_FIELD. Bt i m not able to understand how to assign values to input table parameter in this method?
    Thanks In Advance.
    Saurin Shah

    Hi,
    Refer this Article by Thomas on how to make default values in Select Options:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60474842-91ca-2b10-3390-d2fd30f335fd
    I hope it would solve your problem.

  • How can i asign value to variables stored in an array of string?

    hi
    how can i asign value to variables stored in an array of string. i need to do it so that i can evaluate a math expression by usin those values. for example, i have a string array like [x, y, z, k]. now i need to asign 2.0 to x, 3.0 to y and so on. then if i type x+y, the program should evaluate the expression by usin x=2.0 and y=3.0. i am usin JEP for parsing and evaluating.
    any help or suggestion would be much apreciated.
    here is how i got the array
    System.out.println("Type first expression");
    BufferedReader br1 = new BufferedReader( new
                         InputStreamReader(System.in));
    String expression1 = br1.readLine();
    Jep jep = new Jep();
    Node node1 = jep.parse(expression1);
    TreeAnalyzer Ta1 = new TreeAnalyzer(node1);
    Map<Variable, Integer> map1 = Ta1.getVariables();
    /**The following will convert the variable names to a sorted array*/
         /**with the result in varNames.*/
    String[] res1 = new String[map1.size()];
                int i=0;
                for(Variable v:map1.keySet())
                    res1[i++]=v.getName();  
    System.out.println(Arrays.toString(res1));

    I could not use HashMap as those variables are to be retrieved from any expression typed by user and thus unknown to me beforehand.
    System.out.println("Type first expression");
    BufferedReader br1 = new BufferedReader( new
                         InputStreamReader(System.in));
    String expression1 = br1.readLine();
    Jep jep = new Jep();
    Node node1 = jep.parse(expression1);
    TreeAnalyzer Ta1 = new TreeAnalyzer(node1);
    Map<Variable, Integer> map1 = Ta1.getVariables();then i have converted them to a sorted array
    String[] res1 = new String[map1.size()];
                     int i=0;
                     for(Variable v:map1.keySet())
                         res1[i++]=v.getName();              
                     System.out.println(Arrays.toString(res1));now i need to assign random double values to those variables.
    and then use those double values for variables when evaluating the expression.
    pls help.

  • How to show default values for properties managed by UUP

    Is there a way to load default values of properties from an external source while
    associating a user with property sets managed by UUP ?
    We are trying to write a Custom User Profile using UUP so that some of the User
    Profile attributes can be stored using an existing Oracle database schema. But
    the values for some of these properties(Profile property set attributes) has to
    come from another table which already exist. So the idea is that when a new user
    is being associated with the Custom property set using Portal Admin Tool, the
    available values for an individual property has to be pulled from from a database
    table. Like when selecting a user's home city he can select the name of all cities
    already existing in a database table.
    I couldn't find a way to do this using the EntityPropertyManager. Anyone has
    any idea how to do this?
    Thomas.

    Hi Thomas,
    Yes, the UUP framework is flexible enough for you to easily load default
    values of properties from some external source. You can do this if you
    deploy your own UserProfileManager that uses a custom PropertySetManager.
    When UserProfileManager.getProperty() is called, it looks for the property
    for that user and then for the user's implicit and explicit successors
    (implicit = persisted for that property set, explicit = given as an argument
    in the method call)...if it doesn't find the property (gets null) then it
    does this:
    PropertySet set = getPropertySetManager().getPropertySet(
    getPropertySetType(), propertySet );
    if ( set != null )
    PropertyDefinition def =
    set.getPropertyDefinition( propertyName );
    if ( def != null )
    result = def.getDefaultValue();
    Check out the javadoc for the classes I have mentioned and check out the
    ejb-jar.xml depoyment descriptor for the UserProfileManager in usermgmt.jar:
    <!-- property set manager -->
    <ejb-ref>
    <ejb-ref-name>ejb/PropertySetManager</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bea.p13n.property.PropertySetManagerHome</home>
    <remote>com.bea.p13n.property.PropertySetManager</remote>
    </ejb-ref>
    There are two options for deploying a UUP: 1) use the default
    UserProfileManager deployment with your custom EntityPropertyManager
    deployment, or 2) use your custom deployment of the UserProfileManager with
    your custom EPM deployment.
    In almost all cases, option 1) is done. However, in your case, you need to
    modify the behavior of the UserProfileManager so you must redeploy a
    custom-configured version. This means you will have to register a new
    ProfileType for your users with the DD for the UserManager EJB (because your
    special users don't use the default UserProfileManager) like this:
    <ejb-ref>
    <ejb-ref-name>ejb/ProfileType/WLCS_Customer</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.bea.commerce.ebusiness.customer.CustomerProfileManagerHome</home>
    <remote>com.bea.commerce.ebusiness.customer.CustomerProfileManager</remote>
    </ejb-ref>
    If you didn't need to retrieve the default values from your own data source,
    here is how you could get the default values using the default deployment of
    the UserProfileManager:
    * use the EBCC to create a property set (a.k.a "user profile") that matches
    your UUP property set name. Create the properties in this pset and the
    default values. When the UserProfileManager.getProperty() call fails to
    find the property value in your UUP (gets null) it will use the default
    PropertySetManager to get metadata about that property from the Portal
    schema (which you just set up using the EBCC) and it will return the default
    value that you set in the EBCC.
    I recommend you study the 2 options for deploying a UUP, especially the
    option for deploying a custom version of the UserProfileManager by checking
    out the sample UUP on dev2dev.bea.com and by looking at the Portal 4.0 docs.
    I don't know if the 7.0 docs have as much detail about this. Also, when you
    sit down to implement your custom PropertySetManager you may have to contact
    support for some of the details. For instance, how to instantiate a
    PropertySet.
    Ture Hoefner
    BEA Systems, Inc.
    www.bea.com
    "Thomas KJ" <[email protected]> wrote in message
    news:[email protected]...
    >
    Is there a way to load default values of properties from an externalsource while
    associating a user with property sets managed by UUP ?
    We are trying to write a Custom User Profile using UUP so that some of theUser
    Profile attributes can be stored using an existing Oracle database schema.But
    the values for some of these properties(Profile property set attributes)has to
    come from another table which already exist. So the idea is that when anew user
    is being associated with the Custom property set using Portal Admin Tool,the
    available values for an individual property has to be pulled from from adatabase
    table. Like when selecting a user's home city he can select the name ofall cities
    already existing in a database table.
    I couldn't find a way to do this using the EntityPropertyManager. Anyonehas
    any idea how to do this?
    Thomas.

  • How to pass the value of variable to another java file?

    Hi. I have 2 java files (LogonAction.java and PCAction.java). The value of variable(String getrole) depends on the logon user. How can I use this value of variable in PCAction.java? I want to execute a sql statement in PCAction.java which is (String sql="Select * from PP where role"+"='" + getrole + "'") Thanks a lot.
    LogonAction.java is below:
    package test;
    import test.jdbc.util.ConnectionPool;
    import java.sql.*
    import java.util.*;
    import javax.servlet.http.*;
    import org.apache.commons.logging.*;
    import org.apache.struts.action.*;
    import org.apache.struts.util.*;
    import org.apache.commons.beanutils.PropertyUtils;
    public final class LogonAction extends Action {
    private Log log = LogFactory.getLog("org.apache.struts.webapp.Example");
    private ConnectionPool pool;
    public LogonAction() {
    pool = ConnectionPool.getInstance();
    public String getrole;
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    Locale locale = getLocale(request);
    MessageResources messages = getResources(request);
    ActionErrors errors = new ActionErrors();
    String username = (String)PropertyUtils.getSimpleProperty(form, "username");
    String password = (String)PropertyUtils.getSimpleProperty(form, "password");
    String getusername=CheckUser(username,password);
    getrole=getusername;
    java.lang.System.out.println(getrole);
    if ("".equals(getusername))
    errors.add(ActionErrors.GLOBAL_ERROR,
    new ActionError("error.password.mismatch"));
    getusername=username+getusername;
    // Report any errors we have discovered back to the original form
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    return (mapping.getInputForward());
    // Save our logged-in user in the session
    HttpSession session = request.getSession();
    session.setAttribute(Constants.USER_KEY, getusername);
    if (log.isDebugEnabled()) {
    log.debug("LogonAction: User '" + username +
    "' logged on in session " + session.getId());
    // Remove the obsolete form bean
    if (mapping.getAttribute() != null) {
    if ("request".equals(mapping.getScope()))
    request.removeAttribute(mapping.getAttribute());
    else
    session.removeAttribute(mapping.getAttribute());
    // Forward control to the specified success URI
    return (mapping.findForward("success"));
    * Look up the user, throwing an exception to simulate business logic
    * rule exceptions.
    * @param database Database in which to look up the user
    * @param username Username specified on the logon form
    * @exception ModuleException if a business logic rule is violated
    public String CheckUser(String username,String password){
    Connection con = null;
    try
    con = pool.getConnection();
    String sql = "SELECT * from user WHERE userid = ? AND password= ?";
    PreparedStatement ps = null;
    ResultSet rs = null;
    try {
    if (con.isClosed()) {
    throw new IllegalStateException("error.con.isClosed");
    ps = con.prepareStatement(sql);
    ps.setString(1,username);
    ps.setString(2,password);
    rs = ps.executeQuery();
    String returnstr="";
    while(rs.next())
    returnstr=rs.getString("role");
    java.lang.System.out.println(returnstr);
    return returnstr;
    } catch (SQLException e) {
    e.printStackTrace();
    throw new RuntimeException("error.ps.executeQuery");
    } finally {
    try {
    if (ps != null)
    ps.close();
    if (rs != null)
    rs.close();
    } catch (SQLException e) {
    e.printStackTrace();
    throw new RuntimeException("error.rs.close");
    catch (SQLException e)
    e.printStackTrace();
    throw new RuntimeException("Unable to get connection.");
    finally
    try
    if (con != null)
    con.close();
    catch (SQLException e)
    throw new RuntimeException(e.getMessage());
    }

    You can use PreparedStatement and
    String cmd = "select * from PP where role=?";
    PreparedStatement stmt = conn.prepareStatement(cmd);
    stmt.setString(1,theRole);

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 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 in OAMessageLovInputBean?

    Hi,
    How to set default value in OAMessageLovInputBean while loading the page?
    I have tried the following code but its not working.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    String delToLoc = (String)pageContext.getSessionValue("deliverTOLoc");
    Number delToLocId = (Number)pageContext.getSessionValue("deliverToLocId");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject poHeadervo =
    (OAViewObject)am.findViewObject("PoHeaderMergeVO");
    PoHeaderMergeVORowImpl poHeaderVoRow =
    (PoHeaderMergeVORowImpl)poHeadervo.getCurrentRow();
    if (delToLoc != null && !"".equals(delToLoc)) {   
    // poHeaderVoRow.setShipToLocation(delToLoc);
    OAMessageLovInputBean msb = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("DefaultShipToLocation");
    msb.setValue(pageContext,delToLoc );
    Please suggest me how to resolve this issue.
    Thanks & Regards,
    Sunita

    Hi Cristoph,
                      We tried all the way but could not able assign characteristics value before saving the document. it means we can only see the assigned value using transaction CV02N. but our requirement is to check if the user fills any value into characteristics it should check with default value which we would like to assign whenever we create a new part of the document which we are not able to achieve.we tried a lot but could not succeed.
    Nay idea if we can achieve this....
    Regards
    Bhuwan Tiwari

  • Dynamic Default value of variable in query

    Hi,
    I would like to set current date as default value (e.g. system date 'SY-DATE') for a variable on selection screen in query. How to do that?
    Thanks,
    Helen

    Hi helen,
       Check this doc : <a href="http://sapbwneelam.blogspot.com/2007/10/how-to-create-populate-user-exit.html">How to... Create & Populate User Exit variable</a>
    Hope it Helps
    Srini

Maybe you are looking for

  • Tiger Server: Default MySQL works for phpMyAdmin but not command line ? ? ?

    Greetings all, I followed the excellent instructions at http://discussions.apple.com/thread.jspa?threadID=132783&tstart=0 on upgrading PHP to version 5 and getting (the preinstalled) MySQL setup with phpMyAdmin I can connect through the phpMyAdmin, c

  • Google maps in black and white

    hi there i am trying to add a custom map to my muse site kind of like these ones Cool Grey - Snazzy Maps - Free Styles for Google Maps where the google map is used just restyled. is this doable with muse i have not yet found a way has anyone else tri

  • Why does my imessage not work?

    I am a new ipad user and am trying to use imessage.  The application is turned on in settings but when I try to send a message to a  contact's iphone it tells me that the contact is not registered?  I do not understand.  Have I missed something in th

  • Conversion of an Instrument Driver from LabWindows/CVI to LabVIEW

    Hello All, Conversion of an Instrument Driver from LabWindows/CVI to LabVIEW http://zone.ni.com/devzone/conceptd.nsf/webmain/9A93316BEBEDB17786256FA300675A0A  But I can not find any hyperlinkt to download "LabVIEW Interface Generator for LabWindows/C

  • Is it safe to disable outgoing mail from one of my accounts?I

    I have two e-mail accounts, but want to eventually stop using one of the accounts and use my gmail account full time. Sometimes when I send e-mail it will use my old e-mail address as the sending address. I want to cease using the old e-mail address