Sequence of classes called in a badi

Hi guys,
I have a problem on the sequence of the classes called in a standard BADI occuring in different system.
In the DEV system, the sequence called is A, B, C (Just to illustrate). But, in the QA and PROD system, the sequence called is B, C, A. Versions of each objects have been compared and found to be the same.
Any ideas how to solve this?
Thanks!

Hi guys,
I have a problem on the sequence of the classes called in a standard BADI occuring in different system.
In the DEV system, the sequence called is A, B, C (Just to illustrate). But, in the QA and PROD system, the sequence called is B, C, A. Versions of each objects have been compared and found to be the same.
Any ideas how to solve this?
Thanks!

Similar Messages

  • Sequence of the classes called in a standard BADI

    Hi guys,
       I have a problem on the sequence of the classes called in a standard BADI occuring in different system.
       In the DEV system, the sequence called is A, B, C (Just to illustrate). But, in the QA and PROD system, the sequence called is B, C, A. Versions of each objects have been compared and found to be the same.
       Any ideas how to solve this?
       Thanks!

    Hi Ndruzz,
    Every BADI by default Implements an INTERFACE which already contains some methods with parameters.
    So you have to find the relavenet method based on the related paramters (by checking the fields in that paramters) you have to double click on the method and to write the code.
    see the doc
    DEFINING THE BADI
    1) execute Tcode SE18.
    2) Specify a definition Name : ZBADI_SPFLI
    3) Press create
    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
    multiple use.
    5) Choose the interface tab
    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
    7) Dbl clk on interface name to start class builder . specify a method name (name,
    level, desc).
    Method level desc
    8) place the cursor on the method name desc its parameters to define the interface.
    Parameter type refe field desc
    I_carrid import spfli-carrid some
    I_connid import spefi-connid some
    9) save , check and activate…adapter class proposed by system is
    ZCL_IM_IM_LINESEL is genereated.
    IMPLEMENTATION OF BADI DEFINITION
    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
    2) Specify aname for implementation ZIM_LINESEL
    3) Specify short desc.
    4) Choose interface tab. System proposes a name fo the implementation class.
    ZCL_IM_IMLINESEL which is already generarted.
    5) Specify short desc for method
    6) Dbl clk on method to insert code..(check the code in “AAA”).
    7) Save , check and activate the code.
    Some useful URL
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    Now write a sample program to use this badi method..
    Look for “BBB” sample program.
    “AAA”
    data : wa_flights type sflight,
    it_flights type table of sflight.
    format color col_heading.
    write:/ 'Flight info of:', i_carrid, i_connid.
    format color col_normal.
    select * from sflight
    into corresponding fields of table it_flights
    where carrid = i_carrid
    and connid = i_connid.
    loop at it_flights into wa_flights.
    write:/ wa_flights-fldate,
    wa_flights-planetype,
    wa_flights-price currency wa_flights-currency,
    wa_flights-seatsmax,
    wa_flights-seatsocc.
    endloop.
    “BBB”
    *& Report ZBADI_TEST *
    REPORT ZBADI_TEST .
    tables: spfli.
    data: wa_spfli type spfli,
    it_spfli type table of spfli with key carrid connid.
    *Initialise the object of the interface.
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    selection-screen begin of block b1.
    select-options: s_carr for spfli-carrid.
    selection-screen end of block b1.
    start-of-selection.
    select * from spfli into corresponding fields of table it_spfli
    where carrid in s_carr.
    end-of-selection.
    loop at it_spfli into wa_spfli.
    write:/ wa_spfli-carrid,
    wa_spfli-connid,
    wa_spfli-cityfrom,
    wa_spfli-deptime,
    wa_spfli-arrtime.
    hide: wa_spfli-carrid, wa_spfli-connid.
    endloop.
    at line-selection.
    check not wa_spfli-carrid is initial.
    create object exit_ref.
    exit_ref1 = exit_ref.
    call method exit_ref1->lineselection
    EXPORTING
    i_carrid = wa_spfli-carrid
    i_connid = wa_spfli-connid.
    clear wa_spfli.

  • How to implement classes and methods in badi's ?

    how to implement classes and methods in badi's? and where i have to write the code based on the requirement?can anyone explain me briefly?

    Hi
    Every BADI by default Implements an INTERFACE which already contains some methods with parameters.
    So you have to find the relavenet method based on the related paramters (by checking the fields in that paramters) you have to double click on the method and to write the code.
    see the doc
    DEFINING THE BADI
    1) execute Tcode SE18.
    2) Specify a definition Name : ZBADI_SPFLI
    3) Press create
    4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
    multiple use.
    5) Choose the interface tab
    6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
    7) Dbl clk on interface name to start class builder . specify a method name (name,
    level, desc).
    Method level desc
    Linese;ection instance methos some desc
    8) place the cursor on the method name desc its parameters to define the interface.
    Parameter type refe field desc
    I_carrid import spfli-carrid some
    I_connid import spefi-connid some
    9) save , check and activate…adapter class proposed by system is
    ZCL_IM_IM_LINESEL is genereated.
    IMPLEMENTATION OF BADI DEFINITION
    1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
    2) Specify aname for implementation ZIM_LINESEL
    3) Specify short desc.
    4) Choose interface tab. System proposes a name fo the implementation class.
    ZCL_IM_IMLINESEL which is already generarted.
    5) Specify short desc for method
    6) Dbl clk on method to insert code..(check the code in “AAA”).
    7) Save , check and activate the code.
    Some useful URL
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    Now write a sample program to use this badi method..
    Look for “BBB” sample program.
    “AAA”
    data : wa_flights type sflight,
    it_flights type table of sflight.
    format color col_heading.
    write:/ 'Flight info of:', i_carrid, i_connid.
    format color col_normal.
    select * from sflight
    into corresponding fields of table it_flights
    where carrid = i_carrid
    and connid = i_connid.
    loop at it_flights into wa_flights.
    write:/ wa_flights-fldate,
    wa_flights-planetype,
    wa_flights-price currency wa_flights-currency,
    wa_flights-seatsmax,
    wa_flights-seatsocc.
    endloop.
    “BBB”
    *& Report ZBADI_TEST *
    REPORT ZBADI_TEST .
    tables: spfli.
    data: wa_spfli type spfli,
    it_spfli type table of spfli with key carrid connid.
    *Initialise the object of the interface.
    data: exit_ref type ref to ZCL_IM_IM_LINESEL,
    exit_ref1 type ref to ZIF_EX_BADISPFLI1.
    selection-screen begin of block b1.
    select-options: s_carr for spfli-carrid.
    selection-screen end of block b1.
    start-of-selection.
    select * from spfli into corresponding fields of table it_spfli
    where carrid in s_carr.
    end-of-selection.
    loop at it_spfli into wa_spfli.
    write:/ wa_spfli-carrid,
    wa_spfli-connid,
    wa_spfli-cityfrom,
    wa_spfli-deptime,
    wa_spfli-arrtime.
    hide: wa_spfli-carrid, wa_spfli-connid.
    endloop.
    at line-selection.
    check not wa_spfli-carrid is initial.
    create object exit_ref.
    exit_ref1 = exit_ref.
    call method exit_ref1->lineselection
    EXPORTING
    i_carrid = wa_spfli-carrid
    i_connid = wa_spfli-connid.
    clear wa_spfli.
    Reward points for useful Answers
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • Is it possible to check to see if a sequence has been called, or is run by a user?

    I'd like a subsequence to be called, but I'd like the Sequence to run differently if it is called versus run by a user.
    What statement should I use and is this even possible?
    Thanks.

    How would the user run the sequence by itself?  Are talking about interactive mode?
    If Runstate.Caller returns NULL, or Nothing in TestStand.  Then you have an interactive execution, i.e. the sequence was not called by anything.
    Thanks,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to populate CONTROLLER in proxy class call?

    Hi All
    While calling proxy class, i want to populate input variable CONTROLLER. I want to use the method GET_MESSAGE_ID to get the message guid.
    CONTROLLER is TYPE REF TO IF_AI_POSTING_CONTROLLER.
    How can i get this populated thru my proxy class call? 
    Sample code is highly appreciated.
    Thanks
    Chandra

    Can you let me know little bit more details. Is this server proxy? If yes, you can use the proxy access class CL_PROXY_ACCESS to access the runtime variables of the proxy. Check http://help.sap.com/saphelp_nw70ehp1/helpdata/en/51/d5cd16235e4643ae8ec92395c4ad97/frameset.htm
    Controller is used for controlling the attributes of the message, say for example controlling initial values for fields etc.
    Let me know if you need more info.
    KK

  • Calling Bapi through BADI gives data statement error

    Dear Experts,
    I am trying to call BAPI through BADI ME_PROCESS_REQ_CUST --> process_item.
    I get an error stating that "The addition OCCURS no longer supported in OO objects"
    If, I remove OCCURS statement I get an error stating that "Tables with headers are no longer supported in OO context" for the following data statement.
    Appreciate, if you could provide possible solution to overcome the problem.
    Regards
    Kumar
    BAPI code is as follows.
    DATA: LV_TABIX LIKE SY-TABIX,
    LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
    LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
    LV_TABIX = SY-TABIX.
    CLEAR: LT_WMDVSX, LT_WMDVEX.
    REFRESH: LT_WMDVSX, LT_WMDVEX.
    Fill communication table
    LT_WMDVSX-REQ_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
    LT_WMDVSX-REQ_QTY = ET_PROCUREMENT_ITEM-QUANTITY.
    APPEND LT_WMDVSX.
    Availability check with check rule '03'
    CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
    EXPORTING
    PLANT = ET_PROCUREMENT_ITEM-PLANT
    MATERIAL = ET_PROCUREMENT_ITEM-MATERIAL
    UNIT = ET_PROCUREMENT_ITEM-UNIT
    CHECK_RULE = '03'
    TABLES
    WMDVSX = LT_WMDVSX
    WMDVEX = LT_WMDVEX
    EXCEPTIONS
    OTHERS = 1.
    IF SY-SUBRC EQ 0.
    READ TABLE LT_WMDVEX WITH KEY
    COM_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
    IF SY-SUBRC EQ 0.
    ET_PROCUREMENT_ITEM-AVAIL_QTY = LT_WMDVEX-COM_QTY.
    ENDIF.
    ENDIF.

    Hi,
    Occurs is no more supported by SAP ( is an obsolete statement )
    <b>Instead of following code</b>
    DATA: LV_TABIX LIKE SY-TABIX,
    LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
    LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
    you can use
    data: LT_WMDVSX type standard table of BAPIWMDVS,
            LT_WMDVEX type standrad table of  BAPIWMDVE,
            LS_WMDVSX like line of LT_WMDVSX ,      "( work area )
            LS_WMDVEX like line of LT_WMDVEX.       "(work area)
    use workarea to get the data and then append the records from workarea to Internal tables
    Reward points if usefull
    Regards,
    Mohan

  • Sequence of Methods Calls

    Hi
    I still need more clarity on sequence of method calls. I have 2 views within an Application which uses a component controller. I have mapped the I/O plugs to navigate from View 1 to View 2. User clicks on a button on view 1 and navigates to View 2. User again clicks on a button in  view  2 to navigate to View 1.
    Now I need to know thge sequence of method calls starting from init() for component controller, init() of view 1 , user clicking a button, firing of plug methods, calling of init() methods of views, doModify() and so on.. I hope I made myself clear.
    Regards,
    Murali.

    Hi Murli
          When you first call the view 2 by clicking on a button  the init method will be called and then modifyView will be called and then you navigate to view 1 again and if again you click to navigate to view 2 at that time only modifyView will be called.
          In the particular session with a client init method is called only once in that particular session. for that view for that client.
          If you have any confusion tell me.
    Ninad

  • "1046: Type was not found" for a custom class calling a custom class

    This should be easy... but I've spent two days on nothing but this error.... I am absolutely at my wit's end.
    Basically, I've got a "character" container linked to a MovieClip in the library that is supposed to act as a container for various body parts; head, shirt, pants, etc. For simplicity, I've just got Character class and Head class, both in a "char" package, both classes are named the same as their respective files (Character.as and Head.as, both in an actual file called "char"). Character class is supposed to create an instance of Head, but I always get this 1046 error. The problem is that I've got other body parts with nearly identical classes that ARENT throwing a 1046 error and are working just fine. I went and made a new project to see if I was still having the problem with just character calling 1 simple body part. I do.
    In the symbol properties, it's Exported for Actionscript & Export in Frame 1... the class is "char.Head" and "char.Character" respectively. I have tried everything I can find or think of, I've done dozens of Google searches and sifted through dozens of forums. I can't find anything and I've been working on this problem for 24 straight working hours now. I'm completely exasperated......
    package char {
    import flash.display.MovieClip;
    import flash.display.Stage;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.geom.ColorTransform;
    import fl.motion.Color;
    import char.Head;
    public class Character extends MovieClip {
    // 1046: Type was not found or was not a compile-time constant: Head
    private var _head:Head;
    // reference to get the stage later
    private var stageRef:Stage;
    public function Character(stageRef:Stage=null) {
    trace("NEW CHARACTER");
    //1180 Call to a possibly undefined method Head;
    _head=new Head();
    And here's the contents of Head.as
    package char {
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.display.Stage;
    import flash.geom.ColorTransform;
    public class Head extends MovieClip {
    private var skin_type:uint;
    public function Head() {
    trace ("NEW HEAD");
    Now if I declare the head variable and create a new instance of it in my document class, no problem whatsoever. If I do it in my Character class, it just doesn't stop giving me this error!!! Somebody please help me.
    1046: Type was not found or was not a compile-time constant: Head
    1180 Call to a possibly undefined method Head;

    There is a blank movieclip named Character in the library, yup.
    Also in my main handler for my document class calls "mainCharacter = new Character(); "
    Here's a chunk of the code from the document class. For the record, it calls "head" as just a test and that works fine. Just doesn't work in "Character"
    import char.Character;
    import char.Head;
    public class MainHandler extends MovieClip {
    private static var _instance:MainHandler;
    public static function get instance():MainHandler { return _instance; }
    public var mainCharacter:Character;
    public var head_:Head;
    public function MainHandler() {
    _instance = this;
    mainCharacter = new Character();
    head_=new Head();

  • One Class Calling Another Class ......Need Help..ugh

    this is the class that calls another class called cuboid
    package WindowsApplication1;
    * Summary description for Cuboid.
    //Import the classes to allow the use of the array, iterator and listiterator
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.ListIterator;
    public class DisplayCuboidValues
         public static void main(String args[])
              //Create the array list
              ArrayList VolumeList = new ArrayList();
              //Create the counter to loop 4 times and get 4 different volumes. Modify the counter
              //if you need a different values
              int Counter = 1;
              //Initialize the counter to loop 4 times in order to get the 4 objects
              while (Counter < 5)
                   Cuboid mp = new Cuboid(2, 4, 3);
                   //Add the values to the array
                   VolumeList.add(mp);
                   // get the volume again via accessor method(Optional)
                   //int Volume = mp.Volume();
                   //System.out.println(Volume);
                   //Increment the counter to obtain a new value in the array
                   Counter = Counter + 1;
              // Retrieve iterator to the radiuslist
              Iterator itr1 = VolumeList.iterator();
              while (itr1.hasNext())
              // call Cuboid.toString()
              System.out.print(itr1.next());
              System.out.println();
    }this is the cuboid class
    package WindowsApplication1;
    * Summary description for Cuboid.
    public class Cuboid
         private final int length, width, height;
         //1st contructor with 3 arguments
         public Cuboid(int length, int width, int height)
              this.length = length;
              this.width = width;
              this.height = height;
         //2nd constructor with no arguments
    //I BELIEVE THIS PUBLIC CUBOID IS THE ONE THE PROVOKES THE ERROR. BUT I CAN NOT DELETE IT BECAUSE I NEED ANOTHER PUBLIC CUBOID. SO IDK WHAT TO DO......
         public Cuboid()
              this.length = length;
              this.width = width;
              this.height = height;
            public String toString() {
                   return "This cuboid has length x, width y, height z, and has volume of v where X=" + length + " " + "Y=" + width + " " + "Z=" + height + " " + "Volume=" + length * width * height + ".   --   ";
         //Method to calculate the Volume
         public int Volume()
              return length * width * height;
         }This is what i have done. I have created a project named ths(which i do not use it at all). Then, i created one file called DisplayCuboidValues under ths. Then i created the file Cuboid under ths too. But it gives me errors. like this one:
    init:
    deps-jar:
    Created dir: C:\Documents and Settings\Owner\ths\build\classes
    Compiling 1 source file to C:\Documents and Settings\Owner\ths\build\classes
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:25: variable length might not have been initialized
    this.length = length;
    *^*
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:26: variable width might not have been initialized
    this.width = width;
    *^*
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:27: variable height might not have been initialized
    this.height = height;
    *^*
    Note: C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\DisplayCuboidValues.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    *3 errors*
    BUILD FAILED (total time: 0 seconds)
    Any help you can give me will be appreciated. Thanks.

    yeah. you are right in that. so that means that i have to get rid of it??. because i will need it. and the values assigned to them is in the first class that calls the second class look:
    package WindowsApplication1;
    * Summary description for Cuboid.
    //Import the classes to allow the use of the array, iterator and listiterator
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.ListIterator;
    public class DisplayCuboidValues
         public static void main(String args[])
              //Create the array list
              ArrayList VolumeList = new ArrayList();
              //Create the counter to loop 4 times and get 4 different volumes. Modify the counter
              //if you need a different values
              int Counter = 1;
              //Initialize the counter to loop 4 times in order to get the 4 objects
              while (Counter < 5)
    *//HERE IS WHERE I AM PROVIDING THE OTHER CLASS WITH VALUES. THEREFORE IT SHOULD SENT THOSE VALUES TO MY CLASS CUBOID AND RETRIEVE THE ANSWER TO FOLLOW THE REST OF THIS CODE.*
                   Cuboid mp = new Cuboid(2, 4, 3);
                   //Add the values to the array
                   VolumeList.add(mp);
                   // get the volume again via accessor method(Optional)
                   //int Volume = mp.Volume();
                   //System.out.println(Volume);
                   //Increment the counter to obtain a new value in the array
                   Counter = Counter + 1;
              // Retrieve iterator to the radiuslist
              Iterator itr1 = VolumeList.iterator();
              while (itr1.hasNext())
              // call Cuboid.toString()
              System.out.print(itr1.next());
              System.out.println();
    }

  • Standard B2C application Order page Java class called on Update?

    Hi All,
    On the Standard B2C application, on adding CampaignKey to the order or Changing the Quantity of the Items. We click UPDATE to update the sales order.
    Please can anyone help to find out which JAVA action Class is linked with the Update button.
    I need to create one Z java action class to update the order.
    Thanks a lot!
    Ekta

    Hi
    I used session logging to trace the class called. I am not able to use HTTP Watch. It is on the Client's network using Citrix. Hence cannot install it. but no doubt that is a better way.
    Classes and the action path is
    main java action class 
    MaintainBasketB2CDispatcherAction"
    linked action path for Update is
    Action path="/b2c/maintainBasket"
    Forward path name   
    <forward name="update" path="/b2c/basketupdate.do"/>
    and for action path
    action path="/b2c/basketupdate"
    java action class :
    MaintainBasketB2CUpdateAction"
    I am making Z action claa for MaintainBasketB2CUpdateAction" and i am updating the condig.xml file.
    I am making this thread open. To trace the flow if in case i get some problem
    Thanks to all of you for your support!
    Thanks
    Ekta

  • Debug java class called from CF?

    I'm experiencing different behaviour with a Java class called from a CF page to the same class called directly from Java code.
    Is it possible for me to step into the Java class and debug it in CF builder if I attach the correct Java source?
    Pressing F5 (step-in) on the line that the method is called just skips straight over.
    Regards,
    Andy

    P5music wrote:
    I would like to be able to make a java application that has a GUI that is a rich web page.That's what applets are for.
    In this case, this page exists on my system and I can open it with my browser.
    This page does many things that are typical of a web page like displaying information and presenting rich and graphical controls
    but some of this controls are connected to a java application, launched from the web page or viceversa.I don't get this "launched from the web page" business. Is that a requirement or are you describing an existing system? Or are you describing somebody else's system whose architecture you want to imitate? Or are you using the word "launched" simply to describe the action of starting an applet?
    It still isn't clear to me what you are trying to describe. But at any rate if you want a Java program to run in your browser, that's an applet. Note that applets can interact with Javascript code in the page they are embedded in. Or if you want to download a Java application which acts as a separate application, i.e. it still runs when the browser is closed, you can use Web Start for that.

  • Java Class calling another class?

    i have a class called infix and a separate class called postfix. what i am trying to do is make the infix class create a string of postfix notation and then call the postfix class to do the computation.
    i have the string all ready to be passed to the postfix class for computation..my question is...how do i get it to that class?

    HERE ARE THE TWO CLASSES. THE POSTFIX WORKS FOR SURE AND I AM TRYING TO GET THE INFIX TO WORK. THE QUESTION IS IN THE RETURN OF THE INFIX. DONT TRY TO CORRECT THE INFIX CODE. I AM WORKING ON THAT BY MYSELF. I JUST NEED HELP ON CONNECTING THEM IF POSSIBLE. CHECK THE RETURN OF INFIX. THANKS ALOT
    import java.util.*;
    public class PostFix
         private Set<String> ops = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         private static Map<String, String> m = new HashMap<String, String>();
         public List<String> getLst()
              return lst;
         public Map<String, String> getMap()
              return m;
         public PostFix( String s )
              ops.add("+");
              ops.add("-");
              ops.add("*");
              ops.add("/");
              ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
              m.put( "a" , "26" );
              m.put( "b" , "25" );
              m.put( "c" , "24" );
              m.put( "d" , "23" );
              m.put( "e" , "22" );
              m.put( "f" , "21" );
              m.put( "g" , "20" );
              m.put( "h" , "19" );
              m.put( "i" , "18" );
              m.put( "j" , "17" );
              m.put( "k" , "16" );
              m.put( "l" , "15" );
              m.put( "m" , "14" );
              m.put( "n" , "13" );
              m.put( "o" , "12" );
              m.put( "p" , "11" );
              m.put( "q" , "10" );
              m.put( "r" , "9" );
              m.put( "s" , "8" );
              m.put( "t" , "7" );
              m.put( "u" , "6" );
              m.put( "v" , "5" );
              m.put( "w" , "4" );
              m.put( "x" , "3" );
              m.put( "y" , "2" );
              m.put( "z" , "1" );
         public int Value()
              Stack<Integer>operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) )
                        operandStack.push(Integer.parseInt(tmp));
                   else
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         public int Value( Map m )
              Stack<Integer> operandStack = new Stack<Integer>();
              Iterator<String> iterator = lst.iterator();
              String tmp;
              String x;
              int val1 = 0;
              int val2 = 0;
              int tmpInt = 0;
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( !ops.contains( tmp ) && !m.containsKey( tmp )  )
                        operandStack.push(Integer.parseInt(tmp));
                   else if ( !ops.contains(tmp) && m.containsKey(tmp) )
                        x = m.get(tmp).toString();
                        operandStack.push(Integer.parseInt(x));
                   else{          
                        val1 = operandStack.pop();
                        val2 = operandStack.pop();     
                        Character c = new Character( tmp.charAt(0) );
                        switch( c )
                             case '+':
                                  operandStack.push(val1 + val2);
                                  break;
                             case '-':
                                  operandStack.push(val2 - val1);
                                  break;
                             case '*':
                                  operandStack.push(val1 * val2);
                                  break;
                             case '/':
                                  operandStack.push(val2 / val1);
                                  break;
                             case '%':
                                  operandStack.push(val2 % val1);
                                  break;
              return operandStack.peek();
         and the infix is
    import java.util.*;
    public class InFix
         PostFix pFix;
         private Set<String> LowOps = new HashSet<String>();
         //private Set<String> parenthesis = new HashSet<String>();
         private Set<String> HighOps = new HashSet<String>();
         private List<String> lst = new LinkedList<String>();
         public List<String> getLst()
              return lst;
         public InFix( String s )
              LowOps.add("+");
              LowOps.add("-");
              HighOps.add("*");
              HighOps.add("/");
              //ops.add("%");
              StringTokenizer sTok = new StringTokenizer(s);
              while( sTok.hasMoreTokens() )
                   lst.add( sTok.nextToken() );
         public int Value()
              Stack <String> operatorStack = new Stack<String>();
              Iterator<String> iterator = lst.iterator();
              String tmp = "";
              String pFixStr = "";
              while( iterator.hasNext() )
                   tmp = iterator.next();
                   if( tmp == "(" )
                        operatorStack.push(tmp);
                   else if( tmp == ")" )
                        String peektmp = operatorStack.peek();
                        while( peektmp != "(" )
                             pFixStr.concat(operatorStack.pop() );
                   else if( !LowOps.contains(tmp) && !HighOps.contains(tmp) )//pushes if its a number
                        pFixStr.concat( tmp );
                   else if( LowOps.contains( tmp ) )
                        operatorStack.push(tmp);
                   else if( HighOps.contains( tmp ) )
                        operatorStack.push(tmp);
              while ( !operatorStack.empty() )
                   pFixStr.concat(operatorStack.pop());
              System.out.println( pFixStr );
         return <THIS IS WHERE I WANT TO RETURN THE COMPUTATION FROM THE POSTFIX CLASS. IS THIS CORRECT TO TRY AND RETURN A POSTFIX(PFIXSTR) OR SOMETHING LIKE THAT>     
         }THANKS

  • Inheritance problem with parent class calling child class

    I have a problem with inheritance with a parent class calling a child class method. Below is the example pseudocode code and my problem:
    public abstract class A {
        protected void function1 ( ) { }
        protected void function2 () {
             //calls function1();
             function1();
    public abstract class B extends A {
        protected void function1 ()  {
             // do stuff
    public class C extends B {
        protected void function1 ()  {
            // do stuff
            super.function1 ();
    }I have an object instance of class C created and its function2() is invoked.
    My problem is, while in function2(), which belongs to abstract class A and the method call to function 1() is called, the call invokes the function1() of class B. Shouldn't the call invoke function 1() of class C instead? And then function1() of class B will be called after due to the super.function1(). It's not behaving like I thought it would.
    Edited by: crono77 on Jan 10, 2008 8:13 PM

    Nevermind, i found my error :)

  • Know the name of class caller...

    Hi... it has a way to know the name of class caller... that is the class name than use a methodA of a ClassA and in the methodA know the name of class than is using this method...

    Hi... it has a way to know the name of class caller...
    that is the class name than use a methodA of a ClassA
    and in the methodA know the name of class than is
    using this method...
    And the requisite question - why?

  • Okay, for a novice (iphone for dummies) what steps to take and in what order to identify specific problem and resolve issue of dropped calls and/or bad connections.  I have a 3g iphone4, I think.  Where is best place to find that information so I can veri

    Okay, for a novice (iphone for dummies) what steps to take and in what order to identify specific problem and resolve issue of dropped calls and/or bad connections.  I have a 3g iphone4, I think.  Where is best place to find that information so I can verify.  

    You can call your wireless provider and talk to them about it.
    You can restart your iphone, reset, your iphone and restore your iphone.

Maybe you are looking for

  • 3G Network switches to Edge all the time, Buttons rattle when shaking-

    I originally owned a first generation iPhone (Love it!) but still couldn't resist and got a "3G S" unfortunately I encountered plenty of anomalies with three different ones. If anyone is going through the following, please help acknowledge this to Ap

  • Quicktime has no sound/audio (probably with 7.1.6 update)

    I've tried everything from checking my system preferences, checking up on my quicktime preferences just no longer plays any sound. Can anybody help me? Any comments would be appreciated, from instructing me how to reinstall the software, just anythin

  • Nvidia - nouveau error

    Hi. I have installed archlinux and after some update I have nouveau error (X server is working fine anyway). that's the error: [ 7.014559] fb: conflicting fb hw usage nouveaufb vs VESA VGA - removing generic driver [ 7.014709] nouveau 0000:02:00.0: s

  • BUG: Adding guide randomly changes resolution to 4,000+ dpi and width to 1.111"(CS4)

    Bizarre bug, wondering if anyone has encountered this and if anyone please has any insight. Upgraded to CS4 about a month ago, and in the last few weeks have discovered a major bug. I'm working in some 300 dpi files, and was confounded when I realize

  • My Adobe programs in CS 5.5 keep crashing.

    My adobe programs in CS 5.5 keep crashing and I don't know why, also I can not open old files anymore. What do I do. I don't have the money to upgrade, I know people with older versions that do not have this trouble.