ECATT: How to access a protected method of a class with eCATT?

Hi,
These is a class with a protected method. now i am willing to automate the scenario with eCATT. Since the method is Protected i am unable to use createobj and use callmethod. Could anyone suggest me a work around for this ?
Regards
Amit
Edited by: Amit Kumar on Jan 10, 2012 9:53 AM

Hello Anil,
You can write ABAP Code to do that inside eCATT Command.
ABAP.
ENDABAP.
Limitation of doing that is you can only use local variable inside ABAP.... ENDABAP. bracket.
Regards,
Bhavesh

Similar Messages

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

  • How to access a proctected method of a class

    Hi All,
    I have the below code where in the idents_get is a protected method of the class.so when i activate it is throwing an error, method is unkown or protected or private.
    data: gv_class TYPE REF TO /tdag/cpcl_decl_sub_view_ctrl.
       create object gv_class.
        CALL METHOD gv_class->idents_get
          EXPORTING
            i_estcat       = gc_estcat6
            i_pos_wanted   = 1
          IMPORTING
            et_idents      = lt_idents
          changing
            xt_recns       = li_recn
          EXCEPTIONS
            read_failed    = 1
            others         = 2.
    i know protected methods can be accessed in derived class.
    I'm new to ABAP oops concepts please give me some pointers to access a protected method.
    or any sample code to access protected method.
    Thanks in advance,
    Srilakshmi.

    Hello Srilakshmi
    You can access protected methods WITHIN an instance of the class or WITHIN an instance of a sub-class.
    However, in your case you are calling the method from the report and, therefore, the class must be PUBLIC.
    Regards
      Uwe

  • How to Access Protected Method of a Class

    Hi,
         I need to access a Protected method (ADOPT_LAYOUT) of class CL_REIS_VIEW_DEFAULT.
    If i try to call that method by using class Instance it is giving error as no access to protected class. Is there any other way to access it..

    Hi,
        You can create a sub-class of this class CL_REIS_VIEW_DEFAULT, add a new method which is in public section and call the method ADOPT_LAYOUT of the super-class in the new method. Now you can create an instance of the sub-class and call the new sub-class method.
    REPORT  ZCD_TEST.
    class sub_class definition inheriting from CL_REIS_VIEW_DEFAULT.
    public section.
      methods: meth1 changing cs_layout type LVC_S_LAYO.
    endclass.
    class sub_class implementation.
    method meth1.
      call method ADOPT_LAYOUT changing CS_LAYOUT = cs_layout.
    endmethod.
    endclass.
    data: cref type ref to sub_class.
    data: v_layout type LVC_S_LAYO.
    start-of-selection.
    create object cref.
    call method cref->meth1 changing cs_layout = v_layout.

  • ALV - access to protected method

    Hello,
    I have a object from class "CL_GUI_ALV_GRID" and want to change the protected attribute "EVT_DELAYED_CHANGE_SELECTION     Constant     Protected" with the method
        CALL METHOD alv_grid->SET_DELAY_CHANGE_SELECTION
          EXPORTING
            time = lv_delay.
    How can I access this protected attribute?
    Thanks in advance,
    Holger

    This will do what you want
    Trick is to define a sub class inheriting the super class where the protected attributes and methods exist in - then you can access the protected methods and attributes.
    If you do this don't forget to call  the SUPER CONSTRUCTOR (of the class you are inheriting from) in your constructor method. Code example shown below.
    Here I want the original and modified table of an alv grid but you can adapt this code to whatever you need.
    Hope it helps.
    create blank screen (100) with a custom container CCONTAINER1 and the following scren logic in it
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    now look at the code here. Note text in Bold
    PROGRAM zdynfieldcat.
    class zcltest definition  deferred.  "For field symbol reference.
    Simple test of dynamic ITAB with user defined (not ddic) fields
    Build dynamic fcat
    Table structure obtained via new RTTI functionality
    use ALV grid to display and edit.
    Create a blank screen 100 with a custom container called CCONTAINER1.
    James Hawthorne
    Define field symbols as these can't be defined in classes
    field-symbols: <dyn_table> type standard table,
                   <g2> type ref to zcltest,
                   <g1> type ref to cl_gui_custom_container,
                   <actual_tab> type standard table,
                   <outtab> type table,
                   <fs1> type ANY,
                   <FS2> TYPE TABLE,
                   <fs3> type table,
                   <fs4> type table,
                   <fs5> type  table.
    <b>class zcltest definition inheriting from cl_gui_alv_grid.
    define this as a subclass so we can access the protected attributes
    of the superclass cl_gui_alv_grid</b>
      public section.
        types:  g4 type ref to cl_gui_custom_container.
        types:  g3  type ref to cl_alv_changed_data_protocol.
        data:   i_parent type g4,
                lr_rtti_struc TYPE REF TO cl_abap_structdescr, "RTTI
        zog like line of lr_rtti_struc->components. "RTTI
        types: struc like zog.
        types: struc1 type table of struc.
        methods:
           constructor
               importing i_parent type g4,
           disp_tab
               importing  p_er_data_changed type g3,
           create_dynamic_fcat
               importing zogt type struc1
               exporting it_fldcat type lvc_t_fcat.
    Protected section.
       data: stab type ref to data,
            wa_it_fldcat type lvc_s_fcat,
            c_index type sy-index.
    endclass.
    <b>class zcltest implementation.
      METHOD constructor.
        CALL METHOD super->constructor
          EXPORTING
            i_appl_events = 'X'
            i_parent      = i_parent.
          endmethod
    method disp_tab.
    *mt_outtab is the data table held as a protected attribute
    in class cl_gui_alv_grid.
        assign me->mt_outtab->* TO <outtab>. "Original data
        assign p_er_data_changed->mp_mod_rows TO <FS1>.
        stab = p_er_data_changed->mp_mod_rows.
        assign p_er_data_changed->mt_inserted_rows to <fs3>.
        assign p_er_data_changed->mt_deleted_rows to <fs4>.
        assign p_er_data_changed->mt_mod_cells to <fs5>.
        assign stab->* TO <fs2>.
    do whatever you want with <outtab>
    contains data BEFORE changes each time.
    Note that NEW (Changed) table has been obtained already by
    call to form check_data USING P_ER_DATA_CHANGED
    TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.
    Entered data is in table defined by <fs2>
    In this method you can compare original and changed data.
    Easier than messing around with individual cells.
    do what you want with data in <fs2> validate / update / merge etc
      endmethod.</b>
      method create_dynamic_fcat.
        loop at zogt into zog.
          c_index = c_index + 1.
          clear wa_it_fldcat.
          wa_it_fldcat-fieldname = zog-name .
          wa_it_fldcat-datatype = zog-type_kind.
          wa_it_fldcat-inttype = zog-type_kind.
          wa_it_fldcat-intlen = zog-length.
          wa_it_fldcat-decimals = zog-decimals.
          wa_it_fldcat-coltext = zog-name.
          wa_it_fldcat-lowercase = 'X'.
          if c_index eq 2.
            wa_it_fldcat-emphasize = 'C411'.
          endif.
          if c_index eq 3.
            wa_it_fldcat-emphasize = 'C511'.
          endif.
          append wa_it_fldcat to it_fldcat .
        endloop.
      endmethod.                    "create_dynamic_fcat
    endclass.                    "zcltest IMPLEMENTATION
    class lcl_grid_event_receiver definition.
      public section.
    methods:
        handle_data_changed
             for event data_changed of zcltest
            for event data_changed of cl_gui_alv_grid
             importing  er_data_changed,
        toolbar
             for event toolbar of zcltest
             importing e_object
             e_interactive,
        user_command
             for event user_command of zcltest
             importing e_ucomm.
    endclass.
    class lcl_grid_event_receiver implementation.
      method handle_data_changed.
    code whatever required after data entry.
    various possibilites here as you can get back Cell(s) changed
    columns or the entire updated table.
    Data validation is also possible here.
        call method <g2>->disp_tab
          EXPORTING
            p_er_data_changed = er_data_changed.
      endmethod.                    "handle_data_changed
      method toolbar.
        data : ls_toolbar type stb_button.
        clear ls_toolbar.
        move 0 to ls_toolbar-butn_type.
        move 'EDIT' to ls_toolbar-function.
        move space to ls_toolbar-disabled.
        move 'Edit' to ls_toolbar-text.
        move icon_change_text to ls_toolbar-icon.
        move 'Click2Edit' to ls_toolbar-quickinfo.
        append ls_toolbar to e_object->mt_toolbar.
        clear ls_toolbar.
        move 0 to ls_toolbar-butn_type.
        move 'UPDA' to ls_toolbar-function.
        move space to ls_toolbar-disabled.
        move 'Update' to ls_toolbar-text.
        move icon_system_save to ls_toolbar-icon.
        move 'Click2Update' to ls_toolbar-quickinfo.
        append ls_toolbar to e_object->mt_toolbar.
        clear ls_toolbar.
        move 0 to ls_toolbar-butn_type.
        move 'EXIT' to ls_toolbar-function.
        move space to ls_toolbar-disabled.
        move 'Exit' to ls_toolbar-text.
        move icon_system_end to ls_toolbar-icon.
        move 'Click2Exit' to ls_toolbar-quickinfo.
        append ls_toolbar to e_object->mt_toolbar.
      endmethod.                    "toolbar
      method user_command.
        case e_ucomm .
          when 'EDIT'. "From Tool bar
            perform set_input.
            perform init_grid.
          when 'UPDA'. "From Tool bar
            perform refresh_disp.
            perform update_table.
          when 'EXIT'. "From Tool bar
            leave program.
        endcase.
      endmethod.                    "user_command
    endclass.                    "lcl_grid_event_receiver IMPLEMENTATION
    program data
    include <icon>.
    define any old internal structure NOT in DDIC
    types: begin of s_elements,
    anyfield1(20) type c,
    anyfield2(20) type c,
    anyfield3(20) type c,
    anyfield4(20) type c,
    anyfield5(11) type n,
    end of s_elements.
    data: wa_element type s_elements,
    wa_data type s_elements.
    Note new RTTI functionality allows field detail retrieval
    at runtime for dynamic tables.
    data:
            grid1 type ref to zcltest,
            grid_handler type ref to lcl_grid_event_receiver,
            c_dec2 type s_elements-anyfield5,
            wa_it_fldcat type lvc_s_fcat,
            it_fldcat type lvc_t_fcat,
            lr_rtti_struc TYPE REF TO cl_abap_structdescr, "RTTI
            lt_comp TYPE cl_abap_structdescr=>component_table,"RTTI
            ls_comp LIKE LINE OF lt_comp, "RTTI
            zog like line of lr_rtti_struc->components,  "RTTI
            struct_grid_lset type lvc_s_layo,
            l_valid type c,
            new_table type ref to data.
            types: struc like zog.
    data:  zogt type table of struc,
            grid_container1 type ref to cl_gui_custom_container,
            g_event_receiver type ref to lcl_grid_event_receiver,
            ok_code like sy-ucomm,
            i4 type int4.
    start-of-selection.
      call screen 100.
    module status_0100 output.
      if grid_container1 is initial.
        create object grid_container1
        exporting
        container_name = 'CCONTAINER1'.
        assign grid_container1 to <g1>.
        create object grid1
         exporting i_parent = grid_container1.
    we need reference to this instance so we can use
    Methods etc of zcltest class and alv (superclass)
    in our event receiver class.
         assign grid1 to <g2>.
        create object grid_handler.
        set handler:
        grid_handler->user_command for grid1,
        grid_handler->toolbar for grid1,
        grid_handler->handle_data_changed for grid1.
    Get the Internal table structure
        lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( wa_data ).
    Build field catalog just use basic data here
    colour specific columns as well
        zogt[] = lr_rtti_struc->components.
          call method grid1->create_dynamic_fcat
          EXPORTING
            zogt      = zogt
          IMPORTING
            it_fldcat = it_fldcat.
    Create dynamic internal table and assign to field symbol.
    Use dynamic field catalog just built.
      call method cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = new_table.
      assign new_table->* to <dyn_table>.
        perform populate_dynamic_itab.
        perform init_grid.
        perform register_enter_event.
    set off ready for input initially
        i4 = 0.
        call method grid1->set_ready_for_input
          EXPORTING
            i_ready_for_input = i4.
      endif.
    endmodule.                    "status_0100 OUTPUT
    module user_command_0100 input.
    *PAI not needed in OO ALV anymore as User Commands are handled as events
    *in method user_command.
    *we can also get control if the Data entered and the ENTER is pressed by
    *raising an event.
    Control then returns to method handle_data_changed.
    endmodule.                    "user_command_0100 INPUT
    form populate_dynamic_itab.
    load up a line of the dynamic table
      c_dec2 = c_dec2 + 11.
      wa_element-anyfield1 = 'Tabbies'.
      wa_element-anyfield2 = 'ger.shepards'.
      wa_element-anyfield3 = 'White mice'.
      wa_element-anyfield4 = 'Any old text'.
      wa_element-anyfield5 = c_dec2.
      append wa_element to <dyn_table>.
    endform.                    "populate_dynamic_itab
    form exit_program.
      call method grid_container1->free.
      call method cl_gui_cfw=>flush.
      leave program.
    endform.                    "exit_program
    form refresh_disp.
      call method grid1->refresh_table_display.
    endform.                    "refresh_disp
    form update_table.
    The dynamic table here is the changed table read from the grid
    after user has changed it
    Data can be saved to DB or whatever.
      loop at <dyn_table> into wa_element.
    do what you want with the data here
      endloop.
    switch off edit mode again for next function
      i4 = 0.
      call method grid1->set_ready_for_input
        EXPORTING
          i_ready_for_input = i4.
    endform.                    "update_table
    form set_input.
      i4 = 1.
      call method grid1->set_ready_for_input
        EXPORTING
          i_ready_for_input = i4.
    endform.                    "set_input
    form switch_input.
      if i4 = 1.
        i4 = 0.
      else.
        i4 = 1.
      endif.
      call method grid1->set_ready_for_input
        EXPORTING
          i_ready_for_input = i4.
    endform.                    "switch_input
    form init_grid.
    Enabling the grid to edit mode,
      struct_grid_lset-edit = 'X'. "To enable editing in ALV
      struct_grid_lset-grid_title = 'Jimbos Test'.
       call method grid1->set_table_for_first_display
        EXPORTING
          is_layout       = struct_grid_lset
        CHANGING
          it_outtab       = <dyn_table>
          it_fieldcatalog = it_fldcat.
    endform.                    "init_grid
    form register_enter_event.
      call method grid1->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_enter.
    Instantiate the event or it won't work.
      create object g_event_receiver.
      set handler g_event_receiver->handle_data_changed for grid1.
    endform.                    "register_enter_event

  • Access to protected method is ot allowed

    Hi,
    there is class with a protected  method. I get the message
    "Access to protected method is ot allowed"
    How must such methods be called if they are protected ?
    Regards
    sas

    Erdem, please try to post in the correct forum.  ABAP Objects questions belong in this forum, not general.
    Second, Amit Khare is correct.  The concept of Public/Protected/Private methods and attributes is not limited to ABAP Objects.  It is a common concept to most object oriented programming languages.  But if your read the ABAP Help on the appropriate keywords, then it is explained very clearly.
    matt

  • Protected methods in abstract classes

    Hello All
    I have some problem which I cannot find a workaround for.
    I have three classes:
    package my.one;
    public abstract class First {
      protected void do();
      protected void now();
    package my.one;
    public class NotWantToHave extends First {
      protected First obj;
      public NotWantToHave(First O) { obj = O; }
      public void do() { obj.do(); }
      public void now() { obj.now(); }
    package my.two;
    public class Second extends my.one.First {
      protected void do() { System.out.println("Second does"); }
      protected void now() { System.out.println("Second does now"); }
    package my.three;
    public class Three extends my.one.First {
      protected my.one.First obj;
      public Three(my.one.First O) { obj = O; }
      protected void do() { System.out.println("Doing"); }
      protected void now() { obj.now(); } // Not possible, see later text
    Problem is, as one can read in http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html , it says that you cannot access protected members and methods from classes if they are in a different package. However, since my class Three should not concern about the method now() but should use from some other class that implements (i.e. class Second), the question I have is how to do?
    One way would be to implement a class that simply make a forward call to any protected method in the same package the abstract class is in like in class NotWantToHave and pass it to the constructor of class Third while this class was created with an instance of class Second. However, such a call would look very clumsy (new my.three.Third(new my.one.NotWantToHave(new my.two.Second()));). Furthermore, everyone could create an instance of class NotWantToHave and can invoke the methods defined as protected in class First, so the access restriction would be quite useless.
    Does anyone has a good idea how to do?

    Hi
    One way I found is to have a nested, protected static final class in my super-class First and provide a protected static final method that returns a class where all methods of the super-class are made public and thus accessible from sub-classes at will. The only requirement is that a sub-class must invoke this method to encapsulate other implementations of the super-class and never publish the wrapper class instance. This will look as follows:
    package my.one;
    public abstract class First {
      protected final static class Wrap extends First { // extend First to make sure not to forget any abstract method
        protected First F;
        public void do() { F.do(); }
        public void now() { F.now(); }
        protected Wrap(First Obj) { F = Obj; }
      } // end Wrap
      protected final static First.Wrap wrap(First Obj) { return new First.Wrap(Obj); }
      protected abstract void do();
      protected abstract void now();
    } // end First*******
    package my.two;
    public class Second extends my.one.First {
      protected void do() { System.out.println("Second does"); }
      protected void now() { System.out.println("Second does now"); }
    } // end Second*******
    package my.three;
    public class Three extends my.one.First {
      protected my.one.First.Wrap obj;
      public Three(my.one.First O) { obj = my.one.First.wrap(O); }
      protected void do() { System.out.println("Doing"); }
      protected void now() { obj.now(); } // Not possible, see later text
    } // end Third*******
    In this way, I can access all methods in the abstract super class since the Wrap class makes them public while the methods are not accessible from outside the package to i.e. a GUI that uses the protocol.
    However, it still looks clumsy and I would appreciate very much if someone knows a more clear solution.
    And, please, do not tell me that I stand on my rope and wonder why I fall down. I hope I know what I am doing and of course, I know the specification (why else I should mention about the link to the specification and refer to it?). But I am quite sure that I am not the first person facing this problem and I hope someone out there could tell me about their solution.
    My requirements are to access protected methods on sub-classes of a super-class that are not known yet (because they are developed in the far, far future ...) in other sub-classes of the same super-class without make those methods public to not inveigle their usage where they should not be used.
    Thanks

  • Protected method in Final Class

    Hi all
    Can we have protected method in Final class ?
    If so how is it possible ?
    Vicky

    Final classes cannot have subclasses and hence no need of protected methods.
    No comments on possibility.
    Check this link from SAP help to know more :
    http://help.sap.com/saphelp_nw70/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    Hope this helps you.
    Edited by: Harsh Bhalla on Dec 19, 2009 3:35 PM

  • Access of undefined method/property through reference with a static type Class

    I get the following error: (it's not word for word but you get the idea)
    Error: Access of undefined method getStatus through reference with a static type Class.
    Here's what's happening in the code. I'm trying to create a User class that is instantiated at the start of my app. I want the User class to have properties like mainStatus, with helper methods like setStatus etc. Pretty simple.
    so on my HardDisk I have my flash_working folder with all my flash projects. I created my class file/package under the directory com.mypackage
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function User()
                trace("User Created!");
                mainStatus = 0;
            public function setStatus(status:int):void
             mainStatus = status;
        public function getStatus():int
            return mainStatus;
    Ok, so far so good.
    now I created a new .fla file under the root of /flash_working/. The class file is in /com/mypackage/User.as
    in my .fla file I have:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = User.getStatus();
    trace(i);
    That's all the code I have. Could someone please explain why it's giving me that error?
    If I try to access the public var mainStatus through user.mainStatus that gives a similar error saying:
    Error: Access of undefined property mainStatus through reference with a static type Class.
    Thanks for any help!
    jef3189

    the public getStatus() function that you created needs to be referred to through an instance of the class.
    So:
    import com.mypackage.User;
    var myUser:User = new User();
    var i = myUser.getStatus();
    trace(i);
    Also, an aside. You can create a getter/setter for status, to avoid having to do the function as such.
    package com.mypackage
        import flash.display.*;
        public class User extends Sprite
            public var mainStatus:int;
            public function get status():int
                return mainStatus;
            public function set status(value:int):void
                 mainStatus = value as int;
              public function User()
                trace("User Created!");
                mainStatus = 0;
    And then, you can call it as:
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.status);
    EDIT
    I just noticed that you made the variable public as well, which means you can access it without getter/setter or function.
    import com.mypackage.User;
    var myUser:User = new User();
    trace(myUser.mainStatus);

  • How do you call a method from  another class without extending as a parent?

    How do you call a method from another class without extending it as a parent? Is this possible?

    Why don't you just create an instance of the class?
    Car c = new Car();
    c.drive("fast");The drive method is in the car class, but as long as the method is public, you can use it anywhere.
    Is that what you were asking or am I totally misunderstanding your question?
    Jen

  • How to access the text symbols of a class

    Hi Experts,
    Can anyone pl. tell me how to access the text symbols of a class.
    Thanks,
    Uday.

    Hi,
    Please check
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm

  • Java access to protected methods

    Hi,
    I use a java toolkit, and want to access a class (Morphy) in it.
    There is only one constructor function for class Morphy:
    Morphy(WordNet wn).
    And here is the doc of the class Morphy.
    http://nlp.stanford.edu/nlp/javadoc/wn/doc/danbikel/wordnet/Morphy.html
    As some methods in this class are protected, and I will call them.
    Here is my code:
    import danbikel.wordnet.WordNet;
    import danbikel.wordnet.Morphy;
    public class wn extends Morphy {
    public void test(){
    wn a=new wn();
    a.morphWord("running","v"); // it is a protected method in Morphy
    It just report an compile error: cannot find symbol: symbol : constructor Morphy().
    Can anyone tell me how to fix the problem? I don't know how to add the constructor in my code.
    Thanks a lot in advance.

    Read [this tutorial|http://java.sun.com/docs/books/tutorial/java/IandI/super.html] from "subclass constructors" and then think about what
    wn a=new wn();tries to do what it can't do.

  • How to use protected method of a class in application

    Hi,
      will u please tell me how to use protected method of class in application. (class:cl_gui_textcontrol, method:limit_text)
    Thanks in advance,
    Praba.

    Hi Prabha,
    You can set the maximum number of characters in a textedit control in the CREATE OBJECT statement itself.
    Just see the first parameter in the method . I mean MAX_NUMBER_CHARS. Just set that value to the required number.
    Eg:
    data: edit type ref to CL_GUI_TEXTEDIT.
    create object edit
      exporting
        MAX_NUMBER_CHARS       = 10
       STYLE                  = 0
       WORDWRAP_MODE          = WORDWRAP_AT_WINDOWBORDER
       WORDWRAP_POSITION      = -1
       WORDWRAP_TO_LINEBREAK_MODE = FALSE
       FILEDROP_MODE          = DROPFILE_EVENT_OFF
        parent                 = OBJ_CUSTOM_CONTAINER
       LIFETIME               =
       NAME                   =
      EXCEPTIONS
        ERROR_CNTL_CREATE      = 1
        ERROR_CNTL_INIT        = 2
        ERROR_CNTL_LINK        = 3
        ERROR_DP_CREATE        = 4
        GUI_TYPE_NOT_SUPPORTED = 5
        others                 = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    In this case, the max: number of characters will be set to 10.
    I hope your query is solved.
    Regards,
    SP.

  • How to access this.getNewNode() method within addTreeSelectionListener??

    Dear friends,
    I met anoother problem as follows:
    I defined a method called
    setNewNode(NewNode nn){
    getNewNode(){
    return nn;
    I tried to make regerence to this method:
    this.getNewNode();
    if I put this reference this.getNewNode(); outside of following code such as:
    this.getNewNode();
    tree.addTreeSelectionListener(new TreeSelectionListener() {
    everything fine,
    but If I put this.getNewNode(); within following code,
    so cannot pass compile, get error,
    tree.addTreeSelectionListener(new TreeSelectionListener() {
    this.getNewNode();
    now get error,
    How to make a successfule access to this method this.getNewNode() ??
    Thanks a lot.
    sunny
    //this.getNewNode();  // access ok
    tree.addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent evt) {
               // this.getNewNode();  // error, can not refer to this method.
                // Get all nodes whose selection status has changed
                TreePath[] paths = evt.getPaths();
                // Iterate through all affected nodes
                for (int i=0; i<paths.length; i++) {
                    if (evt.isAddedPath(i)) {
                        // This node has been selected
                    } else {
                        // This node has been deselected
        });

    good point, but it seems that
    OuterClassName.this.getNewNode() did not work,
    only OuterClassName.getNewNode() is acceptable.
    thanksThat indicates you must have made getNewNode() static. Glad it's working though...

  • How to access a static method inside the JSP page

    Here i had wrote the code in java to access databases , i had include the class path to all the class files.
    my problem is when i click the register.jsp page, it will pose eror as null pointer exception i've put my code in this section as follows
    memberchecking.jsp
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,businessclasses.*,businessobjects.*,projectutils.DateUtilities.*,java.util.*" errorPage="" %>
    <html>
    <head>
    <title>Checking Member's Registration Details...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    String loginId = request.getParameter("loginId");
    String resourcePassword = request.getParameter("resourcePassword");
    String confirmPassword = request.getParameter("confirmPassword");
    String resourceStatus=request.getParameter("resourceStatus");
    String nameTitle = request.getParameter("nameTitle");
    String jobTitle = request.getParameter("jobTitle");
    String firstName = request.getParameter("firstName");
    String middleName = request.getParameter("middleName");
    String lastName = request.getParameter("lastName");
    String displayName = request.getParameter("displayName");
    String resourceInitials = request.getParameter("resourceIniitials");
    String countryCode = request.getParameter("countryCode");
    String resourceLanguage = request.getParameter("resourceLanguage");
    //String resourceCurrency = request.getParameter("resourceCurrency");
    String resourceEmail2 = request.getParameter("resourceEmail2");
    String birthMonth = request.getParameter("birthMonth");
    String birthDay = request.getParameter("birthDay");
    String birthYear = request.getParameter("birthYear");
    String resourceGender = request.getParameter("resourceGender");
    String martialStatus = request.getParameter("martialStatus");
    String resourceOccupation = request.getParameter("resourceOccupation");
    String webPage = request.getParameter("webPage");
    String homePhone = request.getParameter("homePhone");
    String homePhone2 = request.getParameter("homephone2");
    String homeFax = request.getParameter("homepFax");
    String phoneOffice = request.getParameter("phoneOffice");
    String phoneOffice2 = request.getParameter("phoneOffice2");
    String officeFax = request.getParameter("officeFax");
    String resourcePager = request.getParameter("resourcePager");
    String resourceMobile = request.getParameter("resourceMobile");
    String resourceType=request.getParameter("resourceType");
    String resourceName = firstName + " " + middleName + " " + lastName;
    //java.util.Date resourceBirthDate = (String)birthMonth + "/" + birthDay + "/" + birthYear;
    session.setAttribute("Name",resourceName);
    session.setAttribute("UserId",loginId);
    out.println("name==========="+resourceName);
    //check whether the input data is valid for insert
    //input validation code goes here.....
    ResourceBC aResourceBC=new ResourceBC();
    //marshall the resource
    ResourceBO resource=new ResourceBO();
    String e1 = (String)resource.getEmail();
    String e2 = (String)resource.getEmail2();
    if(loginId != e1 && resourceEmail2 != e2 ) {
              resource.setStatus( "L");
              resource.setId(5);
              resource.setCountryCode(countryCode);
         //     resource.setResourceTypeCode(resourceType);     
         //     resource.setResourceParent(rs.getLong(6));
         //     resource.setHKey(rs.getLong(7));          
              resource.setName(resourceName);
              resource.setDisplayName(displayName);
              resource.setLogonPassword(resourcePassword);
              resource.setNameTitle(nameTitle);
              resource.setJobTitle(jobTitle);
              resource.setEmail(loginId);
              resource.setEmail2(resourceEmail2);          
         //     resource.setPasswordUpdateDate(rs.getDate(14));
         //     resource.setPasswordExpireDate(rs.getDate(15));
         //     resource.setAccessCode(rs.getString(16));
         //     resource.setLogonUnSuccessTries(0);
              resource.setWebPage(webPage);
              resource.setPhoneOffice(phoneOffice);
              resource.setPhoneOffice2(phoneOffice2);
              resource.setPhoneOfficeFax(officeFax);
              resource.setPhoneHome(homePhone);
              resource.setPhoneHome2(homePhone2);
              resource.setPhoneHomeFax(homeFax);
              resource.setMobile(resourceMobile);
              resource.setPager(resourcePager);
              resource.setStatus(resourceStatus);     
              resource.setGender(resourceGender);     
         //     resource.setBirthDate(resourceBirthDate);
              resource.setMartialStatus(martialStatus);
              resource.setLanguage(resourceLanguage);
    //          resource.setCurrency(resourceCurrency);
    //          resource.setPhoto(photo);
              resource.setInitials(resourceInitials);                         
    //          resource.setCreatedBy(1);
    //          resource.setCreatedDate(rs.getDate(36));
    //          resource.setUpdatedBy(rs.getLong(37));
    //          resource.setUpdatedDate(rs.getDate(38));
              resource.setFirstName(firstName);
              resource.setLastName(lastName);
              resource.setMiddleName(middleName);     
              //resource.setCreatedDate(new java.sql.Date());
              int rowsAdded=aResourceBC.resourceAdd(resource);
              out.println("rowsAdded= "+rowsAdded);
              //add message for success or failure to add resource
              String msg="";
              if(rowsAdded == -1){
                   msg="<font color=red>The ResourceName already exists .Try another</font>";
                   session.setAttribute("message",msg);
                   response.sendRedirect(response.encodeRedirectURL("memberregister.jsp"));
              else if(rowsAdded > 0){
                   msg="<font color=green>Resource Added successfully..........</font>";     
                   session.setAttribute("message",msg);
    %>
                   <jsp:forward page="memberlist.jsp">
                   <jsp:param name="message" value="<%=msg%>"/>
                   </jsp:forward>
    <%}
    %>
    </body>
    </html>
    ResourceBC.java
    package businessclasses;
    import java.sql.*;
    import businessobjects.ResourceBO;
    import java.util.*;
    import dbutilities.DBManager;
    public class ResourceBC
         public Vector resourceList() throws Exception{
         Vector resourceList=new Vector();
         String listSQL="";
         StringBuffer listSQLBuffer=new StringBuffer();
         listSQLBuffer.append("SELECT ");
         listSQLBuffer.append("RES_ID,");
         listSQLBuffer.append("RES_NAME,");
         listSQLBuffer.append("CNTRY_CODE,");
         listSQLBuffer.append("RES_LOGON_PASSWORD,");
         listSQLBuffer.append("RESTYPE_CODE,");
         listSQLBuffer.append("RES_PARENT,");
         listSQLBuffer.append("RES_HKEY,");
         listSQLBuffer.append("RES_DISPLAY_NAME,");
         listSQLBuffer.append("RES_NAME_TITLE,");     
         listSQLBuffer.append("RES_JOB_TITLE,");     
         listSQLBuffer.append("RES_EMAIL,");
         listSQLBuffer.append("RES_EMAIL2,");     
         listSQLBuffer.append("RES_PASSWORD_ACTION,");     
         listSQLBuffer.append("RES_PASSWORD_UPDATE_DATE,");     
         listSQLBuffer.append("RES_PASSWORD_EXPIRE_DATE,");     
         listSQLBuffer.append("RES_ACCESS_CODE,");     
         listSQLBuffer.append("RES_LOGON_UNSUCCESS_TRIES,");     
         listSQLBuffer.append("RES_WEB_PAGE,");
         listSQLBuffer.append("RES_PHONE_OFFICE,");
         listSQLBuffer.append("RES_PHONE_OFFICE2,");
         listSQLBuffer.append("RES_PHONE_OFFICE_FAX,");
         listSQLBuffer.append("RES_PHONE_HOME,");
         listSQLBuffer.append("RES_PHONE_HOME2,");
         listSQLBuffer.append("RES_PHONE_HOME_FAX,");
         listSQLBuffer.append("RES_MOBILE,");
         listSQLBuffer.append("RES_PAGER,");
         listSQLBuffer.append("RES_STATUS,");
         listSQLBuffer.append("RES_GENDER,");
         listSQLBuffer.append("RES_BIRTH_DATE,");
         listSQLBuffer.append("RES_MARTIAL_STATUS,");
         listSQLBuffer.append("RES_LANGUAGE,");
         listSQLBuffer.append("RES_CURRENCY,");
         listSQLBuffer.append("RES_PHOTO,");
         listSQLBuffer.append("RES_CREATED_BY,");
         listSQLBuffer.append("RES_NAME_INITIALS,");          
         listSQLBuffer.append("RES_CREATED_DATE,");
         listSQLBuffer.append("RES_UPDATED_BY");
         listSQLBuffer.append("RES_UPDATED_DATE,");
         listSQLBuffer.append("RES_NAME_FIRST,");
         listSQLBuffer.append("RES_NAME_LAST,");
         listSQLBuffer.append("RES_NAME_MIDDLE");     
         listSQLBuffer.append(" FROM T_RESOURCES ");
         listSQL=listSQLBuffer.toString();
    System.out.println("listSQL---"+listSQL);
         DBManager dbManager=new DBManager();
         Connection con =dbManager.getConnection();
         Statement stmt=con.createStatement();
         ResultSet rs=stmt.executeQuery(listSQL);
         ResourceBO resource=null;
         while(rs.next()){
              resource=new ResourceBO();
              resource.setId(rs.getLong(1));
              resource.setName(rs.getString(2));
              resource.setCountryCode(rs.getString(3));
              resource.setLogonPassword(rs.getString(4));
              resource.setResourceTypeCode(rs.getLong(5));     
              resource.setResourceParent(rs.getLong(6));
              resource.setHKey(rs.getLong(7));          
              resource.setDisplayName(rs.getString(8));
              resource.setNameTitle(rs.getString(9));
              resource.setJobTitle(rs.getString(10));
              resource.setEmail(rs.getString(11));
              resource.setEmail2(rs.getString(12));          
              resource.setPasswordAction(rs.getString(13));
              resource.setPasswordUpdateDate(rs.getDate(14));
              resource.setPasswordExpireDate(rs.getDate(15));
              resource.setAccessCode(rs.getString(16));
              resource.setLogonUnSuccessTries(rs.getLong(17));
              resource.setWebPage(rs.getString(18));
              resource.setPhoneOffice(rs.getString(19));
              resource.setPhoneOffice2(rs.getString(20));
              resource.setPhoneOfficeFax(rs.getString(21));
              resource.setPhoneHome(rs.getString(22));
              resource.setPhoneHome2(rs.getString(23));
              resource.setPhoneHomeFax(rs.getString(24));
              resource.setMobile(rs.getString(25));
              resource.setPager(rs.getString(26));
              resource.setStatus(rs.getString(27));     
              resource.setGender(rs.getString(28));     
              resource.setBirthDate(rs.getDate(29));
              resource.setMartialStatus(rs.getString(30));
              resource.setLanguage(rs.getString(31));
              resource.setCurrency(rs.getString(32));
              resource.setPhoto(rs.getString(33));
              resource.setCreatedBy(rs.getLong(34));
              resource.setInitials(rs.getString(35));                         
              resource.setCreatedDate(rs.getDate(36));
              resource.setUpdatedBy(rs.getLong(37));
              resource.setUpdatedDate(rs.getDate(38));
              resource.setFirstName(rs.getString(39));
              resource.setLastName(rs.getString(40));
              resource.setMiddleName(rs.getString(41));          
              resourceList.add(resource);
              con.close();
              con=null;
              return resourceList;
    //Method to insert the values into the database
    public int resourceAdd(ResourceBO resource){
         System.out.println("in resourceAdd method ");
         //check for duplicate record in the table
         String checkDuplicationSQL="SELECT RES_ID FROM T_RESOURCES WHERE RES_ID='"+resource.getId()+"'";     
         DBManager dbManager=new DBManager();//.getInstance();
         boolean hasDuplicateRecord=dbManager.hasDuplicateRecord(checkDuplicationSQL);
         int rowsAdded=0;
         //insert the record
         //hasDuplicateRecord=false;
              if(!hasDuplicateRecord){
                   //get the next resource id for insertion
              long nextID=dbManager.getNextIDForColumnAndTable("RES_ID","T_RESOURCES");
              System.out.println("nextID================== "+nextID);
    StringBuffer fieldsbuffer=new StringBuffer();
         fieldsbuffer.append("INSERT INTO T_RESOURCES (");
         fieldsbuffer.append("RES_ID,");
         fieldsbuffer.append("RES_NAME,");
         fieldsbuffer.append("CNTRY_CODE,");
         fieldsbuffer.append("RES_LOGON_PASSWORD,");
         fieldsbuffer.append("RESTYPE_CODE,");     
         fieldsbuffer.append("RES_PARENT,");
         fieldsbuffer.append("RES_HKEY,");
         fieldsbuffer.append("RES_DISPLAY_NAME,");     
         fieldsbuffer.append("RES_NAME_TITLE,");
         fieldsbuffer.append("RES_JOB_TITLE,");
         fieldsbuffer.append("RES_EMAIL,");
         fieldsbuffer.append("RES_EMAIL2,");
         fieldsbuffer.append("RES_PASSWORD_ACTION,");
         fieldsbuffer.append("RES_PASSWORD_UPDATE_DATE,");          
         fieldsbuffer.append("RES_PASSWORD_EXPIRE_DATE,");          
         fieldsbuffer.append("RES_ACCESS_CODE,");          
         fieldsbuffer.append("RES_LOGON_UNSUCCESS_TRIES,");     
         fieldsbuffer.append("RES_WEB_PAGE,");
         fieldsbuffer.append("RES_PHONE_OFFICE,");
         fieldsbuffer.append("RES_PHONE_OFFICE2,");
         fieldsbuffer.append("RES_PHONE_OFFICE_FAX,");
         fieldsbuffer.append("RES_PHONE_HOME,");
         fieldsbuffer.append("RES_PHONE_HOME2,");
         fieldsbuffer.append("RES_PHONE_HOME_FAX,");
         fieldsbuffer.append("RES_MOBILE,");
         fieldsbuffer.append("RES_PAGER,");
         fieldsbuffer.append("RES_STATUS,");     
         fieldsbuffer.append("RES_GENDER,");     
         fieldsbuffer.append("RES_BIRTH_DATE,");          
         fieldsbuffer.append("RES_MARTIAL_STATUS,");          
         fieldsbuffer.append("RES_LANGUAGE,");          
         fieldsbuffer.append("RES_CURRENCY,");          
         fieldsbuffer.append("RES_PHOTO,");     
    /*     fieldBuffer.append("RES_CREATED_BY,");
         fieldBuffer.append("RES_NAME_INITIALS,");          
         fieldBuffer.append("RES_CREATED_DATE,");
         fieldBuffer.append("RES_UPDATED_BY");
         fieldBuffer.append("RES_UPDATED_DATE,");
         fieldBuffer.append("RES_NAME_FIRST,");
         fieldBuffer.append("RES_NAME_LAST,");
         fieldBuffer.append("RES_NAME_MIDDLE");     */
         StringBuffer valuesBuffer=new StringBuffer(" VALUES(");
    valuesBuffer.append(nextID+",");
         valuesBuffer.append("'"+resource.getName()+",");
         valuesBuffer.append("'"+resource.getCountryCode()+",");
         valuesBuffer.append("'"+resource.getLogonPassword()+"',");
         valuesBuffer.append("'"+resource.getResourceTypeCode()+",");
         valuesBuffer.append("'"+resource.getResourceParent()+",");
         valuesBuffer.append("'"+resource.getHKey()+",");
         valuesBuffer.append("'"+resource.getDisplayName()+",");
         valuesBuffer.append("'"+resource.getNameTitle()+",");
         valuesBuffer.append("'"+resource.getJobTitle()+",");
         valuesBuffer.append("'"+resource.getEmail()+"',");
         valuesBuffer.append("'"+resource.getEmail2()+"',");
         valuesBuffer.append("'"+resource.getPasswordAction()+",");
         valuesBuffer.append("'"+resource.getPasswordUpdateDate()+",");
         valuesBuffer.append("'"+resource.getPasswordExpireDate()+",");
         valuesBuffer.append("'"+resource.getAccessCode()+",");
         valuesBuffer.append("'"+resource.getLogonUnsuccessTries()+",");     
         valuesBuffer.append("'"+resource.getWebPage()+"',");
         valuesBuffer.append("'"+resource.getPhoneOffice()+"',");
         valuesBuffer.append("'"+resource.getPhoneOffice2()+"',");
         valuesBuffer.append("'"+resource.getPhoneOfficeFax()+"',");
         valuesBuffer.append("'"+resource.getPhoneHome()+"',");
         valuesBuffer.append("'"+resource.getPhoneHome2()+"',");
         valuesBuffer.append("'"+resource.getPhoneHomeFax()+"',");
         valuesBuffer.append("'"+resource.getMobile()+"',");
         valuesBuffer.append("'"+resource.getPager()+"',");
         valuesBuffer.append("'"+resource.getStatus()+"',");
         valuesBuffer.append("'"+resource.getGender()+"',");
         valuesBuffer.append("'"+resource.getBirthDate()+"',");
         valuesBuffer.append("'"+resource.getMartialStatus()+"',");
         valuesBuffer.append("'"+resource.getLanguage()+"',");
         valuesBuffer.append("'"+resource.getCurrency()+"',");
         valuesBuffer.append("'"+resource.getPhoto()+"',");
         valuesBuffer.append("'"+resource.getCreatedBy()+"',");
         valuesBuffer.append("'"+resource.getInitials()+"',");
         valuesBuffer.append("'"+resource.getCreatedDate()+"',");
         valuesBuffer.append("'"+resource.getUpdatedBy()+"',");
         valuesBuffer.append("'"+resource.getUpdatedDate()+"',");
         valuesBuffer.append("'"+resource.getFirstName()+"',");
         valuesBuffer.append("'"+resource.getLastName()+"',");
         valuesBuffer.append("'"+resource.getMiddleName()+"')");
         String insertSQL=fieldsbuffer.toString()+valuesBuffer.toString();
              System.out.println("insertSQL="+insertSQL);
              rowsAdded=dbManager.executeSQL(insertSQL);
              System.out.println("rowsAdded= "+rowsAdded+"hasDuplicateRecord "+hasDuplicateRecord);
              }//end if
              else{
                   //throw new Exception("Has a duplicate Record");
                   return -1;
              return rowsAdded;
    public int resourceUpdate(ResourceBO resource){
              int rowsUpdated=0;
    /*          String orgCodeStr=null;
              if(resource.getOrgCode()==0){
                   orgCodeStr="NULL";
         }else{
                   orgCodeStr=""+resource.getOrgCode();
              StringBuffer updateSQLBuffer=new StringBuffer();
         updateSQLBuffer.append("UPDATE T_RESOURCES SET ");          
         updateSQLBuffer.append("RES_NAME='"+resource.getName()+"',");
         updateSQLBuffer.append("CNTRY_CODE='"+resource.getCountryCode()+"',");
         updateSQLBuffer.append("RES_LOGON_PASSWORD='"+resource.getLogonPassword()+"',");
         updateSQLBuffer.append("RESTYPE_CODE="+resource.getResourceTypeCode()+",");
         updateSQLBuffer.append("RES_PARENT="+resource.getResourceParent()+",");
         updateSQLBuffer.append("RES_HKEY="+resource.getHKey()+",");
         updateSQLBuffer.append("RES_DISPLAY_NAME="+resource.getDisplayName()+",");
         updateSQLBuffer.append("RES_NAME_TITLE="+resource.getNameTitle()+",");
         updateSQLBuffer.append("RES_JOB_TITLE="+resource.getJobTitle()+",");
         updateSQLBuffer.append("RES_EMAIL='"+resource.getEmail()+"',");
         updateSQLBuffer.append("RES_EMAIL2='"+resource.getEmail2()+"',");
         updateSQLBuffer.append("RES_PASSWORD_ACTION="+resource.getPasswordAction()+",");
         updateSQLBuffer.append("RES_PASSWORD_UPDATE_DATE="+resource.getPasswordUpdateDate()+",");
         updateSQLBuffer.append("RES_PASSWORD_EXPIRE_DATE="+resource.getPasswordExpireDate()+",");
         updateSQLBuffer.append("RES_ACCESS_CODE="+resource.getAccessCode()+",");
         updateSQLBuffer.append("RES_LOGON_UNSUCCESS_TRIES="+resource.getLogonUnsuccessTries()+",");     
         updateSQLBuffer.append("RES_WEB_PAGE='"+resource.getWebPage()+"',");
         updateSQLBuffer.append("RES_PHONE_OFFICE='"+resource.getPhoneOffice()+"',");
         updateSQLBuffer.append("RES_PHONE_OFFICE2='"+resource.getPhoneOffice2()+"',");
         updateSQLBuffer.append("RES_PHONE_OFFICE_FAX='"+resource.getPhoneOfficeFax()+"',");
         updateSQLBuffer.append("RES_PHONE_HOME='"+resource.getPhoneHome()+"',");
         updateSQLBuffer.append("RES_PHONE_HOME2='"+resource.getPhoneHome2()+"',");
         updateSQLBuffer.append("RES_PHONE_HOME_FAX='"+resource.getPhoneHomeFax()+"',");
         updateSQLBuffer.append("RES_MOBILE='"+resource.getMobile()+"',");
         updateSQLBuffer.append("RES_PAGER='"+resource.getPager()+"',");
         updateSQLBuffer.append("RES_STATUS='"+resource.getStatus()+"',");
         updateSQLBuffer.append("RES_GENDER='"+resource.getGender()+"',");
         updateSQLBuffer.append("RES_BIRTH_DATE='"+resource.getBirthDate()+"',");
         updateSQLBuffer.append("RES_MARTIAL_STATUS='"+resource.getMartialStatus()+"',");
         updateSQLBuffer.append("RES_LANGUAGE='"+resource.getLanguage()+"',");
         updateSQLBuffer.append("RES_CURRENCY='"+resource.getCurrency()+"',");
         updateSQLBuffer.append("RES_PHOTO='"+resource.getPhoto()+"',");
         updateSQLBuffer.append("RES_NAME_INITIALS='"+resource.getInitials()+"',");
         updateSQLBuffer.append("RES_NAME_FIRST='"+resource.getFirstName()+"',");
         updateSQLBuffer.append("RES_NAME_LAST='"+resource.getLastName()+"',");
         updateSQLBuffer.append("RES_NAME_MIDDLE='"+resource.getMiddleName()+"'");
         updateSQLBuffer.append("WHERE RES_ID="+resource.getId());
         String updateSQL=updateSQLBuffer.toString();
              //String updateSQL="UPDATE T_RESOURCES SET CLIENT_NAME='"+resource.getName()+"',CLIENT_STATUS='"+resource.getStatus()+"',CLIENT_EMAIL_PRIMARY='"+resource.getEmailPrimary()+"',CLIENT_EMAIL_ALTERNATIVE='"+resource.getEmailAlternate()+"',CLIENT_CURRENCY_SYMBOL='"+resource.getCurrencySymbol()+"',CLIENT_CURRENCY_DIGITS="+resource.getCurrencyDigits()+",CLIENT_DIRECTORY_DOCUMENT='"+resource.getDirectoryDocument()+"',CLIENT_DIRECTORY_TEMPLATE='"+resource.getDirectoryTemplate()+"',CLIENT_STORAGE_QUOTA="+resource.getStorageQuota()+",CLIENT_KEY='"+resource.getKey()+"' WHERE CLIENT_ID="+resource.getId();
              System.out.println("updateSQL---"+updateSQL);
              DBManager dbManager=new DBManager();
              rowsUpdated=dbManager.executeSQL(updateSQL);
              return rowsUpdated;
    public int resourceDelete(long resourceId){
              int rowsDeleted=0;
              DBManager dbManager=new DBManager();
              String deleteSQL="DELETE FROM T_RESOURCES WHERE RES_ID="+resourceId;
              System.out.println("deleteSQL==="+deleteSQL);
              rowsDeleted=dbManager.executeSQL(deleteSQL);
              System.out.println("rowsDeleted= "+rowsDeleted);
              return rowsDeleted;
    public ResourceBO getResourceById(long resourceId)throws Exception{
              StringBuffer selectSQLBuffer=new StringBuffer();
              selectSQLBuffer.append("SELECT ");
              selectSQLBuffer.append("RES_ID,");
              selectSQLBuffer.append("RES_NAME,");
              selectSQLBuffer.append("CNTRY_CODE,");
              selectSQLBuffer.append("RES_LOGON_PASSWORD,");
              selectSQLBuffer.append("RESTYPE_CODE,");
              selectSQLBuffer.append("RES_PARENT,");
              selectSQLBuffer.append("RES_HKEY,");
              selectSQLBuffer.append("RES_DISPLAY_NAME,");
              selectSQLBuffer.append("RES_NAME_TITLE,");          
              selectSQLBuffer.append("RES_JOB_TITLE,");     
              selectSQLBuffer.append("RES_EMAIL,");
              selectSQLBuffer.append("RES_EMAIL2,");     
              selectSQLBuffer.append("RES_PASSWORD_ACTION,");     
              selectSQLBuffer.append("RES_PASSWORD_UPDATE_DATE,");     
              selectSQLBuffer.append("RES_PASSWORD_EXPIRE_DATE,");     
              selectSQLBuffer.append("RES_ACCESS_CODE,");     
              selectSQLBuffer.append("RES_LOGON_UNSUCCESS_TRIES,");     
              selectSQLBuffer.append("RES_WEB_PAGE,");
              selectSQLBuffer.append("RES_PHONE_OFFICE,");
              selectSQLBuffer.append("RES_PHONE_OFFICE2,");
              selectSQLBuffer.append("RES_PHONE_OFFICE_FAX,");
              selectSQLBuffer.append("RES_PHONE_HOME,");
              selectSQLBuffer.append("RES_PHONE_HOME2,");
              selectSQLBuffer.append("RES_PHONE_HOME_FAX,");
              selectSQLBuffer.append("RES_MOBILE,");
              selectSQLBuffer.append("RES_PAGER,");
              selectSQLBuffer.append("RES_STATUS,");
              selectSQLBuffer.append("RES_GENDER,");
              selectSQLBuffer.append("RES_BIRTH_DATE,");
              selectSQLBuffer.append("RES_MARTIAL_STATUS,");
              selectSQLBuffer.append("RES_LANGUAGE,");
              selectSQLBuffer.append("RES_CURRENCY,");
              selectSQLBuffer.append("RES_PHOTO,");
              selectSQLBuffer.append("RES_CREATED_BY,");
              selectSQLBuffer.append("RES_NAME_INITIALS,");          
              selectSQLBuffer.append("RES_CREATED_DATE,");
              selectSQLBuffer.append("RES_UPDATED_BY");
              selectSQLBuffer.append("RES_UPDATED_DATE,");
              selectSQLBuffer.append("RES_NAME_FIRST,");
              selectSQLBuffer.append("RES_NAME_LAST,");
              selectSQLBuffer.append("RES_NAME_MIDDLE");     
              selectSQLBuffer.append(" FROM T_RESOURCES WHERE RES_ID="+resourceId);
              String fetchSQL=selectSQLBuffer.toString();
    System.out.println("fetchSQL---"+fetchSQL);
                   DBManager dbManager=new DBManager();
                   Connection con =dbManager.getConnection();
                   Statement stmt=con.createStatement();
                   ResultSet rs=stmt.executeQuery(fetchSQL);
                   ResourceBO resource=new ResourceBO();
                   while(rs.next()){                    
                   resource.setId(rs.getLong(1));
                   resource.setName(rs.getString(2));
                   resource.setCountryCode(rs.getString(3));
                   resource.setLogonPassword(rs.getString(4));
                   resource.setResourceTypeCode(rs.getLong(5));     
                   resource.setResourceParent(rs.getLong(6));
                   resource.setHKey(rs.getLong(7));          
                   resource.setDisplayName(rs.getString(8));
                   resource.setNameTitle(rs.getString(9));
                   resource.setJobTitle(rs.getString(10));
                   resource.setEmail(rs.getString(11));
                   resource.setEmail2(rs.getString(12));          
                   resource.setPasswordAction(rs.getString(13));
                   resource.setPasswordUpdateDate(rs.getDate(14));
                   resource.setPasswordExpireDate(rs.getDate(15));
                   resource.setAccessCode(rs.getString(16));
                   resource.setLogonUnSuccessTries(rs.getLong(17));
                   resource.setWebPage(rs.getString(18));
                   resource.setPhoneOffice(rs.getString(19));
                   resource.setPhoneOffice2(rs.getString(20));
                   resource.setPhoneOfficeFax(rs.getString(21));
                   resource.setPhoneHome(rs.getString(22));
                   resource.setPhoneHome2(rs.getString(23));
                   resource.setPhoneHomeFax(rs.getString(24));
                   resource.setMobile(rs.getString(25));
                   resource.setPager(rs.getString(26));
                   resource.setStatus(rs.getString(27));     
                   resource.setGender(rs.getString(28));     
                   resource.setBirthDate(rs.getDate(29));
                   resource.setMartialStatus(rs.getString(30));
                   resource.setLanguage(rs.getString(31));
                   resource.setCurrency(rs.getString(32));
                   resource.setPhoto(rs.getString(33));
                   resource.setCreatedBy(rs.getLong(34));
                   resource.setInitials(rs.getString(35));                         
                   resource.setCreatedDate(rs.getDate(36));
                   resource.setUpdatedBy(rs.getLong(37));
                   resource.setUpdatedDate(rs.getDate(38));
                   resource.setFirstName(rs.getString(39));
                   resource.setLastName(rs.getString(40));
                   resource.setMiddleName(rs.getString(41));          
                   con.close();
                   con=null;
                   return resource;
    }//end of class
    plz help me to solve this problem....
    rajkumar

    The JSP wil be converted into a java file and then compiled into a class. If you are using tomcat, the java file will be somewhere in the work folder of your tomcat installation. Find the java file and check the line that is reported in the exception to see where the null-pointer is coming from.

Maybe you are looking for

  • How do I find my Netbook's system specs?

    I purchased a Netbook from Lenovo.com last month. I custom configured it when I bought it. I am simply trying to find the exact specs of the system that I ordered and I am having a difficult time finding a list of exact system details. For example, m

  • Add text to downloaded CSV file

    Hi. I'm trying to place a text at the bottom of the csv file, but I can not find the way to do it. What I'm trying to do is, after all rows downloaded in my csv file, I'd like to place a general comment in the next row regarding some information abou

  • Out put to Excel from Reports

    hi all, Our current Reports version is Report Builder 6.0.8.22.0. We are having a report with 4 level grouping. When we generated Excel output, the data in excel is coming as follows :- The first 3 groups of data is coming in the first row and the 4t

  • Copy  of standard SAP MC1 Report

    Hi All, I copied the standard SAP MC1 report i.e. RMCB0100. In this report they show the data according to month for that they have select option o selection screen i.e. MONTH I want the report according to period. for that I replace the moth by peri

  • SAP - XI -Barcode system

    Hi, I have a requirement. As soon as a new PO gets generated in my SAP ECC the data should flow to a barcode system for some processing. I would like to know how can i do it with or without XI ...? Please help...