Variable impact on WAD objects

I have a Web Application Designer template containing two Analysis objets, ANALYSIS_1 and ANALYSIS_2. When running the template the user is prompted to select a variable value. If the user selects value u201CXu201D, then ANALYSIS_1 should be visible and ANALYSIS_2 should be hidden. If the user selects value u201CYu201D ANALYSIS_2 should be visible and ANALYSIS_1 should be hidden.
Is this possible, and how is it done?
Thanks,
Sofie

Thanks,
I did like you suggested, and the items are shown as the should. The problem is that my main template (with the script and the hidden/visible items) are re-loading over and over again. Did I put my script at the wrong place in the XHTML-code?
function executeJS_SET_ITEM_PARAMETERS_EAA( currentState, defaultCommandSequence ){
     //Create a new object of type sapbi_CommandSequence
     var commandSequence = new sapbi_CommandSequence();
Create a new object of type sapbi_Command with the command named "SET_ITEM_PARAMETERS"
     var commandSET_ITEM_PARAMETERS_1 = new sapbi_Command( "SET_ITEM_PARAMETERS" );
     /* Create parameter ITEM_TYPE */
    var paramITEM_TYPE = new sapbi_Parameter( "ITEM_TYPE", "TEXT_ITEM" );commandSET_ITEM_PARAMETERS_1.addParameter( paramITEM_TYPE );
    /* End parameter ITEM_TYPE  */
     /* Create parameter INIT_PARAMETERS */
     var paramINIT_PARAMETERS = new sapbi_Parameter( "INIT_PARAMETERS" );
    var paramListINIT_PARAMETERS = new sapbi_ParameterList();commandSET_ITEM_PARAMETERS_1.addParameter( paramINIT_PARAMETERS );
     // Create parameter VISIBILITY
     var paramVISIBILITY = new sapbi_Parameter( "VISIBILITY", "VISIBLE" );
     paramListINIT_PARAMETERS.addParameter( paramVISIBILITY );
          // End parameter VISIBILITY!
     paramINIT_PARAMETERS.setChildList( paramListINIT_PARAMETERS );
     /* End parameter INIT_PARAMETERS  */
     /* Create parameter TARGET_ITEM_REF */
     var paramTARGET_ITEM_REF = new sapbi_Parameter( "TARGET_ITEM_REF", "ANALYSIS_1" );
     commandSET_ITEM_PARAMETERS_1.addParameter( paramTARGET_ITEM_REF );
     /* End parameter TARGET_ITEM_REF */
     // Add the command to the command sequence
     commandSequence.addCommand( commandSET_ITEM_PARAMETERS_1 );
End command commandSET_ITEM_PARAMETERS_1
Create a new object of type sapbi_Command with the command named "SET_ITEM_PARAMETERS"
     var commandSET_ITEM_PARAMETERS_2 = new sapbi_Command( "SET_ITEM_PARAMETERS" );
     /* Create parameter ITEM_TYPE */
    var paramITEM_TYPE = new sapbi_Parameter( "ITEM_TYPE", "TEXT_ITEM" );commandSET_ITEM_PARAMETERS_2.addParameter( paramITEM_TYPE );
    /* End parameter ITEM_TYPE  */
     /* Create parameter INIT_PARAMETERS */
     var paramINIT_PARAMETERS = new sapbi_Parameter( "INIT_PARAMETERS" );
    var paramListINIT_PARAMETERS = new sapbi_ParameterList();commandSET_ITEM_PARAMETERS_2.addParameter( paramINIT_PARAMETERS );
     // Create parameter VISIBILITY
     var paramVISIBILITY = new sapbi_Parameter( "VISIBILITY", "HIDDEN" );
     paramListINIT_PARAMETERS.addParameter( paramVISIBILITY );
          // End parameter VISIBILITY!
     paramINIT_PARAMETERS.setChildList( paramListINIT_PARAMETERS );
     /* End parameter INIT_PARAMETERS  */
     /* Create parameter TARGET_ITEM_REF */
     var paramTARGET_ITEM_REF = new sapbi_Parameter( "TARGET_ITEM_REF", "ANALYSIS_2" );
     commandSET_ITEM_PARAMETERS_2.addParameter( paramTARGET_ITEM_REF );
     /* End parameter TARGET_ITEM_REF */
     // Add the command to the command sequence
     commandSequence.addCommand( commandSET_ITEM_PARAMETERS_2 );
End command commandSET_ITEM_PARAMETERS_2
     //Send the command sequence to the server
    return sapbi_page.sendCommand( commandSequence );
function executeJS_SET_ITEM_PARAMETERS_EAA2( currentState, defaultCommandSequence ){
          //Create a new object of type sapbi_CommandSequence
     var commandSequence = new sapbi_CommandSequence();
Create a new object of type sapbi_Command with the command named "SET_ITEM_PARAMETERS"
     var commandSET_ITEM_PARAMETERS_1 = new sapbi_Command( "SET_ITEM_PARAMETERS" );
     /* Create parameter ITEM_TYPE */
    var paramITEM_TYPE = new sapbi_Parameter( "ITEM_TYPE", "TEXT_ITEM" );commandSET_ITEM_PARAMETERS_1.addParameter( paramITEM_TYPE );
    /* End parameter ITEM_TYPE  */
     /* Create parameter INIT_PARAMETERS */
     var paramINIT_PARAMETERS = new sapbi_Parameter( "INIT_PARAMETERS" );
    var paramListINIT_PARAMETERS = new sapbi_ParameterList();commandSET_ITEM_PARAMETERS_1.addParameter( paramINIT_PARAMETERS );
     // Create parameter VISIBILITY
     var paramVISIBILITY = new sapbi_Parameter( "VISIBILITY", "HIDDEN" );
     paramListINIT_PARAMETERS.addParameter( paramVISIBILITY );
          // End parameter VISIBILITY!
     paramINIT_PARAMETERS.setChildList( paramListINIT_PARAMETERS );
     /* End parameter INIT_PARAMETERS  */
     /* Create parameter TARGET_ITEM_REF */
     var paramTARGET_ITEM_REF = new sapbi_Parameter( "TARGET_ITEM_REF", "ANALYSIS_1" );
     commandSET_ITEM_PARAMETERS_1.addParameter( paramTARGET_ITEM_REF );
     /* End parameter TARGET_ITEM_REF */
     // Add the command to the command sequence
     commandSequence.addCommand( commandSET_ITEM_PARAMETERS_1 );
End command commandSET_ITEM_PARAMETERS_1
Create a new object of type sapbi_Command with the command named "SET_ITEM_PARAMETERS"
     var commandSET_ITEM_PARAMETERS_2 = new sapbi_Command( "SET_ITEM_PARAMETERS" );
     /* Create parameter ITEM_TYPE */
    var paramITEM_TYPE = new sapbi_Parameter( "ITEM_TYPE", "TEXT_ITEM" );commandSET_ITEM_PARAMETERS_2.addParameter( paramITEM_TYPE );
    /* End parameter ITEM_TYPE  */
     /* Create parameter INIT_PARAMETERS */
     var paramINIT_PARAMETERS = new sapbi_Parameter( "INIT_PARAMETERS" );
    var paramListINIT_PARAMETERS = new sapbi_ParameterList();commandSET_ITEM_PARAMETERS_2.addParameter( paramINIT_PARAMETERS );
     // Create parameter VISIBILITY
     var paramVISIBILITY = new sapbi_Parameter( "VISIBILITY", "VISIBLE" );
     paramListINIT_PARAMETERS.addParameter( paramVISIBILITY );
          // End parameter VISIBILITY!
     paramINIT_PARAMETERS.setChildList( paramListINIT_PARAMETERS );
     /* End parameter INIT_PARAMETERS  */
     /* Create parameter TARGET_ITEM_REF */
     var paramTARGET_ITEM_REF = new sapbi_Parameter( "TARGET_ITEM_REF", "ANALYSIS_2" );
     commandSET_ITEM_PARAMETERS_2.addParameter( paramTARGET_ITEM_REF );
     /* End parameter TARGET_ITEM_REF */
     // Add the command to the command sequence
     commandSequence.addCommand( commandSET_ITEM_PARAMETERS_2 );
End command commandSET_ITEM_PARAMETERS_2
     //Send the command sequence to the server
    return sapbi_page.sendCommand( commandSequence );
Edited by: Sofie Havgard on Mar 22, 2011 8:36 PM

Similar Messages

  • 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

  • Problem with Variable screen in WAD

    Hi ,
    I have a problem with variable screen in WAD , in the varable seen it is displaying only Key , it is not giving any description , but in BEX is is displaying both Key and Description , can any only have an idea why is this happening . this is occuring only for one variable , rest are working fine .
    Thanks,
    Abraham

    Hi Abraham,
    thsi could be a problem from the specisic setting of the infocube. Please check the BEx Settings from the infocube. You can find them by the following steps:
    - search for the infocube
    - doubleclick on the infocube
    - choose an specific infoobjekt
    - right mousebutton and click "specific dataprovider settings"
    - check if the right entries are set
    Hope this will help.
    André

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • Variable screen in WAD

    i have couple of questions on variable screen while working with Web Application Designer
    1) i am using variables with multiple single entries in my query and when the variable screen in WAD is displayed i have something called insert row icon for each of the variable i used. i do not want to display this icon. is it possible. when i have a single mandatory variable i don't see this icon
    2) when i select a value for one of my variable, say for plant. then i only want the key to be displayed. whereas when i choose a particular plant i can see the key in the variable box and the text which describes the plant adjacent to the variable box. is it possible to display only key.
    3) i have something like this
    Plant     Description
    NJ         New Jersey (description is seen adjacent to the key in the variable box)
    now when i want to empty the screen and run the query for all plants i can delete the key but my description is still seen.
    any idea
    thanks

    thanks for your responses.  i have another problem which is similar to the above ones
    i have variables with multiple single values as optional. now in the variable screen if i choose to enter more than one value, lets say 2 values for the plant then i have two values and its text adjacent to the selection box.
    since i am using optional variable and if the user wants to run the report for all the plants then he comes back to the variable screen and has to empty the selection box. the problem is we can empty the selection box but we are not able to remove the text description adjacent to the selection box which the user says its confusing.
    is there any way we can get rid of it. may be when we refresh the variable screen can we write a code which simply displays the empty variable screen.
    any ideas gurus
    thanks

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • To Supress variable screen in WAD - variable used in customer exit

    Hi All,
    We have a requirement to supress variable screen with WAD 7.0, but the report on which we have built the WAD contains a variable which is used to calculate quaterly utilization in customer exit and ready for input.
    So as there is a variable in CMOD and used in report level, eventhough we supress variable screen in WAD, not getting supressed.
    Can you provide some pointers.
    Thanks,
    Sri Arun Prian

    Hi Arun.
    Can you please tell me, is the variable entry mandatory? If yes please make the variable entry is optional.
    Regards,
    Lokanatha.

  • Performance of set variable command in WAD

    Hi all
        The set variable command in WAD is performing really badly. Can somebody please help me to identify how to decrease the response time.
    thanks in advance

    Hi Vikram,
    your link to SAP Help is wrong. It refers to BW 3.5 (NW04), but your URL looks like BW 7.0 (NBW04s). So you need another SAP Help link. Try this one:
    <a href="http://help.sap.com/saphelp_nw70/helpdata/en/43/ef05462480025ae10000000a1553f7/frameset.htm">http://help.sap.com/saphelp_nw70/helpdata/en/43/ef05462480025ae10000000a1553f7/frameset.htm</a>
    Regarding to example 3 your link should look like this:
    <a href="http://sthbmdm8dv.client.com.50000http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=ZPlan_W00500&BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=zplan_appid&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=10002002">http://sthbmdm8dv.client.com.50000http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=ZPlan_W00500&BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=zplan_appid&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=10002002</a>
    If the variable screen starts up, you should suppress it in template properties.
    best regards
    ARNE
    Edited by: Arne Witte on Jan 18, 2010 6:40 PM

  • How to include WAD objects in BSP

    Hi,
    I would love it if I could include WAD objects like tables, maps, etc. directly in a BSP page - Is this possible ?

    Hallo Tonni
    You can do this with an HTML tag, e.g.:
    <form name=exportform action=<SAP_BW_URL DATA_PROVIDER='DP1' CMD='LAUNCH_QUERY_DESIGNER' TEMPLATE_ID=’0ADHOC_QUERYDESIGN’> method=post target=_blank>
    </form>
    Further information you will find here:
    http://help.sap.com/saphelp_nw04/helpdata/en/9c/10cd562ab80f4cbe57455f7a6606bc/content.htm (General Data Provider Commands)and here http://help.sap.com/saphelp_nw04/helpdata/en/f5/6c013a53271a05e10000000a11402f/frameset.htm (Using HTML-Forms).
    Many regards
    Martin Lehmann

  • What's the variable gpuAccelerate in stage object for?

    Hi!
    What's the variable gpuAccelerate in stage object for?
    It's per default false.
    I've tried to find an answer to this but I couldn't get one from tech docs.
    It also doesn't seem to change paints (looking at one of my animations in Canary's Inspector) if true.
    Thanks,
    Volker

    Hi Darrel, hi Elaine!
    @Darrel: I'm aware of the hardware (GPU) acceleration options in different browsers/systems. I'm just wondering _what_ the boolean in the script output of Edge actually does.
    @Elaine: But _when_ would it switch on GPU in the animations and _where_ (which browsers/platforms)? There's no documentation I've found so far about it and the var is included in every animation with default 'false'.
    And what are the possible pitfalls?
    After beautifying edge-1.5.0.min.js it seems that it just enables the translateZ trick for (some) Webkit based browsers.
    if (this.gpuAccelerate && f[0].style && (typeof n === "undefined" || n === "" || n === "none")) f[0].style.webkitTransform = "translateZ(0)";
    But Edge does anyways already use 3D transitions in its animations?
    Thanks,
    Volker
    Message was edited by: Volker_E

  • Set Computer Variables on "unknown" computer object

    Hi all,
    we are using unknown Computer support for OSD. When the OSD process started, there is a new record created called "unknown" for every machine. 
    Our OSD Process consists of a workflow running in the background on System Center Orchestrator, collecting a few more values from other systems like ITSM. To interface with the currently running OSD of a Machine, we write down Computer Variables on the device
    object (visible in SCCM Console then) which can be used in the task sequence.
    Well, this is how it worked for us with "known" computer but with "unknown" computer it seems that we can't set variables on the "unknown" device object in that state.
    Is this per design ? Can't I set any variable on the object self during "unknown" phase? 
    After OSD is done, the computer object is updated to reflect its name and we now can set variables, but indeed to late. 
    Could you confirm that this is per design ? Any workaround ?
    Thanks

    This is not documented as far as I know, but I guess that it is by design since those 'unknown' objects are transient. I also think that the client (once in the 'unknown state' does not download policies again so that those variable additions will never
    make it to the client).
    Workaround? Most likely yes, but this requires deep knowledge of what you want to achieve exactly.
    Torsten Meringer | http://www.mssccmfaq.de

  • How to analyse impact to other objects?

    Hi Friends,
    Suppose i will change any object sometimes definitely that changes impact on other relating objects. Am i right? then my requirement is i have changed one object,now first of all how to find relating objects and then how to analyse impact of those changes.
    Ex: Changes in infoobject that impact on other objects are Cubes, ODS, reports and rules etc.
    Please guide me in this regard <removed by moderator>.
    Thanks,
    Ramki
    Edited by: Siegfried Szameitat on Dec 1, 2008 12:31 PM

    If your upcoming changes will affect any of the compounded objects then rest assured that the concerned InfoObjects shouldn't contain any data otherwise your infoobjects will be unstable and would be throwing error after activation...
    as far as the related objects are concerned then just remember the thumb rule(extended star schema):
    All the objects in BW are related to each other by a key: Fact table is linked to Dim tab by Dim ID,,Dim Tables linked to SID tables by Surrogate ID(SID) and this SID points to Master data tables(Text, attr and Hier)
    So going from Fact table to Master data table, if you make any changes in fact table (including or excluding Key figures) or in Dim table (including/excuding Characteristics) then you have to activate your master data so  that SIDs will be generated and vice-versa
    Edited by: Alok Kashyap on Dec 1, 2008 12:46 PM

  • Reusing a variable from a new object instance

    I'm developing a stock list array for an assignment I'm currently working on. I've got most of it done, and it seems to be working for the most part, but I'm having trouble getting an array to accept individual variable entries created by new object instances in TestQ3.java.
    I think problem is because the variable itemCode in CraftItem.java is being overwritten by the creation of a new object instance in the TestQ3.java file. I've tested it and believe this to be true.
    I can add a String of my own choosing by using testArray.addCraftItemToStock(itemCode); line but I want to get the program to reuse the itemCode values that have already been created by the four new object instances in TestQ3.java. For example, I want to be able to add more instances of them to the testArray.
    As I'm still relatively new to Java programming, I'm wondering how to do this. I've tried several solutions but I'm not getting anywhere. I'd appreciate it if anyone has any ideas?
    Here's my code:
    TestQ3.java
    public class TestQ3 {
      public static void main(String args[]) {
        // creating a new StockItem array
        CraftStock testArray = new CraftStock(CraftStock.initialStockCapacity);
        // creating new object instance for Glue
        Glue gluePVA = new Glue("PVA Glue",250,"789012",2.50);
        // adds gluePVA item code to the testArray list
        // testArray.addCraftItemToStock(gluePVA.getItemCode());
        // creating new object instance for Card
        Card colouredCard = new Card ("Coloured Card","A3","654321",1.25);
        // adds coloured card item code to the testArray list
        // testArray.addCraftItemToStock(colouredCard.getItemCode());
        // creating new object instance for Glue
        Glue superGlue = new Glue ("Super Glue",25,"210987",1.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(superGlue.getItemCode());
        // creating new object instance for Card
        Card whiteCard = new Card ("White Card","A4","123456",0.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(whiteCard.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
        // this adds the itemCode from gluePVA to the array but
        // it comes out as the last itemCode entry 123456 rather than 789012
        // when I run the code. The problem may lie with variable itemCode
        testArray.addCraftItemToStock(gluePVA.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
    CraftItem.java
    public class CraftItem {
      // instance variables
      public static String itemCode;
      private double price;
      //private int stockCount;
      // constructor
      public CraftItem(String itemCodeValue, double itemPriceValue){
        itemCode = itemCodeValue;
        price = itemPriceValue;
        //CraftStock.addCraftItemToStock(itemCode);
        //stockCount++;
      // getter for itemCode
      public String getItemCode() {
        return itemCode;
      // getter for price
      public double getPrice() {
        return price;
      // setter for itemCode
      public void setItemCode(String itemCodeValue) {
        itemCode = itemCodeValue;
      // setter for price
      public void setPrice(double itemPriceValue) {
        price = itemPriceValue;
      // toString() value
      public String toString() {
        return "Item code is " + itemCode + " and costs " + price + " pounds.";
    Glue.java
    public class Glue extends CraftItem{
      // Instance variables
      private String glueType;
      private double glueVolume;
      // Constructor
      public Glue(String glueType, double glueVolume,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            glueType = glueType;
            glueVolume = glueVolume;
      // getter
      public String getGlueType() {
        return glueType;
      // getter
      public double getGlueVolume() {
        return glueVolume;
      // setter
      public void setGlueType(String glueTypeValue) {
        glueType = glueTypeValue;
      public void setGlueVolume(double glueVolumeValue) {
        glueVolume = glueVolumeValue;
      // toString
      public String toString() {
        return glueType + ", " + glueVolume + "ml, item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    Card.java
    public class Card extends CraftItem{
      // instance variables
      private String cardType;
      private String cardSize;
      // Constructor
      // added super(itemCodeValue, itemPriceValue) to call on CraftItem
      public Card(String cardTypeValue, String cardSizeValue,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            cardType = cardTypeValue;
            cardSize = cardSizeValue;
      // getter
      public String getCardType() {
        return cardType;
      // getter
      public String getCardSize() {
        return cardSize;
      // setter
      public void setCardType(String cardTypeValue) {
        cardType = cardTypeValue;
      // setter
      public void setCardSize(String cardSizeValue) {
        cardSize = cardSizeValue;
      // toString
      // using super. to call on methods from superclass CraftItem
      public String toString() {
        return cardType + ", size " + cardSize + ", item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    CraftStock.java
    public class CraftStock {
        public static int currentStockLevel;
        public static String[] craftStock;
        public static int initialStockCapacity = 10;
        public CraftStock(int initialStockCapacity) {
            currentStockLevel = 0;
            craftStock = new String[initialStockCapacity];
        public int currentStockLevel() {
            return currentStockLevel;
        public static void addCraftItemToStock(String itemCodeValue) {
            if(currentStockLevel == 10){
              System.out.println("Stock list full: cannot add new item code." +
                "\nPlease remove an item if you want to add a new one.");
            else{
            craftStock[currentStockLevel] = itemCodeValue;
            currentStockLevel++;
            System.out.println("Item added");
        public void removeCraftItemFromStock(String itemCode){
          findStockItem(itemCode);
          int i = -1;
            do {
                i++;
            } while (!craftStock.equals(itemCode));
    for (int j = i; j < currentStockLevel - 1; j++) {
    craftStock[j] = craftStock[j + 1];
    currentStockLevel--;
    System.out.println("Item removed");
    private int findStockItem(String itemCode){
    int index = 0;
    for(int i = 0; i < currentStockLevel; i++){
    if(craftStock[i].equals(itemCode)){
    index = i;
    break;
    else{
    index = -1;
    return index;
    public void displayCraftStockList() {
    if(currentStockLevel == 0){
    System.out.println("There are no items in the stock list");
    else{
    for(int i = 0; i < currentStockLevel; i++){
    System.out.println("Item at " + (i + 1) + " is " + craftStock[i]);
    Message was edited by:
    Nikarius

    An instance variable relates to an object. If you require a variable to be available across multiple objects of the same class then I suggest you declare a class variable using the static keyword in your declaration.
    HTH

  • Memeber variable access it's object

    I have a member variable of type TextField, call it "myLink",
    of a class, call it "myThing". myLink can be clicked. In the
    listener, I can certainly access the instance of myLink, but can I
    access the instance of myThing? I need to get another member
    variable in that same object, after the click, but I'm not sure how
    to get to it. I can solve this another way, just wondered if this
    can work. Thanks.

    Will this work for you?
    TS

  • Edit HTML of initial Variable Screen in WAD

    Hai
    WAD
      Is it possible to edit initial variable screen which I get after publishing it in the browser. Can I change the settings like color,font add logo in the top of the varibale screen?
    Thx in Advance
    Rajesh

    Hi Rajesh,
             I think it's possible by editing the style sheets(CSS) in the MIME repository.
    SAP Business Information Warehouse -> Business Explorer -> Mime Repository
    Export the style sheet you want to edit and after making the necessary modifications you can upload it under another file name by choosing the option Import MIME objects(By Rt clicking the Stylesheets folder).
    Hope this helps.
    Regards
    Hari

Maybe you are looking for

  • Can't add folder to library

    i had to replace the hard drive, songs were saved on external and replaced on new c drive. itunes won't allow the folder to be added, it just keeps showing all the songs in the folder instead of adding the folder, whats wrong?

  • Multiple users and multiple ipods, - one computer  PLEASE HELP!!

    I have 1 computer, three users with three different ipods. I want my two daughters to be able to share the music and movies I buy on their own ipods. That's possible and legal, right? It has always worked in the past and now I am getting a message wh

  • I swapped out my hard drive and need to get the new computer to recognize it

    my hp died, and i had to take the hard drive and swap it out to a new computer. Right now it is in an external case hooked up to laptop via USB - no expansion slots. .  the laptop will not recognize it, it only sees the recovery partition. How can i

  • Can i catch an exception from another thread?

    hi,guys,i have some code like this: public static void main(String[] args) { TimeoutThread time = new TimeoutThread(100,new TimeOutException("超时")); try{ t.start(); }catch(Exception e){ System.out.println("eeeeeeeeeee"); TimeoutThread will throws an

  • Launch mysql script using jdbc api

    Hello. I tried something like this:                stmt = conn.prepareStatement("source ./etc/schema-ddl.sql");                stmt.execute();                stmt.close();but it doesn't seem to work. Is there anyway possible to launch an sql script u