How to get protected method ?

I thought i can get protected method of my class when calling a Class.getMethod(String, Class []) in another class which inside the same package. However, it seem that i can't do that because it throw me a NoSuchMethodException when the method was protected. I thought all classes in same package can access the protected methods or fields of each other ??? Why ?
So, how i'm able to get the protected method in runtime ? (Hopefully no need to do anything with the SecurityManager)

It is working
Pls try the following program ...
public class p1 {
public static void main(String as[]) {
p2 ps2 = new p2();
ps2.abc();
class p2 {
protected void abc() {
System.out.println("Hello");
regards,
namanc

Similar Messages

  • How to get protected fields

    Hello,
    I don't know how to get protected fields that a class inherits from its superclass through reflexion ... the getDeclaredFields method seems not working ...
    here is my test program:
    import java.io.File;
    import java.lang.reflect.Field;
    public class Test {
         public static void main(String[] args) {
              Field [] fieldList = SubClass.class.getDeclaredFields();
              for (Field field: fieldList) {
                   field.setAccessible(true);
                   System.out.println (field.getName());
         static class SuperClass {
              protected File file;
              public SuperClass () {
                   file = new File ("a.txt");
         static class SubClass {
              private File myfile;
              public SubClass () {
                   myfile = new File ("b.txt");
    The output is
    myfile
    This means, the getDeclaredField method of the SubClass returns only fields declared by this class, not protected fields declared by its superclass.
    Anyone has an idea to fix the problem, please help me. Thank you a lot
    }

    That's not a problem, the documentation specifically says that getDeclaredFields() only returns fields from this class. If you want fields from the superclass, why not just getSuperclass().getDeclaredFields()?

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • 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.

  • Not sure how to use protected method in arraylisy

    Hi,
    Im wondering how to use the removeRange method in java arraylist, its a protected method which returns void.
    http://java.sun.com/j2se/1.3/docs/api/java/util/ArrayList.html#removeRange(int,%20int)
    So if my class extends Arraylist i should be able to call the method but the compiler states that it still has protected access in arraylist. Does this mean im still overriding the method in arraylist ? A little explanation of whats happeneing would be appreciated as much as an answer
    thanks

    In this codefinal class myClass extends java.util.ArrayList {
        private ArrayList array = new ArrayList();
        public myClass(ArrayList ary){
            for(int i=0;i<7;i++) {
                array.add(ary.get(i));
            ary.removeRange(0,7)
    }You are defining a class called myClass which extends ArrayList.
    You have a member variable called array which is an ArrayList
    You have a constructor which takes a parameter called ary which is an ArrayList
    Since ary is an ArrayList, you cannot call it's removeRange() method unless myClass is in the java.util package. Do not put your class in the java.util package.
    It seems like what you want to do is to move the items in one ArrayList to another ArrayList rather than copying them. I wrote a program to do this. Here it isimport java.util.*;
    public class Test3 {
      public static void main(String[] args) {
        MyClass myClass = new MyClass();
        for (int i=0; i<5; i++) myClass.add("Item-"+i);
        System.out.println("------ myClass loaded -------");
        for (int i=0; i<myClass.size(); i++) System.out.println(myClass.get(i));
        MyClass newClass = new MyClass(myClass);
        System.out.println("------ newClass created -------");
        for (int i=0; i<newClass.size(); i++) System.out.println(newClass.get(i));
        System.out.println("------ myClass now contains -------");
        for (int i=0; i<myClass.size(); i++) System.out.println(myClass.get(i));
    class MyClass extends java.util.ArrayList {
        public MyClass() {}
        public MyClass(MyClass ary){
            for(int i=0;i<ary.size();i++) add(ary.get(i));
            ary.removeRange(0,ary.size());
    }You should notice now that I don't create an ArrayList anywhere. Everything is a MyClass. By the way, class names are normally capitalized, variable names are not. Hence this line
    MyClass myClass = new MyClass();
    In the code above I create an empty MyClass and then populate it with 5 items and then print that list. Then I create a new MyClass using the constructor which takes a MyClass parameter. This copies the items from the parameter list into the newly created MyClass (which is an ArrayList) and then removes the items from the MyClass passed as a parameter. Back in the main() method, I then print the contents of the two MyClass objects.
    One thing which may be a little confusing is this line.
    for(int i=0;i<ary.size();i++) add(ary.get(i));
    the add() call doesn't refer to anything. What it really refers to is the newly created MyClass object which this constructor is building. This newly created object is the 'this' object. So the line above could be rewritten as
    for(int i=0;i<ary.size();i++) this.add(ary.get(i));
    Hopefully this helps a little. The problems you seem to be having are associated with object oriented concepts. You might try reading this
    http://sepwww.stanford.edu/sep/josman/oop/oop1.htm

  • How to use protected method of a particular class described in API

    I read in some forum that for accessing protected method reflcetion should be used. If I'm not wrong then how can I use reflection to access such methods and if reflection isn't the only way then what is another alternative. Please help me...
    regards,
    Jay

    I read in some forum that for accessing protected
    method reflcetion should be used. If I'm not wrong
    then how can I use reflection to access such methods
    and if reflection isn't the only way then what is
    another alternative. Please help me...Two ways:
    - either extend that class
    - or don't use it at all
    If you use reflection, you're very likely to break something. And not only the design. Remember that the method is supposed to be inaccessible for outside classes.

  • 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.

  • How to get main method running in JavaApplet?

    We're currently building a Java Applet with JBuilder5. We can get the event handlers to work, but the we can't get the main method running. What is the problem? Any suggestions?
    Thanks for any helps!
    Miska

    I've searched the tutorials, but they don't say anything to me. Here's the code, it's a bit long but anyway... Could you tell what I should do next? How to use the threads and so on...
    Here's the code:
    package simu;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    public class Simulaattori extends Applet {
    boolean isStandalone = false;
    Button SIMtilaButton = new Button();
    Button VNStilaButton = new Button();
    Button kaasuButton = new Button();
    Button jarruButton = new Button();
    Label asetuslabel = new Label();
    TextField asetusarvoTextField = new TextField();
    Button asetusplusButton = new Button();
    Button asetusmiinusButton = new Button();
    Label nollaatrippilabel = new Label();
    Label trippilabel = new Label();
    Label matkalabel = new Label();
    Button ClrButton = new Button();
    TextField trippimatkaTextField = new TextField();
    TextField kokomatkaTextField = new TextField();
    Label nopeuslabel = new Label();
    TextField nopeusTextField = new TextField();
    Label KaasuJaJarrulabel = new Label();
    TextField kaasujajarruTextField = new TextField();
    /**Get a parameter value*/
    public String getParameter(String key, String def) {
    return isStandalone ? System.getProperty(key, def) :
    (getParameter(key) != null ? getParameter(key) : def);
    //Muuttujat
    boolean isSIM_ON;
    boolean isVNS_ON;
    boolean OnkoPoljettu;
    double asetusarvo;
    double voima;
    /**Construct the applet*/
    public Simulaattori() {
    isSIM_ON = false;
    isVNS_ON = false;
    OnkoPoljettu = false;
    voima = 0;
    asetusarvo = 0;
    DisableButtons_SimOff();
    /**Initialize the applet*/
    public void init() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    /**Component initialization*/
    private void jbInit() throws Exception {
    SIMtilaButton.setLabel("Sim ON/OFF");
    SIMtilaButton.setBounds(new Rectangle(12, 8, 112, 27));
    SIMtilaButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    SIMtilaButton_actionPerformed(e);
    this.setBackground(new Color(20, 197, 230));
    this.setLayout(null);
    VNStilaButton.setLabel("VNS ON/OFF");
    VNStilaButton.setBounds(new Rectangle(12, 46, 112, 29));
    VNStilaButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    VNStilaButton_actionPerformed(e);
    asetuslabel.setFont(new java.awt.Font("Serif", 1, 18));
    asetuslabel.setText("Asetusarvo:");
    asetuslabel.setBounds(new Rectangle(20, 99, 93, 17));
    asetusarvoTextField.setBounds(new Rectangle(19, 123, 94, 26));
    asetusplusButton.setLabel("+");
    asetusplusButton.setBounds(new Rectangle(19, 164, 44, 27));
    asetusplusButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    asetusplusButton_actionPerformed(e);
    asetusmiinusButton.setLabel("-");
    asetusmiinusButton.setBounds(new Rectangle(71, 164, 42, 27));
    asetusmiinusButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    asetusmiinusButton_actionPerformed(e);
    nollaatrippilabel.setFont(new java.awt.Font("Serif", 1, 18));
    nollaatrippilabel.setText("Nollaa trippi:");
    nollaatrippilabel.setBounds(new Rectangle(170, 10, 112, 22));
    trippilabel.setBounds(new Rectangle(170, 43, 112, 22));
    trippilabel.setText("Trippimittari");
    trippilabel.setFont(new java.awt.Font("Serif", 1, 18));
    matkalabel.setBounds(new Rectangle(170, 113, 112, 22));
    matkalabel.setText("Matkamittari");
    matkalabel.setFont(new java.awt.Font("Serif", 1, 18));
    ClrButton.setCursor(null);
    ClrButton.setFont(new java.awt.Font("Dialog", 0, 8));
    ClrButton.setLabel("CLR");
    ClrButton.setBounds(new Rectangle(282, 7, 52, 28));
    ClrButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    ClrButton_actionPerformed(e);
    trippimatkaTextField.setBounds(new Rectangle(170, 71, 102, 26));
    kokomatkaTextField.setBounds(new Rectangle(170, 140, 102, 26));
    nopeuslabel.setFont(new java.awt.Font("Serif", 1, 18));
    nopeuslabel.setText("Nopeusmittari");
    nopeuslabel.setBounds(new Rectangle(170, 188, 112, 22));
    nopeusTextField.setBounds(new Rectangle(170, 220, 102, 26));
    KaasuJaJarrulabel.setFont(new java.awt.Font("Serif", 1, 20));
    KaasuJaJarrulabel.setText("Kaasu & Jarru");
    KaasuJaJarrulabel.setBounds(new Rectangle(95, 285, 136, 26));
    kaasujajarruTextField.setBounds(new Rectangle(97, 317, 125, 27));
    kaasuButton.setLabel("Kaasu");
    kaasuButton.setBounds(new Rectangle(256, 282, 105, 29));
    kaasuButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    kaasuButton_actionPerformed(e);
    jarruButton.setBounds(new Rectangle(255, 317, 105, 29));
    jarruButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jarruButton_actionPerformed(e);
    jarruButton.setLabel("Jarru");
    this.add(SIMtilaButton, null);
    this.add(VNStilaButton, null);
    this.add(asetuslabel, null);
    this.add(asetusarvoTextField, null);
    this.add(asetusplusButton, null);
    this.add(asetusmiinusButton, null);
    this.add(nollaatrippilabel, null);
    this.add(trippilabel, null);
    this.add(ClrButton, null);
    this.add(trippimatkaTextField, null);
    this.add(matkalabel, null);
    this.add(kokomatkaTextField, null);
    this.add(nopeuslabel, null);
    this.add(nopeusTextField, null);
    this.add(KaasuJaJarrulabel, null);
    this.add(kaasujajarruTextField, null);
    this.add(kaasuButton, null);
    this.add(jarruButton, null);
    /**Get Applet information*/
    public String getAppletInfo() {
    return "Applet Information";
    /**Get parameter info*/
    public String[][] getParameterInfo() {
    return null;
    void SIMtilaButton_actionPerformed(ActionEvent e) {
    if (isSIM_ON) {
    DisableButtons_SimOff();
    isSIM_ON = false;
    else {
    EnableButtons_SimOn();
    isSIM_ON = true;
    void VNStilaButton_actionPerformed(ActionEvent e) {
    if (isVNS_ON) {
    isVNS_ON = false;
    DisableButtons_VNSOff();
    else {
    isVNS_ON = true;
    EnableButtons_VNSOn();
    //asetusarvoksi nykyinen nopeus
    asetusarvo = Nopeusmittari.AnnaNopeus();
    void ClrButton_actionPerformed(ActionEvent e) {
    //tripin nollaus
    Trippimittari.NollaaMittari();
    void asetusplusButton_actionPerformed(ActionEvent e) {
    asetusarvo = asetusarvo + 1;
    void asetusmiinusButton_actionPerformed(ActionEvent e) {
    asetusarvo = asetusarvo - 1;
    void kaasuButton_actionPerformed(ActionEvent e) {
    if (voima >= 0 && voima <= 90) {
    voima = voima + 10;
    else if (voima < 0) {
    voima = 0;
    //kaasun painaminen lopetaa vakionopeuden s��d�n
    isVNS_ON = false;
    void jarruButton_actionPerformed(ActionEvent e) {
    if (voima >= -90 && voima <= 0) {
    voima = voima - 10;
    //kaasujajarruTextField.setText(Double.toString(voima));
    else if (voima > 0) {
    voima = 0;
    //kaasujajarruTextField.setText(Double.toString(voima));
    //jarrun painaminen lopettaa vakionopeuden s��d�n
    isVNS_ON = false;
    void DisableButtons_SimOff() {
    SIMtilaButton.setEnabled(true);
    VNStilaButton.setEnabled(false);
    ClrButton.setEnabled(false);
    asetusplusButton.setEnabled(false);
    asetusmiinusButton.setEnabled(false);
    kaasuButton.setEnabled(false);
    jarruButton.setEnabled(false);
    void EnableButtons_SimOn() {
    SIMtilaButton.setEnabled(true);
    VNStilaButton.setEnabled(true);
    ClrButton.setEnabled(true);
    asetusplusButton.setEnabled(false);
    asetusmiinusButton.setEnabled(false);
    jarruButton.setEnabled(true);
    kaasuButton.setEnabled(true);
    void DisableButtons_VNSOff() {
    asetusmiinusButton.setEnabled(false);
    asetusplusButton.setEnabled(false);
    void EnableButtons_VNSOn() {
    asetusmiinusButton.setEnabled(true);
    asetusplusButton.setEnabled(true);
    public double AnnaVoima() {
    return voima;
    public boolean CheckPolkimet() {
    return OnkoPoljettu;
    public double AnnaAsetusarvo() {
    return asetusarvo;
    public boolean OnkoSIM_ON() {
    return isSIM_ON;
    public boolean OnkoVNS_ON() {
    return isVNS_ON;
    public void Alkutilaan() {
    isSIM_ON = false;
    isVNS_ON = false;
    OnkoPoljettu = false;
    voima = 0;
    asetusarvo = 0;
    DisableButtons_SimOff();
    public void NaytaNopeus(double nopeus) {
    nopeusTextField.setText(Double.toString(nopeus));
    public void NaytaKokoMatka(double matka) {
    kokomatkaTextField.setText(Double.toString(matka));
    public void NaytaTrippiMatka(double trippimatka) {
    trippimatkaTextField.setText(Double.toString(trippimatka));
    public void NaytaVoima() {
    kaasujajarruTextField.setText(Double.toString(voima));
    //P��OHJELMA
    public static void main(String[] args) {
    //Luodaan oliot
    Simulaattori simulaattori = new Simulaattori();
    Saadin saadin = new Saadin();
    Matkamittari matkamittari = new Matkamittari();
    Trippimittari trippimittari = new Trippimittari();
    Nopeusmittari nopeusmittari = new Nopeusmittari();
    Malli malli = new Malli();
    simulaattori.asetusmiinusButton.setEnabled(true);
    while (true) {
    simulaattori.Alkutilaan();
    while (simulaattori.OnkoSIM_ON()) {
    long alkuaika = System.currentTimeMillis();
    simulaattori.trippimatkaTextField.setText("TESTI");
    if (simulaattori.OnkoVNS_ON()) {
    //v�litet��n voima mallille, s��din laskee voiman
    malli.laske_nopeus( Saadin.LaskeVoima() );
    nopeusmittari.LaskeNopeus();
    matkamittari.LaskeMatka();
    trippimittari.LaskeMatka();
    simulaattori.NaytaNopeus(nopeusmittari.AnnaNopeus());
    simulaattori.NaytaKokoMatka(matkamittari.AnnaMatka());
    simulaattori.NaytaTrippiMatka(trippimittari.AnnaMatka());
    simulaattori.NaytaVoima();
    }else {
    //v�litet��n voima mallille
    malli.laske_nopeus((int) (simulaattori.AnnaVoima()) );
    nopeusmittari.LaskeNopeus();
    matkamittari.LaskeMatka();
    trippimittari.LaskeMatka();
    simulaattori.NaytaNopeus(nopeusmittari.AnnaNopeus());
    simulaattori.NaytaKokoMatka(matkamittari.AnnaMatka());
    simulaattori.NaytaTrippiMatka(trippimittari.AnnaMatka());
    long loppuaika = System.currentTimeMillis();
    long suoritusaika = loppuaika - alkuaika;
    while (suoritusaika < 100) {
    loppuaika = System.currentTimeMillis();
    suoritusaika = loppuaika - alkuaika;
    } //end while (simulaattori.OnkoSIM_ON())
    } //end while(1)
    A MAJOR THANK YOU if you can bear me with this...
    Miska

  • How to get the method names in a class

    hi  friends,
    Could any of you tell me the report or function module  to display all the method names in a given class.
    thanks in advance.
    regards,
    kumar

    Hi Kumar ,
    Open ur class in SE24 transaction ,there is a tab for methods ..
    u'll get the list of methods form there ... n in source u'll get their operative details
    Regards
    Renu

  • How to get subclass method in an inheritance?

    Hi guys,
    I got the following classes:
    public abstract class Animal {
         private Long id;
         private String name;
         public Long getId() {return id;}
         public void setId(Long id) {this.id = id;}
         public String getName() {return name;}
         public void setName(String name) {this.name = name;}
         public abstract void makeSound();
    public class Cat extends Animal {
         private String nickName;
         public void makeSound() {
              System.out.println("Miaaau");
         public String getNickName() {return nickName;}
         public void setNickName(String nickName) {this.nickName = nickName;}
    try to retrieve from database:
              List animals = sess.find("from " + Cat.class.getName());
              for (Iterator it = animals.iterator(); it.hasNext();) {
                        Animal animal = (Animal) it.next();
                        System.out.println(     "Animal '" + animal.getName() +
                                                 "' its class is: " + animal.getClass().getName());
                        System.out.print("Makes sound: ");
                        animal.makeSound();
                        Class cls = animal.getClass();
                   try {
                   cls = Class.forName("tutorial.inheritance.tableperhierarchy.Cat");
                   } catch (ClassNotFoundException e) {
                   System.out.println("ClassNotFoundException");
    I need to access subclass method where the subclass classpath (tutorial.inheritance.tableperhierarchy.Cat) will only be know at runtime. Pls help, Thanks !
    regards,
    Mark

    I just need to know how to cast a class dynamically
    at runtime instead of manual casting it like:
    Cat cat = new Cat();This is not a cast. Why do you mean?
    /Kaj

  • How to get a method to call the correct passed object in the constructor

    I have 2 constructors for a certain object:
    public class ABC{
    //variables
    private DEF def;
    private GHI ghi;
    public ABC(DEF def){
    this.def = def;
    someMethod();
    public ABC(GHI ghi){
    this.ghi = ghi;
    someMethod();
    }Now, this someMethod() references / calls a method from the 2 classes passed in the constructor say def.getSome() and ghi.getSome().
    Depending on which constructor is used, it should call the respective xxx.getSome(). Do I need to write 2 someMethod()s or is there a way that one method will call the proper xxx.getSome() ?
    Thanks.....

    Hi
    Following the example may be help to you call correct method,
    // Interface QuizMaster
    public interface QuizMaster {
         public String popQuestion();
    // Class StrutsQuizMaster
    public class StrutsQuizMaster implements QuizMaster{
         public String popQuestion() {
              return "Are you new to Struts?";
    // Class SpringQuizMaster
    public class SpringQuizMaster implements QuizMaster{
         public String popQuestion() {
              return "Are you new to Spring?";
    // Class QuizMasterService
    public class QuizMasterService {
         QuizMaster quizMaster;
         public QuizMasterService(SpringQuizMaster quizMaster){
              this.quizMaster = quizMaster;
         public QuizMasterService(StrutsQuizMaster quizMaster){
              this.quizMaster = quizMaster;
         public void askQuestion()
              System.out.println(quizMaster.popQuestion());
    // QuizProgram
    public class QuizProgram {
         public static void main(String[] args) {
              // Option : 1
    // StrutsQuizMaster quizMaster = new StrutsQuizMaster();
    // Option : 2
    SpringQuizMaster quizMaster = new SpringQuizMaster();
              QuizMasterService quizMasterService = new QuizMasterService(quizMaster);                    
              quizMasterService.askQuestion();
    here you can create object of StrutsQuizMaster or SpringQuizMaster and pass into the QuizMasterService object constructor, base on the object correct method will be called.

  • How to get getDBTransaction() method in applicationmoduleImpl class

    Hi, I am using jdev 11.1.1.5.0 and I want to use getDBTransaction() at application module impl class please suggest.
    Thanks in advance

    getDBTransaction() :-)
    http://docs.oracle.com/cd/E21043_01/apirefs.1111/e10653/oracle/jbo/server/ApplicationModuleImpl.html#getDBTransaction%28%29
    Anil Bajpai wrote:
    Hi, I am using jdev 11.1.1.5.0 and I want to use getDBTransaction() at application module impl class please suggest.
    Thanks in advance

  • How to get selected row no in ALV

    Hi....
    I am displaying a alv in sub screen...
    I want to provide user functionality to delete records from alv..
    The problem is i dont have a method to get row ids if user select multiple rows...
    I tried using GET_ROW_ID but as its a protected method i cant use it..
    please suggest stepwise how to use protected method in my class...and if u coud suggest some public method it will be great
    regards
    vivek

    Hi,
    You can also use the FM "REUSE_ALV_POPUP_TO_SELECT'.
    It displays the output along with check boxes, where u can select the rows whatever u want.
    Thanks & Regards,
    Sudheer

  • ALV grid using methods: how to get modified cells

    Hi all,
    IAM USING alv grid using methods,
    i have few fields as editable
    if the user edits any of those fields how can i know which cell is modified and what is the new value.
    i tried to use method get_modified_cells
    but iam getting a msg saying protected method and u can  not use.
    please advise.
    thanks
    JAfar

    Jafar,
    You need to Take the Help of DATA_CHANGED event, when ever there is a change in the Grid, it will trigger, here you can capture the Cells which are modified.
    in your PAI call the method check changed data
    CL_GUI_ALV_GRID-->CHECK_CHANGED_DATA
    You need to set the handler for datachanged.
    set the handler for this, and register the event modified or enter.
    **Handler to Check the Data Change
        HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                             OF CL_GUI_ALV_GRID
                             IMPORTING ER_DATA_CHANGED
                                       E_ONF4
                                       E_ONF4_BEFORE
                                       E_ONF4_AFTER,
    **Handle Data Change
      METHOD HANDLE_DATA_CHANGED.
    DATA: X_CHANGE TYPE LVC_S_MODI.  "modified cells
        LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO X_CHANGE.
        ENDLOOP.
      ENDMETHOD.                    "HANDLE_DATA_CHANGED
    Regards
    Vijay

  • How to get selection criteria value in method IF_POWL_FEEDER~HANDLE_ACTION

    hi:
    As you know, we could get the leading selected POWL result data through parameter  c_selected and  c_selected in this method.
    but moreever, I want to get the selection criterai values in this method too just like the paramter i_selcrit_values in the method IF_POWL_FEEDER~GET_OBJECTS, how to do it?
    I have tried to define a attribute in my POWL class and save i_selcrit_values into this attribute in the method IF_POWL_FEEDERGET_OBJECTS, but in method IF_POWL_FEEDERHANDLE_ACTION, this attribute is still empty, so this workaround failed.
    thanks.

    hi guys:
    I have founded how to do it:
    METHOD get_selcrit.
      DATA ls_query TYPE powl_query_sty.
      DATA lt_selcrit TYPE rsparams_tt.
      FIELD-SYMBOLS <ls_selcrit> LIKE LINE OF lt_selcrit.
      CALL METHOD cl_powl_runtime_services=>get_current_query
        RECEIVING
          rs_query = ls_query.
      CALL METHOD cl_powl_query_accessor=>get_cached_selcrit
        EXPORTING
          i_query     = ls_query-query
        IMPORTING
          e_crit_para = lt_selcrit.
      READ TABLE lt_selcrit WITH KEY selname = iv_selname
        ASSIGNING <ls_selcrit>.
      IF <ls_selcrit> IS ASSIGNED.
        ev_selcrit = <ls_selcrit>-low.
      ENDIF.
    ENDMETHOD.

Maybe you are looking for

  • Paraller Query Server Error while creating the database using DBCA on UNIX

    Hi All, I am try to create the database on UNIX PLATFORM database 11g R1. At the end of database creation using DBCA i got the errors: ORA-12801:error signaled in parallel query server P077 ORA-00018: maximun number of sessions exceeded ORA-06512:at"

  • Date picker for 64 bit windows 8 and 32 bit 2010 excel

    I'm looking for step by step instructions on how to add a pop up calender to chose a date in 2010 Excel.  There is none listed in the addition toolbox controls, where and how would I install this? 

  • How to use CallableStatement  for StroredProcedure in java?

    I've successfully created storedProcedure for select comment in mysql.but how implement in java code with using of CallableStatement.Pls help me Message was edited by: SKVenkates

  • PDF binding to MySQL databse - how is it done?

    How can I bind data entered in to a Dynamic PDF form to reside in a MySQL database. I seem not able to build a connection. So here are the steps I follow: Binding / New Connection / Name: testdata ; Description: OLEDB database / Connection String: bu

  • Quicktime opening PDF link files on the web

    Since updating to Tiger when I click on a PDF file on the web Quicktime opens it but only shows the first page and I see no method to go to next page. I have overcome this by right clicking on a link and downloading file and right clicking to open wi