Instanciate an object depending on a variable value

Hi there,
I am developing a Web application based on a JSP+persistency MVC framework. In a number of classes, I have to be able to instanciate a "model" object (OO mapping from an RDBMS table) whose type depends on the value of a String variable. Currently, this is done this way:
  if(Constants.CONSTANT1.equals(value)) {
    return new Type1Model(args);
  } else if(Constants.CONSTANT2.equals(value)) {
    return new Type2Model(args);
  } // else if...The Type1Model, Type2Model, etc. classes extend the same base class. But I find this code ugly - while quite efficient.
So I am trying to come to a design in which I call ModelFactory.getModel(value, args), period (more accurately, semi-colon). This factory holds a Hashtable, mapping possibles values for "value" to Class. Thus, each Type*Model class registrers itself in the ModelFactory for a given value, guaranteeing simple extensibility without modifying the factory nor the code that uses it.
Now, am I complicating a lot too much this task which is so easy to perform in C-style code ? Or is this the path to OO-enlightenment ?
Thanks and regards.

I would in general avoid the if's as doing a more flexible approach is just as easy to code and more flexible.
It is always best to first focus on the way you would like to call your code and then work on the details of what you need to do to get the code working (i.e. focus on the interface first).
You could use reflection and pass in the class name you would like to construct, and simply use the class name as your constant. This is very simple and flexible. The following is close although I didn't test it.
A sample invocation would be:
Model myModel=ModelFactory.getModel("com.ssouza.MyModel", args);
public class ModelFactory {
  public static Model getModel(String className, Object[] args) {
   // this is more psuedo code and I don't know the exact syntax, but
   Class cls=Class.forName(className);
    Class[] argTypes=loop through args array getting the Class associated with each and put it into this Class array
   Constructor con=cls.getConstructor(argTypes);
    return (Model) con.newInstance(args);
}Steve http://www.jamonapi.com - JDBC/SQL monitoring in jamon 2.3!

Similar Messages

  • Dynamic text in Web Report (lookup on Variable Value)

    Hi
    If a user specifies a variable value to run a report (say company code), is it possible to have logic which looks up some attribute of company code (let's say country for example) and then displays this as part of some header text above the query results table?
    E.G. Report:
    These results are for country <value>.
    .... col1 col2
    row1 200 300
    row2 100 400
    I've had a look at the Text Element Object, but I couldn't determine if it can be used for this - ?
    I'm not sure I could use a Customer Exit Variable to look up the Country, as what could it be attached to if Country is not in the query/Infocube - ?
    (I have the added complexity of having multiple queries in one Web Report)
    Many thanks in advance,

    Hi,
    I see 2 possibilities:
    - Use a <b>text</b> variable with processing type customer exit in the query title and read the masterdata table in your customer exit depending on the variable value for company code.
    - Create another query (query on masterdata table) with the same variable. This will result in one row returning the (in the query definition) defined attributes.
    Heike

  • Showin a variable description  for an info-object depending on a user login

    Hi,
    Client requirement is to show a variable description  for an info-object depending on a user login.
    e.g. a Characteristic Name is Level1 with a description as 'Level1'. If a user in Canada logs in and see a BEx report he should be able to see the description for infoobject Level1 as 'Cost center'.  A user in US may wish to see the description as 'Expense center'  etc. etc.
    Is it possible to do so ? If yes please let me know ASAP.
    Do not get confused with language dependant texts.
    Regards,
    K.Manikandan.

    Hi,
    I don't think it is possible through standard functionality, but maybe you could try a workaround.
    Create a Characteristic (say COMP) with text, and compound it with Infoobject Level1. The values and description for COMP could be
    US Cost Center
    CN Expense Center
    You could make COMP an Authorisation relevant object and check the same with regard to user login, so that the people of sepecific country see only description relevant to their COMP.
    In the report Display COMP as Description and Level1 as Key.
    But do not that compounding may have an impact on the performance, also look into the implications of the same if you need to do it for a large number of reports/objects.
    Hope it helps.
    Cheers
    Anurag
    ......don't forget to assign points if it helps......

  • Convert String variable value  to an Object referece type

    Hi all,
    I want to know that if there any possible way to convert String variable value to a Object reference type in java. I'll explain by example if this is not clear.
    Let's think that there is a string variable name like,
    String name="HelloWorld";
    and there is a class name same to the variable value.
    class HelloWorld
    I am passing this string variable value to a method which is going to make a object of helloworld;
    new convertobj().convert("HelloWorld");
    class convertobj{
    public void convert(String name){
    // in hert it is going to create the object of HelloWorld;
    // HelloWorld hello=new HelloWorld(); just like this.
    now i want to do this from the name variable value.( name na=new name()) like wise.
    please let me know if there any possible way to do that.
    I am just passing the name of class by string variable then i wanted to make a instance of the class which come through the variable value.
    thanx.

    Either cast the object to a HelloWorld or use the reflection API (Google it) - with the reflection API you can discover what methods are available.
    Note: if you are planning to pass in various string arguments and instantiate a class which you expect to have a certain method... you should define an interface and have all of your classes that you will call in this way implement the interface (that way you're sure the class has a method of that name). You can then just cast the object to the interface type and call the method.
    John

  • Mass Upload of object dependency for characteristics value

    Hi ,
      I need to upload the object dependency for characteristics values through transaction CT04. My input data consists of characteristcs name , characteristics value and the object dependency (KNNAM) . Need to populate the KNNAM field alone .
    Have tried with the FM 'CTMV_CHARACT_CHANGE_KNOWL_VAL' which suits my requirement but teh dependencies are not getting uploaded . Am I missing anything ? Since I do not have class details i.e class num and class type I am not able to use  the BAPI like 'BAPI_CLASS_CHARVALUE_LOCAL_DEP ' . Please suggest any othe r suitable method .
    Thanks in advance.
    Sanjeev

    Hi,
    Please check the below link..
    BAPI for Characteristic Dependency
    Thanks.

  • Input-ready query; Layout dependant on variable value

    Hello,
    I need to create an input-ready query where I have months Jan-Dec in colums. If the planner gives a variable value for the planning period for example April, he should get a layout where he can plan for April-Dec and view the values for Jan-March. How can I create this kind of input-ready-query? Thanks in advance. Points will be assigned.
    Regards,
    Marika

    Hi Marika,
    Step1: You need to create a variable (with user restriction), you can provide fixed values for all months of the year, perhaps on 0CALMONTH.  You will get the text displayed when you select the month number in the planning folder where u use it. Say WM1 is the name you gave.
    Step2: Create 2 exit variables.  1st one would check the entry by the user from WM1.  If the period is > January, store all the months starting from January to the month preceeding to one selected in WM1.  Set this as WM2.
    In the second exit variable, the code must check for which month user has selected to start planning from and store all months starting from and ending December in it. Set this as WM3.  You will have to create these 2 variables on 0CALMONTH again.
    Step3: Now, in the Layout builder, 1st screen, for the additional settings, in the data columns tab, select 0CALMONTH for dynamic.
    Step4: In the second screen of Layout builder, create 2 rows for the data column settings.  First row would be set for comparison. Check dynamic box. Assign WM2 as the variable for 0CALMONTH here.
    Second row would be for planning, but check dynamic box here again and assign WM3 as the variable for 0CALMONTH here.
    You must be having WM1 as the variable in header.
    In the 3rd screen you will find just 2 data columns displayed.
    When you run the layout, user prompt will insist you input the desired month and layout on further opening, will bring in the desired data as you require from the Cube.
    I hope you have ur actuals and plan data both in the same cube.  Else you have to assign separate cubes for plng area in comparison and plan settings in the 2nd screen of builder.
    Hope this will help solve ur problem.
    Regards,
    Aby

  • Using a variables value as the name of another variable

    Hi, i'm new to java and i've been trying to write a little program. I was wondering whether it is possible to use the value of a variable as the name of another variable.
    This is what i have so far: When i run my java program numerous Animal objects are created with names like ani01, ani02, ani03. These objects have functions like getName() etc. When i type in one of these codes into the command line it gets stored in a variable called 'input'. Everything's fine up to here.
    But i need a way to access the correct Animal from my input. instead of doing countless switch statements on the input.
    If i type "ani02" i want it to return the animals name by calling ani02.getName()...
    how do i do this? i'd appreciate any help. thanks.

    If you were doing this based on user input, then you
    wouldn't have to do a lot of typing. Mmm?I'm sorry i don't get your meaning... ? I am doing this based on user input am i not?
    All i want to do is access the correct Animal object depending on the user's input... so if they type in ani01 it would return 'Elephant' (or whatever) using ani01.getName().
    Maybe i'm going about this the wrong way or something?.. I have about 30 animals. they each have a name, continent, quantity. I have an Animal class that has functions like getName(), setName() etc. When the program starts, 30 objects are created
    Animal ani01 = new Animal("Elephant",3000,"India");
    Animal ani02 = new Animal("Panda",200,"China");etc...
    I want to be able to get information about any one of these animals by typing something at the command line...
    so i type in something (i just thought the name of the object would be the best thing to type in) and i get the info about elephants (or whatever) from the relevant object.
    how would you do this?

  • Company code and  Ship-To Party: variable values should be dynamic

    Hi,
    We have queries where we have  Company code & Ship-To Party as Variable parameters.
    While executing the report the user has to give the Variable values for both company code and ship to party.
    But when they give the company code.....in the next parameter ship to party, it has to offer values which belongs to that company code only. But here it is offering all values form ship to party., where user don't want to see the value from other company code as they have lot of values there which is causing inconvenience to the user.
    Kindly suggest me how to restrict the values at variable level.
    Thanks & Regards,
    Anand

    Hi,
    You can do that using BADI BW_BADI_F4 .
    You can use this BAdI to restrict input help for entry variables in the BI variable screen.
    Create a separate implementation for each required InfoObject.
    The BAdI is designed for multiple use.
    Restricting input help without using hierarchies
    To restrict input help for flat object lists without using hierarchies, use method Get_Restriction_Flat.
    Method GET_RESTRICTION_FLAT
    I_VNAM Variable
    I_IOBJNM InfoObject
    I_T_VAR_RANGE Table of entries on the variable screen
    I_T_COMPID Table of participating queries
    C_T_RANGE Range table with other restrictions
    C_INFOPROV InfoProvider
    C_F4_Mode F4 mode
    Entry parameters I_VNAM and I_IOBJNM return the names of the variables and the InfoObject that F4 helpwill be affected for. I_T_VAR_RANGE returns additional values from the variable screen entered beforethe call. These are returned in a range table that does not, however, return any information about variables that cannot be entered. I_T_COMPID is a list of participating BI queries.
    If there is a single InfoProvider, entry and return parameter C_INFOPROV contains the InfoProvider forthe participating queries, and can be overwritten in the implementation. Especially when you have justone MultiProvider, this allows you to restrict the input help to one of the physical InfoProviders ifyou also set the F4 mode to u201CDu201D (input help from dimension tables). The mode can onlybe set to u201CDu201D in conjunction with physical InfoProviders, as dimension values are otherwisenot available. If you reference to a VirtualProvider that is based on a data transfer process, you always need to set mode u201CMu201D (input help from master data)
    Return table C_T_RANGE is a range table of additional restrictions that can be used in the implementation.These restrictions are identical to restrictions that the system makes in the standard setting. It is therefore not possible to add to the list.
    The following restrictions are permitted in C_T_RANGE:
    u2022Restrictions for InfoObject I_IOBJNM itself (for example using a specified range)
    u2022Restrictions to groups of InfoObjects (for example restriction of the fiscal year variant for fiscal years)
    u2022Restrictions by the InfoObjectu2019s navigation attributes.
    For technical reasons, pure display attributes cannot be used.
    You can also make a restriction to physical InfoProviders. In this case, the input help is restrictedto the specified physical InfoProviders. Field IOBJNM in table C_T_RANGE then has to be set to 0INFOPROV.In the case of a MultiProvider using physical InfoProviders with mode u201CDu201D (input help from dimension tables), the input help is built from all participating physical InfoProviders.
    Entry and return parameter C_F4_MODE describes the retrieval method for the F4 help:
    u2022In mode u201CMu201D, the input help is built from the master data.
    u2022In mode u201CDu201D, the input help is built from the dimension tables of physical InfoProviders.
    The choice of method is therefore always dependent on the choice of InfoProvider.
    Restricting input help using hierarchies
    To restrict input help for flat object lists using hierarchies, use method Get_Restriction_Node.
    Method GET_RESTRICTION_NODE
    I_VNAM Variable
    I_IOBJNM InfoObject
    I_T_VAR_RANGAE Table of entries on the variable screen
    I_T_COMPID Table of participating queries
    C_T_HIERARCHY Table of possible hierarchies
    C_T_NODE Table with node restrictions
    C_INFOPROV InfoProvider
    C_F4_Mode F4 mode
    On the whole, this method is the same as method GET_RESTRICTION_FLAT. Instead of a C_T_RANGE, the additional node restrictions can be submitted using table C_T_NODE.
    C_T_HIERARCHY contains the hierarchies that can be used based on the existing query restrictions. Ifthis table contains multiple entries, the system uses the first hierarchy in the standard setting. In a BAdI implementation, specific entries can be removed in order to select the required hierarchy.
    Table C_T_NODE can be filled with individual nodes in order to restrict the hierarchy to the corresponding subtrees.
    All other parameters are the same for Get_Restriction_Node as described above for method Get_Restriction_Flat.
    For more information about implementing BAdIs for the enhancement concept, see the SAP Library for SAP NetWeaver, under BAdIs u2013 Embedding in the Enhancement Framework..
    Regards,
    Durgesh.

  • Object dependency for batch characteristic

    I have 1 class with multiple characteristics and 1 of the characteristics should be entered (mandatory) in case of a certain split valuation type (which is covered in the batch info). This should be done via object dependencies within the charateristic. Anyone knows how to do this?

    Dear Sairam
    As explaind to you in the earlier thread for product or proportion unit. you need not maintain object dependency for the characterestics. You have to maintain product unit which will appera as alternatvie UOM. While making GR the Alternate or product UOM will be seen as per the plan value(conversion factor) maintained in material master. You can change both Basic UOM and Alter UOM as per the actual caonversion recieved. This conversion factors will be saved in the batch classification.
    Regards
    MSR

  • How to use bind variable value of one VO as initial value for other VO row?

    JDeveloper 10.1.3.3, ADF Faces, ADF BC
    Hi,
    I have two View Objects: one read only with several bound variables and another editable entity based. Correspondingly there are two ADF Faces pages: first contains search form based on the read-only VO and second create form based on the editable VO. The search form has several hidden fields for some of bound variables because they aren't edited directly by user. These fields are updated with PPR when user selects other search criteria from LOV.
    There is a command button in the first page that navigates to the second form. Is there any way to transfer values of bound variables from the first VO to the second VO as initial values of the new row?
    I tried to set custom controller for the second page and retrieve search criteria values from request parameter map but values from hidden fields are missing. I think because that these fields are updated by PPR. Of course I can add custom action method to the navigation button and in the method put these values to request parameter map but I hope there is better solution.
    Thanks,
    Marius

    To summarize, given a bind variable value for one VO, on creating a row in a second VO, for 1 of the attributes of the second VO, you want to use the first VO's bind variable value. Correct?
    A potential solution ADF BC driven:
    1) Ensure you have an AppModuleImpl for your AM
    2) Ensure you have a ViewImpl for your 1st VO (where the bind variable will exist) - lets refer to that VO as "Alpha"
    3) Ensure you have a ViewRowImpl for your 2nd VO (the one you want to default the value in) - lets refer to that VO as "Beta"
    4) For your first VO "Alpha" create the bind variable (say pValue)
    5) In your second VO "Beta" ViewRomImpl add following code:
    @Override
    protected void create(AttributeList attributeList) {
      super.create(attributeList);
      AppModuleImpl am = (AppModuleImpl)this.getApplicationModule();
      String someValue = am.getAlphaView1().getpValue();
      setSecondVOAttr(someValue); // change this code to whatever your setter is for the field you want to initialize.
    }Hope this helps. Let us know how you go.
    Regards,
    CM.

  • Getting error 025036 while setting bind variable value

    Hi,
    I have created a view object (ViewObj) having bind variable (Bind_Val).
    I am writing custom java method in AppModuleImpl.java, so that I can use that in serviceInterface.
    my method is:
    public void Met(String a){
    ViewObjImpl vo=new ViewObjImpl();
    vo.setBind_Val(a);
    I tried the below method also:
    public void Met(String a){
    ViewObjectImpl vo=new ViewObjectImpl();
    vo.setNamedWhereClauseParam("Bind_Val",a)
    But when I am running the AppModuleServiceImpl.java and select the Met method and pass the value for a. It is giving me error 02036.
    How to set the bind variable value in AppModuleImpl.java??
    Thanks,
    Rohit

    Hi Frank,
    Thanks for reply. It was helpful.
    Please go through the below mentioned two queries.
    My sql query is:
    SELECT Message.MESSAGE_ID,
    MessageProp.VALUE,
    MessageProp.MSG_PROP_ID
    FROM MESSAGE Message, MESSAGE_PROP MessageProp
    WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value='B'
    and I have created one view criteria where I am giving the condition as MessageId=:Bind_MessageId.
    And then I am executing my findViewCriteria method from AppModuleServiceImpl where I am passing the value for Bind_MessageId and I am getting the output as I want.
    Now I am modifying my query as:
    SELECT Message.MESSAGE_ID,
    MessageProp.VALUE,
    MessageProp.MSG_PROP_ID
    FROM MESSAGE Message, MESSAGE_PROP MessageProp
    WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value=:Bind_Value
    and setting the value for :Bind_Value programatically as:
    public void test(String s){
    ViewObjectImpl view = this.getViewObj1();
    VariableValueManager vm = view.ensureVariableManager();
    vm.setVariableValue("Bind_Value",s);
    **Note- I have written this custom method in AppModuleImpl.java class
    Then firstly I am executing test method from AppModuleServiceImpl to set the value for :Bind_Value. After that I am executing findViewCriteria method but then I am not getting any record.
    **Note-I am not getting any error.
    I want to set Bind_Value programatically and then I want to execute my FindViewCriteria from serviceInterface.
    Thanks,
    Rohit

  • Getting Error when we are using same variable value in parallel flows

    Hi All
    In one of the case we will get a Zipped folder in which we have 4 different types of files . we will have date in folder name . we want to insert that date in all the 4 types file data . so we are storing the filedate in a variable and we are planning to
    insert that variable value in all the 4 types files . when we are loading data  in parallel of those 4 files (if the folder size is less than 20MB there is no problem )  we are getting the below error . If we run them in Sequence it is working
    fine without error . Please suggest what will be the issue .
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Invalid character value for cast specification".
    [OLE DB Destination [132]] Error: There was an error with input column "filedate" (523) on input "OLE DB Destination Input" (145). The column status returned was: "The value could not be converted because of a potential loss of data.".
    [OLE DB Destination [132]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "input "OLE DB Destination Input" (145)" failed because error code 0xC0209077 occurred, and the error row disposition on "input "OLE
    DB Destination Input" (145)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    [SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "OLE DB Destination" (132) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (145). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the
    failure.
    Surendra Thota

    Hi Surendra,
    It might be a data type casting issue caused by memory pressure. Please try to use the minimal length of data types that meet the requirements. Besides, if the package runs in 32-bit runtime mode, try to execute it in 64-bit runtime mode. In addition, if
    the issue is not happening in the production environment, I suggest that you install the latest Service Pack for your SQL Server 2008 (R2).
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Problem to transfer Variable value to Dashboard A to Dashboard B

    Hi,buddies:
         I have a scenario that I have to jump from Total Dashboard(we call it A) to Detail Dashboard(we call it B),I work with Xcelsius directly connect to BW through SAP NetWeaver BW connection ,I can transfer Variable values to B through URL with command like this:
         http://hqbd6.sinopec.com:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?DASHBOARD=R2JN_DASHTESTB
    &BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=G1CALMONTH_DZ_MIS
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING
    &BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=2011.07
    But at this condition,The variables of Dashboard B are not bound to any cell because they will be set at run time with values passed in the URL.
    My question is can I get the Variable value from the URL in the Xcelsius Designer and put it into a specified cell and link this cell with the query,so that even jump to Dashboard B I can still change the variable values.
    Best Regards
    Martin Xie
    Edited by: Martin Xie Ai Hua on Mar 9, 2012 7:48 AM

    Let me explain the issue in detail.
    In Query Designer, both the year and  month variables are defined by user exit function to read current year and month and can be modified  during the query runtime.
    In WAD, Query1 is  used  to be a table with a table interface to hyperlink a chart which is defined by Query2 with the same variable value of Query1.
    During the runtime of template, if I change the variable value of Query1 , I want the variable of Query2 to be changed automatically with the same new value.
    So in the table interface of Query1 , I write the ABAP code in "SE24" and related source code to the variable is following:
    concatenate
    'function fire_urlJGSP_Col(filter) {'
    Cl_rsr_www_renderer=>c_lf
    'chart_url="' url '" + "&CMD=LDOC'
    '&TEMPLATE_ID=GCCHART_9' "WEB ID of the work book
    '&PAGEID=Graphics'       "Name of the view
    '&CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT&VAR_NAME=Z2MYEAR&VAR_VALUE_EXT=" + filter'
    Cl_rsr_www_renderer=>c_lf
    'openWindow(chart_url,"chart_window","dependent=yes","600",'
    '"450","true")'
    Cl_rsr_www_renderer=>c_lf
    into l_coding.
    In this way , I can only transfer the year variable value from Query1 to Query2 and not two variables .
    So , how  shall I do to transer the two variable value in the same?

  • Importance of object dependency  type procedure

    Hi Friend,
    Good Morningu2026
    Could any one explain the importance of object dependency  type procedure and its uses with same scenario.
    Thanks in advance,
    Mohan M

    Hi Mohan,
    Procedures are used to infer values for charecterisitcs. These are a type of object dependencies used in VC.
    Procedures can overwrite defualt values or they can set defualt values for charecterisitcs,  several procedures can be assigned to an object (for eg. a BOM item or operation) and define processing sequence.
    These are maintained in Charecteristics, Charecteristic values, configuration profiles, BOM item, Routing operation etc.
    Eg: Processing Sequence:
    A configurable material has characteristics COLOR and PRESSURE. The following procedures are allocated to the configuration profile of the material.
    0010 $SELF.COLOR = u2018GREENu2019 IF PRESSURE >= 10
    0020 $SELF.COLOR = u2018YELLOWu2019 IF PRESSURE >= 50
    0030 $SELF.COLOR = u2018REDu2019 IF PRESSURE >= 100
    The sort sequence ensures that pressure greater than or equal to 100 always sets the color u2018redu2019.
    Inferring Charecteristic Values with procedures:
    Let's assume Configurable material BIKE has the following characteristics:
    CharacteristicS AND THEIR Values                 
    WEIGHT
    FRAME                                          Aluminum                  10 KG
                                                         Steel                           14 KG
    EXTRAS (multiple-value)              Mudguard                   0.5 kg
                                                          Luggage rack             1.0 kG
    Procedure
    1. Create a procedure for the weight of the BIKE, depending on the frame.
    2. This procedure has the following source code:
    $SELF. WEIGHT = 10 if FRAME = u2018Aluminumu2019,
    $SELF. WEIGHT = 14 if FRAME = u2018Steelu2019.
    3. Allocate the procedure to the configuration profile of material BIKE.
    The weight of a bicycle increases if you select additional extras, such as mudguard or luggage
    rack.
    1. You define a procedure with the following source code:
    $SELF.WEIGHT = $SELF.WEIGHT + 0.5 if EXTRAS = 'Mudguard',
    $SELF.WEIGHT = $SELF.WEIGHT + 1 if EXTRAS = 'Luggage rack'
    2. Allocate the procedure to the configuration profile of material BIKE.
    Result
    1. When you configure the bike, the value u2018Aluminumu2019 is selected for characteristic FRAME.
    This triggers the first procedure, which sets the value 10 kg as the WEIGHT.
    2. Characteristic EXTRAS has values u2018Mudguardu2019 and u2018Luggage racku2019. This triggers the
    second procedure, which increases the value of characteristic WEIGHT to 11.5 kg.
    You can also use procedures to count or summurize values of charecterisitics.
    You can use procedure to change the values in master data such as BOM / routing. and also to maintain default values.
    Hope this will be helpful to you. Any queries, Please post.
    Regards,
    Pavan

  • How to show the variable values in key format in the information tab

    Dear all
      in the information tab of the query, we can see all the filters and the variable value. But we can only see the infoobject <b>text</b> of this variable, how can we do if the user needs to see the <b>key</b> of this variable?

    I've referred to the Web API, and find a way to display some specified variable, but since this is the standard webtemplate and we need to show all the possbible variable used in the query. Anybody has better solution?
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="StaticFilter"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DP"/>
             <param name="CAPTION" value="SAP_BW_TEXT?program=SAPLRRSV&amp;key=722"/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="WIDTH" value="330"/>
             <param name="ELEMENT_TYPE_100" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_100" value="0P_WBSO"/>
             <param name="ELEMENT_TYPE_101" value="VARIABLE_KEY" />
             <param name="ELEMENT_NAME_101" value="0P_PRJ"/>
             ITEM:            FILTERS
    </object>

Maybe you are looking for

  • Header lost when saving as pdf form

    I have created a form using formscentral, and added an image in the header. When I select File > Save as PDF form, the resulting file/form looks good EXCEPT my header doesn't appear. Any ideas what I'm doing wrong? Many Thanks Rachel

  • Error Connecting to SLD, while CC integration with ECC 6.0

    Dear All, I am using the CC v and from ECC IDES. I cannot connect to the SLD. It is giving an Error. When I try to register the Server Programs in Vis Admin and click the SET button I am getting an error "Error Adding Bundles". In the ABAP part I am

  • Customer Address Data

    Hello I am trying to extract customers from ECC to MDM using XI I am sending the DEBMDM idoc but it doesn't contain the adress data E1KNB1M doesnt have the STRAS field when I check on SE16 the KNA1 table I see the adresses of all the customers any id

  • Block a GR Posting

    Hello, We have a particular Material for which we do not want to have a GR posting done. However, the Goods receipt is being checked in the Purchase Requisition and the same is being carried over to the Purchase Order and hence the GR is happening fo

  • Modify POC in table EVPOC

    hi, I need to update the POC values in table EVPOC. Is there a BAPI or function to do this? I don't wanna use SQL directly to the table. Thanks. Moderator message: please do some research before asking. Edited by: Thomas Zloch on Feb 23, 2011 11:47 A