Problems with Generics

Ok, I have a problem with the <? extends NamedType> generic parameterized type, here are three example classes:
public abstract class Base
     public abstract <? extends Base> getMe();
public abstract class Spec
extends Base
     public abstract <? extends Spec> getMe();
public class Impl
extends Spec
     public Impl()
          super();
     public Impl getMe()
          return this;
     public String toString()
          return "I live!";
}And a main method in another class:
public static void main(String[] args)
     Impl im = new Impl();
     Impl i = im.getMe();
     Spec s = Spec.getMe();
     Base b = Base.getMe();
     System.out.println("im = "+im);
     System.out.println("i = "+i);
     System.out.println("s = "+s);
     System.out.println("b = "+b);
}And the compiler returns this:
Base.java:3: <identifier> expected
        public abstract <? extends Base> getMe();
                         ^
Base.java:3: > expected
        public abstract <? extends Base> getMe();
                                                ^
Spec.java:4: <identifier> expected
        public abstract <? extends Spec> getMe();
                         ^
Spec.java:4: > expected
        public abstract <? extends Spec> getMe();
                                                ^
4 errorsPlease assist.

It worked!
I don't know why that didn't work in Eclipse, so:
"Return types are compatible if the overriden method's return type is a subclass of the original method's return type."
I also mistyped the main method, but this new one didn't change the original error:
public static void main(String[] args)
     Impl im = new Impl();
     Impl i = im.getMe();
     Spec s = Spec.getMe();
     Base b = Base.getMe();
     System.out.println("im = "+im);
     System.out.println("i = "+i);
     System.out.println("s = "+s);
     System.out.println("b = "+b);
}should be:
public static void main(String[] args)
     Impl im = new Impl();
     Impl i = im.getMe();
     Spec s = i.getMe();
     Base b = s.getMe();
     System.out.println("im = "+im);
     System.out.println("i = "+i);
     System.out.println("s = "+s);
     System.out.println("b = "+b);
}

Similar Messages

  • Problem with generics in general framework

    Hi,
    I've just started using generics and I've been able to solve most of my problems with type declarations etc, but I still have a few problems left.
    My current problem is in a class which has a map of classes which implements a generic typed interface (The interface is called Persister in the code below).
    The map is declared as:
    private Map<Class<?>, Persister<?>> persisters =
              new HashMap<Class<?>, Persister<?>>(); And the interface is declared as:
    interface Persister<T>My problem is that a method in the class which has the map should return a Collection of type T.
    Can that be done without supressing warnings?
    It's probably hard to understand what I mean (since I don't know the terminology) so here's a complete minimal example which illlustrates the problem. The problem is in the selectAll method in the DbFacade class.
    The lines:
         Persister persister = persisters.get(clazz);
         Collection<E> result = persister.selectAll(clazz);Needs to be altered but to what? (Or do I need to make more changes?)
    Thanks in advance
    Kaj
    ///////////////// Start of complete example
    import java.util.*;
    class ClientSample {
         public static void main(String[] args) {
              DbFacade facade = new DbFacade();
              //Works..
              Collection<Holiday> holidays = facade.selectAll(Holiday.class);
    class DbFacade {
         //Map with many different type of persisters,
         //one persister per class.
         private Map<Class<?>, Persister<?>> persisters =
              new HashMap<Class<?>, Persister<?>>();
         DbFacade() {
              persisters.put(Holiday.class, new HolidayPersister());
         //This is where I'm stuck
         //I don't want to add supresswarnings to this method, so what should I do?
         public <E> Collection<E> selectAll(Class<E> clazz) {
              //The following line gives:
              //Persister is a raw type. References to generic type
              //Persister<T> should be parameterized
              Persister persister = persisters.get(clazz);
              //The following line gives:
              //Type safety: The expression of type List needs unchecked
              //conversion to conform to Collection<E>
              Collection<E> result = persister.selectAll(clazz);
              return result;
    interface Persister<T> {
         List<T> selectAll(Class<T> clazz);
    abstract class AbstractPersister<T> implements Persister<T> {
    class HolidayPersister extends AbstractPersister<Holiday> {
         public List<Holiday> selectAll(Class<Holiday> clazz) {
              return null;
    class Holiday {
         //data
    }

    Well you can put in a type cast
    Persister<E> pesister = (Persister<E>) persisters.get(clazz);but you'll stil get a warning. Sometimes there's just no avoiding them. What, AFAIK, you can't tell the compiler is that each entry of the map contains a persister for the class mapped to it.
    All it knows that classes are mapped to Persisters.

  • Problem with Generic datasource from function

    I developed generic datasource from function module.
    But I have problem with the select options.
    First one is order number  OBJECT_ID type char 10. When I input Object_ID = 45755 , no data selected.
    When input 0000045755, one data record selected.
    But I called functiion CONVERSION_EXIT_ALPHA_INPUT to conevet the input data. And I found  45755 was converted to 0000045755, but no record selected.
         LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'OBJECT_ID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_OBJECT_ID.
            APPEND L_R_OBJECT_ID.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = L_R_OBJECT_ID-high
      IMPORTING
       OUTPUT        = L_R_OBJECT_ID-high
             CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = L_R_OBJECT_ID-low
      IMPORTING
       OUTPUT        = L_R_OBJECT_ID-low
          ENDLOOP.
    Another problem is CREATED_AT, which type is DEC 15,  how could I handle it ?  input is yyyymmdd, I tried to add '000000', but can't select any data.
    Thanks for any help.

    code is :
    FUNCTION ZACTIVITY_PLAN_PARTNER.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SRSC_S_IF_SIMPLE-REQUNR
    *"     VALUE(I_DSOURCE) TYPE  SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *"     VALUE(I_READ_ONLY) TYPE  SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *"     VALUE(I_REMOTE_CALL) TYPE  SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
    *"  TABLES
    *"      I_T_SELECT TYPE  SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *"      E_T_DATA STRUCTURE  ZACTIVITY_PLAN_PARTNER OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    Example: DataSource for table SFLIGHT
      TABLES: CRMD_ORDERADM_H.
    Auxiliary Selection criteria structure
      DATA: L_S_SELECT TYPE SRSC_S_SELECT.
      DATA:   BEGIN OF ACTIVITY,
                       OBJECT_ID       type CRMT_OBJECT_ID_DB,
                       PROCESS_TYPE    type CRMT_PROCESS_TYPE_DB,
                       OBJECT_TYPE     type CRMT_SUBOBJECT_CATEGORY_DB,
                       CREATED_BY      type CRMT_CREATED_BY,
                       CREATED_AT      type CRMT_CREATED_AT,
               END OF ACTIVITY.
      DATA: ZACTIVITY   LIKE TABLE OF ACTIVITY WITH HEADER LINE,
            Zorder   LIKE TABLE OF ZORDER_S WITH HEADER LINE,
            d_start type c length 15,
            d_end type c length 15
    Maximum number of lines for DB table
      STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    counter
              S_COUNTER_DATAPAKID LIKE SY-TABIX,
    cursor
              S_CURSOR TYPE CURSOR.
    Select ranges
      RANGES: L_R_OBJECT_ID FOR CRMD_ORDERADM_H-OBJECT_ID,
              L_R_CREATED_AT FOR CRMD_ORDERADM_H-CREATED_AT,
              L_R_date for ZACTIVITY_PLAN_PARTNER-ZPLAN_DAT.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Check DataSource validity
        CASE I_DSOURCE.
          WHEN 'ZACTIVITY_PLAN_PARTNER'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE E009(R3). ENDIF.
    this is a typical log call. Please write every error message like this
            RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDCASE.
        APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
    Fill parameter buffer for data extraction calls
        S_S_IF-REQUNR    = I_REQUNR.
        S_S_IF-DSOURCE = I_DSOURCE.
        S_S_IF-MAXSIZE   = I_MAXSIZE.
        APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
      ELSE.                 "Initialization mode or data extraction ?
    First data package -> OPEN CURSOR
        IF S_COUNTER_DATAPAKID = 0.
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'OBJECT_ID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_OBJECT_ID.
            APPEND L_R_OBJECT_ID.
         ENDLOOP.
    if  L_R_OBJECT_ID-option is initial.
      L_R_OBJECT_ID-option = 'EQ'.
      L_R_OBJECT_ID-sign ='I'.
      endif.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = L_R_OBJECT_ID-high
      IMPORTING
       OUTPUT        = L_R_OBJECT_ID-high
             CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = L_R_OBJECT_ID-low
      IMPORTING
       OUTPUT        = L_R_OBJECT_ID-low
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CREATED_AT'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CREATED_AT.
            APPEND L_R_CREATED_AT.
          ENDLOOP.
          OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT OBJECT_ID FROM CRMD_ORDERADM_H
                                  WHERE OBJECT_ID  IN  L_R_OBJECT_ID
                                  AND          CREATED_AT IN L_R_CREATED_AT    and
                                        PROCESS_TYPE EQ 'Z220'.
        ENDIF.                             "First data package ?
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.

  • Small problem with generics

    Hi,
    I'd like to get my generic (Hash)Map back from a textfile, for this I have written a method that reads the file and returns an Object. The only problem I have is that I get the error "java uses unchecked or unsafe operations , ..." with the following code:
    Map<Character, TransVal> thisIsMyMap = (HashMap<Character, TransVal>) readFromFile("filename.dat");I thought it would be the same as parsing a String (guess not :-) ):
    String s = (String) justAnObject;TransVal is a class that contains a BitSet and an Integer.
    Any help plz?
    (btw sorry for my english :-s )

    The reason is that it cannot check, at runtime or at compile time whether or not the cast is valid. It will at runtime check the cast to HashMap (btw, use Map for both the cast and the variable), but it will not check that all the keys are Characters and that all the values are TransVals. What will happen is that somewhere where you actually use the map, if the assumption you are making here is incorrect, there will be a ClassCastException in what appears to be perfectly safe code. If you are positive that your cast is safe, either change the return type of readFromFile or put a @SuppressWarnings("unchecked") annotation on the method and use a java compiler that respects it (eclipse, 1.6, and maybe others, but not sun's 1.5 javac).

  • Problem with Generic Sync after upgrade

    Hi guru,
    I have this problem:
    I have done a upgrade ME2.1 -> MI2.5 SP18.
    I have a simple Generic sync application that using a simple Function Module:
    <b>
    function Z_ME_TEST_CONNECTION.
    ""Interfaccia locale:
    *"  EXPORTING
    *"     VALUE(STATUS) LIKE  BWAFSYHEAD-STATUS
    *"  TABLES
    *"      INBOUND_CONTAINER STRUCTURE  BWAFCONT
    *"      OUTBOUND_CONTAINER STRUCTURE  BWAFCONT
      perform CALL_OFFLINE_ME_METHOD using 'TEST_CONNECTION'
                                            INBOUND_CONTAINER[]
                                            OUTBOUND_CONTAINER[].
      OUTBOUND_CONTAINER-FIELDNAME = 'RESULT_CONNECTION' .
      OUTBOUND_CONTAINER-LINENUMBER = 0 .
      OUTBOUND_CONTAINER-FIELDVALUE = 'OK'.
      append OUTBOUND_CONTAINER.
    endfunction.</b>
    When i synchronize my mobile client it returns back
    <b>"EWAF                 001Could not execute method Z_ME_TEST_CONNECTION"</b>
    Can anybody help me in resolving this?

    Hi Sivakumar, I have write the my FM in the BWAFMAPP and the RFC destination in MEMAPPDEST but i have tha same error.
    This is my simple method in my application:
    <b>public String testSync(String userName) {
              String errormessage = null;
              try {
    //        get user out of the SyncSettings
                String user = Configuration.getInstance().getProperty(PropertyKeys.SYNCSETTINGS_USER, userName);
                OutboundContainerFactory outfactory = OutboundContainerFactory.getInstance();
                if (outfactory == null) {
                   errormessage = "testSync->OutboundContainerFactory.getInstance failed";
                }  else {
                   OutboundContainer out = outfactory.createOutboundContainer(
                   VisibilityType.SEPARATED,
                   R3_METHOD_TEST_SYNC,
                   OutboundContainer.TYPE_REQUEST);
              // add the name that has been typed into the JSP
                   out.addItem(DC_I_USER_NAME, user.toUpperCase());
                  out.addItem(DC_I_NUMBER_OF_LINES,"0");
                   out.close();
              // Start Sync
                 SyncManager.getInstance().synchronizeWithBackend(VisibilityType.SEPARATED);
              catch (SyncException ex) {
                   errormessage = ex.getMessage();
              catch (IllegalArgumentException ex) {
                      errormessage = ex.getMessage();
              catch (Exception ex) {
                        errormessage = ex.getMessage();
              finally {
            System.out.println("testSync: errormessage="+errormessage);
              return errormessage;
         }</b>
    You have anathor idea?
    Thanks

  • Problem with Generic iView Lists in EP6

    Hi,
    We are in the process of migrating our portal from EP5 SP5 to EP6 SR1.  I have a page that has 9 iViews on it, and there are 5 of them that are generic iView lists.  In EP5, everything works great.  Each generic iView list returns the information relating to that iView.  But in EP6, I am running into a problem.
    When I am trying to load the same page, some of the iViews to not work.  So I recreated the query iViews using the SAP delivered "com.sap.pct.hcm.eeprofilegenericiviewlist" template in EP6.  I go back to the page and the same thing happens.  I try refreshing the page, and then more of the iViews work, but now another problem arises.
    Example:  I have an iView that displays the salary data of an employee, and another that displays the Home Address.  I refresh the screen and the Salary Data iView works fine, but the Home Address is now showing the Salary Data information.
    So, I'm at a loss as to what I should do.  I know that there is a lot of configuration for the iViews now under the Property Editor and I think that I might have something that is not set up properly.
    Is there documentation on what needs to be set up for the generic iView list if there are multiple generic iView list iViews on the screen? 
    I guess I should mention too that these iViews are in MSS and all work off of the Team Viewer.  The team viewer iView is based off the EP5 version of the par, not the EP6.  Could that be the problem?
    Hope this makes some sense.
    Thanks and best regards,
    Kevin
    Message was edited by: Kevin Schmidt

    Just thought I'd let people know I have solved the problem. 
    Even though I had created brand new iViews in EP6, they still act like EP5 iViews.  So after researching the help files, I changed the isolation method of all the iViews on the page from Embedded to URL.
    Food for thought!!
    Kevin

  • Problem with generic table in tableview

    Hi,
    I need a generic editable table in my tableview. I coded the page as shown below. Displaying the data works fine but after editing, the modifications are not present in my variable model->table. It seems that my reference is lost.
    How can I solve this problem
      field-symbols: <tab> type table.
      assign model->table->* to <tab>.
      if <tab> is assigned.
    %>
    <htmlb:tableView id              = "itab"
                      selectionMode   = "LINEEDIT"
                      table           = "<%= <tab> %>"
                      columnDefinitions  = "<%= model->controltab %>"
                      filter          = "SERVER"
                      selectedRowIndex = "<%= model->selected_row %>"
                      onRowSelection  = "row_select"
                      sort            = "SERVER"
                      columnHeaderVisible = "TRUE"
                      visibleRowCount = "<%= model->ROW_COUNT %>"
                      iterator = "<%= iterator %>"     />

    i guess somewhere (may be in oninputprocessing) you need to get the ref of <tab> to your model table .
    <b> get reference of <tab> into model->table-> .</b>
    i never tried anything like this, but i suggest you to try this.
    Regards
    Raja

  • Problem with Generic Extratcor - Function Module

    Hi Experts,
    We have created Generic Extractor using Funcion Module to Load Inventory related data into BW.When we check in Extract Checker its show 330 records.When we check in table for that logic by material we got the same records as 330.The problem is when we extract into BW we are getting more then 695,000 records.Can somebody please tell us where the problem is .Thanks
    Vahgar

    Hi,
    Check in the load monitor, how many records are populated from source system, and how many are populated after transfer and update rules. Maybe there is your problem, not in the extractor but in the transfer/update.
    Hope it helps.
    regards,
    Diego

  • Re: Satellite A200 - Problem with Generic AC Adapter

    I own an A200 running Windows 7; I've had it for a few years and the battery had degraded to the point where it only held a small amount of power, so I ran it on AC power pretty much all the time. However the plug at the end of the power cord (where it plugs into the computer) gradually became looser and looser to the point where I had to twist and turn it and wrangle it just so in order to get power to flow into the computer; the other day it stopped working completely.
    I went out and bought a third-party AC adapter ('Lite-On'); I'm in a foreign country, but the adapter had the same type of plug and the same power specs (same input range, same voltage output) as the busted adapter that had come with the computer. When I plug it in, all the power-supply LEDs light up and it seems to be working perfectly. When I start the computer, however, sometimes I'll get a screen that says 'Windows failed to start...possibly due to an interruption in the power supply' despite all the LEDs remaining solidly lit during startup. This only happens occasionally; what happens every single time is that within a minute or so all the LEDs will turn off and the computer will instantly shut down; the LEDs will then light back up again instantly. Sometimes this happens during the start-up process, and sometimes I'm able to get as far as logging onto Windows before it shuts down.
    Can someone please tell me what the problem might me?

    After reading your posting I also believe that this issue has nothing to do with AC power supply.
    There must be some other reason for these switch offs.
    In most case this behaviour is typical for overheating. In short period of time hardware reach critical temperature level and notebook simply switch off without any warning.
    You can do small test: start your notebook and enter BIOS settings. Leave it for a while and see if the same will happen again.
    As Akuma already wrote, try to clean the cooling vent and cooling grill.
    Problem is that dust blocks cooling grill and notebook cannot be cooled down properly.

  • Programming problem with Generics

    Hello all...
    I'm trying to get a class using generics. This class is a generic Parser. Here is a piece of code:
    package com.parser;
    import java.io.StringReader;
    public class Parser<T> {
         private Class<T> constructedClass= null;
            String myString= null;
         public Parser(Class<T> class, String str;) {
              constructedClass= class;
                    myString= str;
         public T parse(String document)
              throws JAXBException, ClassNotFoundException {
              ConstructedClasscc = ConstructedClass.newInstance(constructedClass.getPackage().getName());
              Transformer u = cc.getTransformer ();
              return ConstructedClass.cast(u.transform(myString);
    }This code is working now, but I need include Class<T> parameter in the constructor in order to get the name of the package.
    I've tried to clear this constructor, but i'm not able to find any trick to avoid the: constructedClass.getPackage().getName()* line without constructedClass param.
    Does exist any method to obtain it?
    Thankyou all in advance.

    No, erasure means that generics information like that isn't available at run time. it's quite common for generic classes to take the actual class as a parameter for that reason (see, for example, the EnumMap constructor.)

  • Problem with generic data source

    I have a infoset using this infoset I have developed one datasource everything fine,When i see the data on RSA3 it is going to dump.
    Please help.. what is the problem.....
    Regards,
    Sasidhar.

    Hi Sasidhar
    RSA3 is working fine for same datasource in DEV because you must have very less amount of data in DEV as compared to PROD.
    I would suggest that instead of testing only in RSA3 , load the data into BW using infopackage schedule option in background and then see it is successful.
    Regards
    Pradip

  • Problem with Generics

    I have the following practice program:import java.util.*;
    public class ShowRoom
        private List<Car> list;
        public ShowRoom()
            list = new ArrayList<Car>();
        protected void putInRoom(Car car)
            list.add(car);
        protected void takeOutOfRoom(Car car)
            list.remove(car);
        protected void showTheRoom()
            Collections.sort(list);
            System.out.println(list);
        public static void main(String[] args)
            ShowRoom display = new ShowRoom();
            Car car1 = new Car();
            Car car2 = new Car("Audi" , "TTL");
            Car car3 = new Car("Jaguar" , "XKE");
            display.putInRoom(car1);
            display.putInRoom(car2);
            display.putInRoom(car3);
            display.showTheRoom();
            display.takeOutOfRoom(car2);
            display.showTheRoom();
    }When I try to compile, I get:cannot find symbol
    symbol  : method sort(java.util.List<Car>)
    location: class java.util.Collections
         Collections.sort(list);The Car class does implement the Comparable interface and compiles OK.
    What am I missing?
    Thanx one and all.

    When I try to compile, I get:> cannot find symbol
    symbol  : method sort(java.util.List<Car>)
    location: class java.util.Collections
    Collections.sort(list);Car class does implement the Comparable interface and compiles OK.
    What am I missing?I think that the Car class doesn't correctly implement the Comparable
    interface, otherwise the compiler would've found it instead of a method
    'sort(java.util.List<Car>)' method invocation.
    kind regards,
    Jos

  • Problem with reflection in Generics

    I'm using the Prototype compiler for JSR-014 and I am having a big problem with reflection. In the simplest case
    class n<T> {
        void go() {
         this.getGenericType().getTypeParameters();
         this.getClass().getGenericInterfaces();
    }I get a "cannot resolve symbol" on both lines. A glance at the jar included with the prototype shows why: all the collection classes are there, and a lot of the java.lang types, but not java.lang.Class and none of the java.lang.reflection classes.
    So what gives? Is reflection not supported yet? (gaak!) Is there another jar I am supposed to download?
    Thanks

    Schapel is right.
    but also
    The signatures for fields and methods will include the generic types.
    If you really wanted to, this would work.
    get the Class's ClassLoader,
    work out the name of the Class's file, and get an inputStream to this resource (from the classloader). (This bit works because I use as a diagnostics tool to see if classes are loaded from my jar, or my patches directory - see below).
    Write some stuff to read the class file and parse out the generic signatures for the things you are interested in.
    I don't think this last part would fit into anyones definition of "fun", however the specs are all available, and it may turn out simpler than at first appearances.
    Here's the code I use to get the location of where a class is loaded from.
        static URL getLoadPath(Class theClass) {
            StringBuffer resourcename = new StringBuffer(theClass.getName());
            for(int i=0;i < resourcename.length(); i++) {
                if(resourcename.charAt(i) == '.') {
                    resourcename.setCharAt(i,'/');
            resourcename.append(".class");
            return theClass.getClassLoader().getResource(resourcename.toString());
        }if you use getResourceAsStream() in place of getResource() you will have the .class file as an inputStream which you can read and parse.
    Have Fun
    Bruce

  • Generic iViews in MSS- problem with launching in the general information

    Hi,
    My requirement is to display information with a custom query (display info from P0008) in the General Information.
    For this, we have chosen to work with Generic iViews.
    I have followed the following links:
    Link: [http://help.sap.com/erp2005_ehp_04/helpdata/EN/6c/9358f7d8dc43838e4f1135b9c37adb/content.htm]
    Link: [MSS Generic iView not working in General Information Page ]
    The problem i am facing is with Launching the iView Wizard and General Information provided in the 1st link. I am not able to continue with the pointsd under Portal Content Administration
    Thanks,
    Pinki

    Hi Siddharth,
    Thanks for the reply. But my query was not regarding ESS in MSS.
    Its about Generic iViews where you can fetch data using custom queries and user groups and display the same in the general information. I have attached the link provided by SAP below. There are mainly 3 parts to the config:
    1. Creating of custom query.
    2. Using FPM to add the generic iview for list to the perspective of the FPM appl of General information.
    3. Then creating the WD iview of the added view within General information from content Admin and then adding the WD page to the General information page.
    This is my comprehension of the steps provided. However there is one of the link within the Portal Content Admin that does not work.
    Please find the link from help.sap.com below:
    [http://help.sap.com/erp2005_ehp_04/helpdata/EN/6c/9358f7d8dc43838e4f1135b9c37adb/content.htm]
    Thanks,
    Pinki

  • Problem with native SQL cursor in generic data source

    Hi, All!
    I am implementing generic data source based on FM.
    Because of complicated SQL I canu2019t use Open SQL and RSAX_BIW_GET_DATA_SIMPLE-example u201Cas isu201D.
    So, I have to use Native SQL. But Iu2019ve got a problem with a cursor. When I test my data source in RSA3, everything is Ok. But, if I start appropriate info-package, I get error u201CABAP/4 processor: DBIF_DSQL2_INVALID_CURSORu201D. It happens after selecting of 1st data package in line u201CFETCH NEXT S1 INTOu2026u201D. It seems to me that when system performs the second call of my FM the opened cursor has already been disappeared.
    Did anyone do things like this and what is incorrect?
    Is it real to make generic data source based on FM with using Native SQL open, fetch, closeu2026

    Hi Jason,
    I don't think this SQL is very valuable It is just an aggregation with some custom rules. This aggregation is performing on info-provider which consists of two info-cubes. Here we have about 2 billion records in info-provider and about 30 million records in custom db-table Z_TMP (certainly, it has indexes). I have to do this operation on 21 info-providers like this and I have to do this 20 times for each info-provider (with different values of host-variable p_GROUP)
    SELECT T.T1, SUM( T.T2 ), SUM( T.T3 ), SUM( T.T4 )
            FROM (
                    SELECT F."KEY_EVENT06088" AS T1,
                            F."/BIC/EV_COST" + F."/BIC/EV_A_COST" AS T2,
                            DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_COST") +
                              DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_A_COST") AS T3,
                            DECODE( D.SID_EVENTTYPE, 23147, F."/BIC/EV_DURAT",
                                                          23148, F."/BIC/EV_DURAT",
                                                          23151, F."/BIC/EV_DURAT",
                                                          23153, F."/BIC/EV_DURAT",
                                                          23157, F."/BIC/EV_DURAT",
                                                          23159, F."/BIC/EV_DURAT",
                                                          24896734, F."/BIC/EV_DURAT",
                                                          695032768, F."/BIC/EV_DURAT",
                                                          695029006, F."/BIC/EV_DURAT",
                                                          695029007, F."/BIC/EV_DURAT",
                                                          695036746, F."/BIC/EV_DURAT", 0) AS T4
                      FROM "/BIC/VEVENT0608F" F,
                           Z_TMP G,
                           "/BIC/DEVENT06085" D
                      WHERE F."KEY_EVENT06088" = G.ID
                            AND F."KEY_EVENT06085" = D.DIMID
                            AND G.GROUP_NO = :p_GROUP
                            AND ( F."/BIC/EV_COST" < 0 OR F."/BIC/EV_A_COST" < 0 )
                            AND D.SID_EVENTTYPE <> 695030676 AND D.SID_EVENTTYPE <> 695030678
                    UNION
                    SELECT F."KEY_EVNA06088" AS T1,
                            F."/BIC/EV_COST" + F."/BIC/EV_A_COST" AS T2,
                            DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_COST") +
                              DECODE( D.SID_EVENTTYPE, 23147, 0,
                                                          23148, 0,
                                                          23151, 0,
                                                          23153, 0,
                                                          23157, 0,
                                                          23159, 0,
                                                          24896734, 0,
                                                          695032768, 0,
                                                          695029006, 0,
                                                          695029007, 0,
                                                          695036746, 0, F."/BIC/EV_A_COST") AS T3,
                            DECODE( D.SID_EVENTTYPE, 23147, F."/BIC/EV_DURAT",
                                                          23148, F."/BIC/EV_DURAT",
                                                          23151, F."/BIC/EV_DURAT",
                                                          23153, F."/BIC/EV_DURAT",
                                                          23157, F."/BIC/EV_DURAT",
                                                          23159, F."/BIC/EV_DURAT",
                                                          24896734, F."/BIC/EV_DURAT",
                                                          695032768, F."/BIC/EV_DURAT",
                                                          695029006, F."/BIC/EV_DURAT",
                                                          695029007, F."/BIC/EV_DURAT",
                                                          695036746, F."/BIC/EV_DURAT", 0) AS T4
                    FROM "/BIC/VEVNA0608F" F,
                         Z_TMP G,
                         "/BIC/DEVNA06085" D
                    WHERE F."KEY_EVNA06088" = G.ID
                          AND F."KEY_EVNA06085" = D.DIMID
                          AND G.GROUP_NO = :p_GROUP
                          AND ( F."/BIC/EV_COST" < 0 OR F."/BIC/EV_A_COST" < 0 )
                          AND D.SID_EVENTTYPE <> 695030676 AND D.SID_EVENTTYPE <> 695030678
                 ) T
            GROUP BY T.T1

Maybe you are looking for

  • HT1459 why is my apple ID not been used at iTunes Store?

    hi everyone i need your kind assistance regarding my concern when i sign in on my iTunes it say you apple ID is not been used at iTunes Store?

  • No volume with some YouTube videos in Mountain Lion

    I've installed Mountain Lion and the latest Flash player and find that certain YouTube videos (some, not all) play without any volume, completely silent.  A full reboot didn't help.  Here are a couple of examples that videos without volume: http://ww

  • IMPORT GR problem of accounnting Doc

    hi all, i am facing a problem while creating Import Material GR line Items are more than 999.but for the accounting document range is limited up to 999. if i do GR for 50 - 50 i.e. split into two there is a problem of GR reference document as we are

  • Transports backup during system refresh

    I have a requirement to take the backup of transports from QA system which are not yet imported into PRD as QA is getting refreshed.  After refresh, I would like to add these transports into queue and import them in sequence. Now I can get the list o

  • DIGEST authentication support

    I have noticed that neither SunONE nor weblogic support DIGEST authentication. Tomcat appears to have spotty support as well. Digests should be supported by all browsers that use HTTP 1.1, but yet the servlet spec makes it an optional item for web co