Call Java Class and Methods from ABAP

Hi
I install de JCo, But how i can call java class and methods from ABAP?. somebody has an example?
The tutorial say that's is possible,  but don't explain how do that?
Thanks.
Angel G. Hurtado

If you need only simple java program, you do not need to install JCo. The following codes can call java class.
DATA: COMMAND TYPE STRING VALUE 'C:\j2sdk1.4.2_08\bin\java',
      DIR TYPE STRING VALUE D:\eclipse\workspace',
      PARAMETER TYPE STRING VALUE 'Helloworld'. "here the name of your java program
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
   EXPORTING
     APPLICATION = COMMAND
     PARAMETER = PARAMETER
     DEFAULT_DIRECTORY = DIR
   MAXIMIZED =
     MINIMIZED = 'X'     "If you need the DOS window to be minimized
  EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    BAD_PARAMETER = 3
    FILE_NOT_FOUND = 4
    PATH_NOT_FOUND = 5
    FILE_EXTENSION_UNKNOWN = 6
    ERROR_EXECUTE_FAILED = 7
    OTHERS = 8.
Tell me if it works.
Nuno.

Similar Messages

  • Calling a class's method from another class

    Hi, i would like to know if it's possible to call a Class's method and get it's return from another Class. This first Class doesn't extend the second. I've got a Choice on this first class and depending on what is selected, i want to draw a image on the second class witch is a Panel extended. I put the control "if" on the paint() method of the second class witch is called from the first by the repaint() (first_class.repaint()) on itemStateChanged(). Thankx 4 your help. I'm stuck with this.This program is for my postgraduation final project and i'm very late....

    import java.awt.*;
    import java.sql.*;
    * This type was generated by a SmartGuide.
    class Test extends Frame {
         private java.awt.Panel ivjComboPane = null;
         private java.awt.Panel ivjContentsPane = null;
         IvjEventHandler ivjEventHandler = new IvjEventHandler();
         private Combobox ivjCombobox1 = null;
    class IvjEventHandler implements java.awt.event.WindowListener {
              public void windowActivated(java.awt.event.WindowEvent e) {};
              public void windowClosed(java.awt.event.WindowEvent e) {};
              public void windowClosing(java.awt.event.WindowEvent e) {
                   if (e.getSource() == Test.this)
                        connEtoC1(e);
              public void windowDeactivated(java.awt.event.WindowEvent e) {};
              public void windowDeiconified(java.awt.event.WindowEvent e) {};
              public void windowIconified(java.awt.event.WindowEvent e) {};
              public void windowOpened(java.awt.event.WindowEvent e) {};
         private Panel ivjPanel1 = null;
    * Combo constructor comment.
    public Test() {
         super();
         initialize();
    * Combo constructor comment.
    * @param title java.lang.String
    public Test(String title) {
         super(title);
    * Insert the method's description here.
    * Creation date: (11/16/2001 7:48:51 PM)
    * @param s java.lang.String
    public void conexao(String s) {
         try {
              Class.forName("oracle.jdbc.driver.OracleDriver");
              String url = "jdbc:oracle:thin:system/[email protected]:1521:puc";
              Connection db = DriverManager.getConnection(url);
              //String sql_str = "SELECT * FROM referencia";
              Statement sq_stmt = db.createStatement();
              ResultSet rs = sq_stmt.executeQuery(s);
              ivjCombobox1.addItem("");
              while (rs.next()) {
                   String dt = rs.getString(1);
                   ivjCombobox1.addItem(dt);
              db.close();
         } catch (SQLException e) {
              System.out.println("Erro sql" + e);
         } catch (ClassNotFoundException cnf) {
    * connEtoC1: (Combo.window.windowClosing(java.awt.event.WindowEvent) --> Combo.dispose()V)
    * @param arg1 java.awt.event.WindowEvent
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private void connEtoC1(java.awt.event.WindowEvent arg1) {
         try {
              // user code begin {1}
              // user code end
              this.dispose();
              // user code begin {2}
              // user code end
         } catch (java.lang.Throwable ivjExc) {
              // user code begin {3}
              // user code end
              handleException(ivjExc);
    * Return the Combobox1 property value.
    * @return Combobox
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private Combobox getCombobox1() {
         if (ivjCombobox1 == null) {
              try {
                   ivjCombobox1 = new Combobox();
                   ivjCombobox1.setName("Combobox1");
                   ivjCombobox1.setLocation(30, 30);
                   // user code begin {1}
                   this.conexao("select * from referencia");
                   // user code end
              } catch (java.lang.Throwable ivjExc) {
                   // user code begin {2}
                   // user code end
                   handleException(ivjExc);
         return ivjCombobox1;
    * Return the ComboPane property value.
    * @return java.awt.Panel
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private java.awt.Panel getComboPane() {
         if (ivjComboPane == null) {
              try {
                   ivjComboPane = new java.awt.Panel();
                   ivjComboPane.setName("ComboPane");
                   ivjComboPane.setLayout(null);
                   getComboPane().add(getCombobox1(), getCombobox1().getName());
                   getComboPane().add(getPanel1(), getPanel1().getName());
                   // user code begin {1}
                   // user code end
              } catch (java.lang.Throwable ivjExc) {
                   // user code begin {2}
                   // user code end
                   handleException(ivjExc);
         return ivjComboPane;
    * Return the ContentsPane property value.
    * @return java.awt.Panel
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private java.awt.Panel getContentsPane() {
         if (ivjContentsPane == null) {
              try {
                   ivjContentsPane = new java.awt.Panel();
                   ivjContentsPane.setName("ContentsPane");
                   ivjContentsPane.setLayout(new java.awt.BorderLayout());
                   getContentsPane().add(getComboPane(), "Center");
                   // user code begin {1}
                   // user code end
              } catch (java.lang.Throwable ivjExc) {
                   // user code begin {2}
                   // user code end
                   handleException(ivjExc);
         return ivjContentsPane;
    * Return the Panel1 property value.
    * @return Panel
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private Panel getPanel1() {
         if (ivjPanel1 == null) {
              try {
                   ivjPanel1 = new Panel();
                   ivjPanel1.setName("Panel1");
                   ivjPanel1.setBackground(java.awt.SystemColor.scrollbar);
                   ivjPanel1.setBounds(24, 118, 244, 154);
                   // user code begin {1}
                   // user code end
              } catch (java.lang.Throwable ivjExc) {
                   // user code begin {2}
                   // user code end
                   handleException(ivjExc);
         return ivjPanel1;
    * Called whenever the part throws an exception.
    * @param exception java.lang.Throwable
    private void handleException(java.lang.Throwable exception) {
         /* Uncomment the following lines to print uncaught exceptions to stdout */
         // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
         // exception.printStackTrace(System.out);
    * Initializes connections
    * @exception java.lang.Exception The exception description.
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private void initConnections() throws java.lang.Exception {
         // user code begin {1}
         // user code end
         this.addWindowListener(ivjEventHandler);
    * Initialize the class.
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private void initialize() {
         try {
              // user code begin {1}
              // user code end
              setName("Combo");
              setLayout(new java.awt.BorderLayout());
              setSize(460, 300);
              setTitle("Combo");
              add(getContentsPane(), "Center");
              initConnections();
         } catch (java.lang.Throwable ivjExc) {
              handleException(ivjExc);
         // user code begin {2}
         // user code end
    * Insert the method's description here.
    * Creation date: (11/17/2001 2:02:58 PM)
    * @return java.lang.String
    public String readCombo() {
         String dado = ivjCombobox1.getSelectedItem();
         return dado;
    * Starts the application.
    * @param args an array of command-line arguments
    public static void main(java.lang.String[] args) {
         try {
              /* Create the frame */
              Test aTest = new Test();
              /* Add a windowListener for the windowClosedEvent */
              aTest.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowClosed(java.awt.event.WindowEvent e) {
                        System.exit(0);
              aTest.setVisible(true);
         } catch (Throwable exception) {
              System.err.println("Exception occurred in main() of Test");
              exception.printStackTrace(System.out);
    * Insert the type's description here.
    * Creation date: (11/17/2001 1:59:15 PM)
    * @author:
    class Combobox extends java.awt.Choice {
         public java.lang.String dado;
    * Combobox constructor comment.
    public Combobox() {
         super();
         initialize();
    * Called whenever the part throws an exception.
    * @param exception java.lang.Throwable
    private void handleException(java.lang.Throwable exception) {
         /* Uncomment the following lines to print uncaught exceptions to stdout */
         // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
         // exception.printStackTrace(System.out);
    * Initialize the class.
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private void initialize() {
         try {
              // user code begin {1}
              // user code end
              setName("Combobox");
              setSize(133, 23);
         } catch (java.lang.Throwable ivjExc) {
              handleException(ivjExc);
         // user code begin {2}
         // user code end
    * main entrypoint - starts the part when it is run as an application
    * @param args java.lang.String[]
    public static void main(java.lang.String[] args) {
         try {
              java.awt.Frame frame = new java.awt.Frame();
              Combobox aCombobox;
              aCombobox = new Combobox();
              frame.add("Center", aCombobox);
              frame.setSize(aCombobox.getSize());
              frame.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
              frame.setVisible(true);
         } catch (Throwable exception) {
              System.err.println("Exception occurred in main() of Combobox");
              exception.printStackTrace(System.out);
    * Insert the type's description here.
    * Creation date: (11/17/2001 2:16:11 PM)
    * @author:
    class Panel extends java.awt.Panel {
    * Panel constructor comment.
    public Panel() {
         super();
         initialize();
    * Panel constructor comment.
    * @param layout java.awt.LayoutManager
    public Panel(java.awt.LayoutManager layout) {
         super(layout);
    * Called whenever the part throws an exception.
    * @param exception java.lang.Throwable
    private void handleException(java.lang.Throwable exception) {
         /* Uncomment the following lines to print uncaught exceptions to stdout */
         // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
         // exception.printStackTrace(System.out);
    * Initialize the class.
    /* WARNING: THIS METHOD WILL BE REGENERATED. */
    private void initialize() {
         try {
              // user code begin {1}
              // user code end
              setName("Panel");
              setLayout(null);
              setSize(260, 127);
         } catch (java.lang.Throwable ivjExc) {
              handleException(ivjExc);
         // user code begin {2}
         // user code end
    * main entrypoint - starts the part when it is run as an application
    * @param args java.lang.String[]
    public static void main(java.lang.String[] args) {
         try {
              java.awt.Frame frame = new java.awt.Frame();
              Panel aPanel;
              aPanel = new Panel();
              frame.add("Center", aPanel);
              frame.setSize(aPanel.getSize());
              frame.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
              frame.setVisible(true);
         } catch (Throwable exception) {
              System.err.println("Exception occurred in main() of java.awt.Panel");
              exception.printStackTrace(System.out);
    * Insert the method's description here.
    * Creation date: (11/17/2001 2:18:36 PM)
    public void paint(Graphics g) {
    /* Here's the error:
    C:\Test.java:389: non-static method readCombo() cannot be referenced from a static context
         System.out.println(Test.lerCombo());*/
         System.out.println(Test.readCombo());

  • Problem calling AS3 class's methods from Flex Project

    Sorry if this is a stupid question, but after 2 days of Web
    searching and 2 books give up; I am a Java and c# programmer and am
    having problems calling AS3 classes (in packages) from Flex Builder
    2 Flex Projects; the AS3 classes work great as Flex Builder "AS3
    Projects", but when I try to use the classes in a Flex Builder
    "Flex Project" I am able to see and set their properties, but
    cannot see (through "code completion") their methods (unless the
    class extends another AS3 class; and in that case I can see the
    base class's methods). Here is the code:
    AS3 Example Class:
    package asText {
    public class CheckWord {
    public var strData:String;
    public var strAProperty:String;
    public var intAProperty:int;
    // Constructor
    public function CheckWord() {
    public function TestMethod():void {
    trace("test...");
    public function WordLength():int {
    var intLength:int = 0;
    trace(strData);
    intLength = strData.length;
    return intLength;
    } // From Method WordLength
    } // From Class CheckWord
    } // From Package asText
    The MXML code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="442" height="488" horizontalAlign="center"
    verticalAlign="middle"
    backgroundGradientColors="[#c0c0c0, #c0c0c0]"
    xmlns:asTheText="asText.*"
    >
    <asTheText:CheckWord strData="Test words" />
    <mx:Panel title="Welcome to ........" width="337"
    height="393" horizontalAlign="center" verticalAlign="middle"
    layout="absolute" y="15" x="50">
    <mx:Text text="First Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="36"/>
    <mx:TextInput id="txtFName" x="112.25" y="34"/>
    <mx:Text text="Last Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="66"/>
    <mx:TextInput x="112.25" y="64" id="txtLName"/>
    <mx:Text text="email address" enabled="true" width="87"
    fontWeight="bold" x="17.25" y="96"/>
    <mx:TextInput width="189" id="txtEmail" left="112.25"
    top="94"/>
    <mx:Button id="butSubmit" label="Submit" x="95" y="194"
    click="asTheText:TestMethod();"/>
    ..............and so on ............
    All this does is give me an 1180 error:
    1180: Call to a possibly undefined method TestMethod.
    flexConveyMovie1.mxml

    Thanks, I have it working; I was not assigning an "ID" to the
    "MXML use of the class" (whatever the formal name for that is;
    like: <asTheText:CheckWord id="MyText" strData="The Data" />
    ) and then I was not referencing that ID in what I am refering to
    as calling methods for the Class; like:
    <mx:Button id="butTest" label="Test Function" x="39"
    y="208" click="MyText.TestMethod();"/>
    Also, I did some tests on this, and I am shocked that
    apparently neither of these two "uses"(?) of a custom AS3 class
    actually "call" the Class's constructor. Does that make sense or is
    that the result of how I am structuring this?
    Phil

  • Problem during call java class (model layer) from jsp page (view layer)

    I created new Fusion web application so I have now to parts in the application navigator (model, viewcontroller)
    I want to write java class in the Model part as following:
    package persistence;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class DBManager {
    Connection connection = null;
    public DBManager() {
    super();
    public void init() {
    try {
    // Load the JDBC driver
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    // Create a connection to the database
    String serverName = Constant.DB_SERVER_NAME;
    String portNumber = Constant.DB_PORT_NUMBER;
    String sid = Constant.DB_SID;
    String url =
    "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" +
    sid;
    String username = Constant.DB_USER_NAME;
    String password = Constant.DB_PASSWORD;
    connection = DriverManager.getConnection(url, username, password);
    System.out.println("*");
    System.out.println(connection.getCatalog());
    } catch (ClassNotFoundException e) {
    System.out.println("Could not find the database driver");
    } catch (SQLException e) {
    System.out.println("Could not connect to the database");
    e.printStackTrace();
    and wrote JSP page in the view controller part as following :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="persistance.*"%>
    <% persistance.DBManager manager = new DBManager(); %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>Browse</title>
    </head>
    <body>
    <table>
    </table>
    </body>
    </html>
    but this I have the following error in the jsp page :type persistance.DBManager not found
    my job is to build simple ADF application using JSF and java without any ADF faces or JPA or any another technology
    thanks

    Duplicate message.
    type persistance.DBManager not found
    Add a Dependency on the Model project in the View project. In Project Properties select the Dependencies node to add dependencies.
    Edited by: dvohra16 on Jun 19, 2011 8:37 AM

  • Reg : Classes And Methods In ABAP HR

    Hii...
    Can anyone tell me what are the standard OOPS classes and Interfaces related to ABAP HR Technical. I want to know the detailed view of all the classes and interfaces which can be used in HR technically.
    Or is there any way I can find.
    Your suggestions will be helpful for me. So, Kindly help me with this.
    Thanks,
    Regards,
    Rahul Gupta

    Venkat,
        Try look for any SAP Note or create Customer Message to SAP. It's clearly Program Error. We can't collect  "lcl_transform" class into Transport Request Independently as it was local Class not Global Class.
    Try transporting Transformations again, if it still gives problem. Contact SAP.
    Let us know if you implement any SAP Notes.
    all the best.
    Regards,
    Nagesh Ganisetti.
    Assign Points if it helps.

  • Accessing java class and methods within JSP

    Hi All,
    I am writing a JSP page, and need to instantiate an object of a certain class within my package, in my JSP page.
    How do I do that? Do i use the <%import = "Whatever.class" %>
    Any help would be greatly appreciated.
    Kal.

    Hi.. Thanks for ur reply.
    I am actually having a problem with the import statement. So the part where you have mypackage.Myclass, it is not working for me.
    I am using Sun Forte.. and the directory is myprojects/test/Classes/MyClass.java
    so how would the import statement look like?
    Thanks
    Kal.
    Using directive for import statements:
    <%@ page
    import="java.util.*,java.sql.*,mypackage.MyClass" %>
    Then use scriptlet:
    <%! MyClass c= new MyClass(); %>
    <%! private void method() {...} %>
    <%= c.getxxx() %>
    ...and so on

  • What is wrong with this Java class and method?

    Created a managed bean and following method as shown below.
    public void setEvent(DisclosureEvent disclosureEvent, CoreShowDetail detail) {
    if (disclosureEvent.isExpanded()) {
    detail.setDisclosed(!detail.isDisclosed());
    -- Then integrated above in the following jspx.
    <af:showOnePanel inlineStyle="width:400px;height:300px;"
    binding="#{ShowApanel.showOnePanel1}"
    id="showOnePanel1">
    <af:showDetailItem text="ADF Faces Components"
    binding="#{ShowApanel.showDetailItem3}"
    id="showDetailItem3" disclosureListener="#{ShowApanel.setEvent}">
    <af:panelHeader text="ADF Faces Components First Child"
    binding="#{ShowApanel.panelHeader6}"
    id="panelHeader6"/>
    <af:panelHeader text="ADF Faces Components Second Child"
    binding="#{ShowApanel.panelHeader5}"
    id="panelHeader5"/>
    </af:showDetailItem>
    <af:showDetailItem text="Architecture"
    binding="#{ShowApanel.showDetailItem2}"
    id="showDetailItem2"
    disclosureListener="#{ShowApanel.setEvent}">
    <af:panelHeader text="Architecture First Child"
    binding="#{ShowApanel.panelHeader4}"
    id="panelHeader4"/>
    <af:panelHeader text="Architecture Second Child"
    binding="#{ShowApanel.panelHeader3}"
    id="panelHeader3"/>
    </af:showDetailItem>
    </af:showOnePanel>
    THE ISSUE:[b]
    I am still not able to programmatically disclose or undisclose the panel component.
    Where am I going wrong? Please help.
    Thanks,
    Ruchir

    Hello Frank,
    I put several print statments but none of them is executing on browser. Does this mean that the method is not being called even once?
    public void setEvent(DisclosureEvent disclosureEvent, CoreShowDetail detail) {
    System.out.println("HelloServer Exiting ...");
    if (disclosureEvent.isExpanded()) {
    System.out.println("HelloServer Exiting1 ...");
    // detail.setDisclosed(!detail.isDisclosed());
    System.out.println("HelloServer Exiting2 ...");
    Thanks,
    Ruchir

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

  • How to call java class file from jsp

    hi
    we need to call java classes (which are written separately in .java file )from jsp file. we need it for our project if anyone knows about please reply us.
    bye
    siva sankari

    you can call the methods in a lot of ways. you could use scriptlets with the
    <%@ page import="package.class"%> and then inside instantiate an object
    <%
         MyClass mc = new MyClass(parameters if any);
         mc.theMethodYouWantToCall();
    %>or as Madathil has stated,
    or use the JSP tags
    <jsp:useBean id="anyname" class="classname"/>and then use the getProperty tag
    or even Custom Tags

  • Calling custom Infotype method from ABAP report

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from abap report this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi,
    This is the code we are using. Just calling the read and modify methods of the check class. Very simple actually .. we just want once update/insert to work but it does not.
    <CODE>
    REPORT  ZTESTRAD_WD.
    FIELD-SYMBOLS <p9106> TYPE p9106.
    DATA : infty_container_tab TYPE hrpad_infty_container_tab ,
           message_list        TYPE REF TO cl_hrpa_message_list,
         w_ok type boole_d  ,
         ref_class TYPE REF TO ZCL_HRPA_INFOTYPE_9106,
         container        TYPE REF TO if_hrpa_infty_container,
         it9106_container TYPE REF TO cl_hrpa_infotype_container,
         p9106_ref        TYPE REF TO data,
        busilog type ref to if_hrpa_masterdata_bl.
    CREATE OBJECT  message_list.
    TRY.
            CREATE OBJECT ref_class
              EXPORTING
                tclas = 'A'
                infty = '9106'.
          CATCH cx_hrpa_violated_assertion .
            write :/ 'Error during initialization'.
      ENDTRY.
    call method cl_hrpa_masterdata_bl=>get_instance
       importing
         masterdata_bl = busilog.
    TRY.
    CALL METHOD ref_class->IF_HRPA_INFTY_BL~read
      EXPORTING
        tclas           = 'A'
        pernr           = 'XXXXXXXX'
        infty           = '9106'
        begda           = sy-datum
        endda           = sy-datum
        no_auth_check   = abap_true
        message_handler = message_list
      IMPORTING
        container_tab   = infty_container_tab
        is_ok           = w_ok.
    CATCH cx_hrpa_violated_assertion .
       WRITE :/ 'Infotype could not be read'.
    ENDTRY.
    *" Fill the local structure with container data:
      loop at infty_container_tab into container.
        it9106_container ?= container.
        TRY.
        CALL METHOD it9106_container->primary_record_ref
          IMPORTING
            pnnnn_ref =  p9106_ref.
         CATCH cx_hrpa_violated_assertion .
        ENDTRY.
        ASSIGN p9106_ref->* to <p9106>.
        write :/ <p9106> .
      endloop.
    *" Just change some field values of the record
      <p9106>-C1name2 = 'Test name'.
      <p9106>-C2name2 = 'Test name 2 3 4'.
    data : return TYPE BAPIRETURN1,
           return1 TYPE BAPIRETURN1.
    *CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
       number        = <p9106>-pernr
    IMPORTING
      RETURN        = return1
    *PERFORM do_nothing(sapfp50p).
    The container itself is modified
      container ?= it9106_container->modify_primary_record( <p9106> ).
    CREATE OBJECT message_list.
    the invocation - errors are always fatal !!!
      DATA : lx_exception  TYPE REF TO cx_root,
             update_mode type HRPAD_UPDATE_MODE,
             massn type massn,
             massg type massg.
      TRY.
          CALL METHOD ref_class->IF_HRPA_INFTY_BL~MODIFY(
            EXPORTING
               old_container =                   it9106_container
               massn                          = massn
               massg                         = massg
               update_mode =                 update_mode
               no_auth_check =                   'X'
               message_handler =                 message_list
            IMPORTING
               is_ok =                           w_ok
            CHANGING
               container =                       container
        CATCH cx_hrpa_violated_assertion INTO lx_exception.
          RAISE EXCEPTION TYPE cx_wd_no_handler
            EXPORTING previous = lx_exception.
      ENDTRY.
    </CODE>
    I have also tried by instantiating the cl_hrpa_masterdata_bl and then calling the methods on that object...... makes no difference.
    I used this link to proceed with the modifications:
    http://help.sap.com/saphelp_erp2005/helpdata/en/43/21d2254bba2bebe10000000a1553f7/frameset.htm
    The funny thing is that the WHOLE logic executes without any error messages or dumps or anything. I have now debugged almost every line of code that these methods call. PA30 works just fine. HR_INFOTYPE_OPERATION does not .. that's a whole differnt story.

  • Putting code to my Jsf and Jsff pages and calling Java class

    I want guidance on how to write simple code on adf pages
    1. I have adf pages (.jsf and .jsff) where I have input text fields and command buttons, I want to put custom code on the command button such that when you click on any of the buttons at runtime, the code will be executed.
    2. In my application, I have a java class which I have written, I need to click on any of the buttons at runtime, the application will call the java class and execute the class. Essentially, taking parameters from my adf page(s) (.jsf and .jsff) to the java class and also returning parameters after execution.

    The version of my Jdev. is 11.1.2.3.0
    Which docs?.... I will be grateful if you can point to the particular doc fro me.
    1) Can you pls tell me in one of few sentences how to add method and set the actionListener property.
    2) in question number 2, I am totally lost... Let me explain my self again to clarify the situation. In my adf page, I have a button and three input texts,my purpose is that at runtime, when a user click on the button, the values in the first two input texts will be passed to the java class as parameters, it is expected to use these parameters to process some form of calculations and return a value which I will place on the  third input field.

  • How do I call an Application Module method from a EntityImpl class?

    Guys and Gals,
    Using Studio Edition Version 11.1.1.3.0.
    I've got a price update form, that when submitted, takes the part numbers and prices in the form and updates the corresponding Parts' price in the Parts table. Anytime this Parts view object's ReplacementPrice attribute is changed, an application module method needs to be called which updates a whole slew of related view objects. I know you can modify view objects via associations (How do I call an Application Module method from a ViewObjectImpl class? but that's not what I'm trying to do. These AppModuleImpl methods are the hub for all price updates, as many different operations may affect related pricing (base price lists, price buckets, etc) and hence, call the updatePartPricing(key) method.
    For some reason, the below code does not call / run / activate the application module's method. The AppModuleDataControl exists and recordPartHistory(key) is registered and public. At runtime, the am.<method> code is simply ignored, and as a weird side-effect, I cannot navigate out of my current page flow.
      public void setReplacementPrice(Number value)
        setAttributeInternal(REPLACEMENTPRICE, value);
        AppModuleImpl am = (AppModuleImpl)this.getDBTransaction().findApplicationModule("AppModuleDataControl");
        Key key = new Key(new Object[]
            { getPartNumber() });
        am.recordPartHistory(key);  // AppModuleImpl method which records pricing history
        am.updatePartPricing(key); // AppModuleImpl method which updates a whole slew of related pricing tables
      }Any ideas?

    Thanks Timo.
    Turns out the code provided was correct, but the AppModuleImpl method being called was not. A dependent ViewObject wasn't returning the row I was expecting. I then tried to perform some operations on that row, which in turn ... just stopped everything, but didn't give me an error.
    It was the lack of the error that threw me off. I had never messed with calling an AppModuleImpl method from the EntityImpl so I assumed that's what was messing up.
    You are correct. It is available from the ViewRow, but I thought it better to put it in the EntityImpl. This method will be called every time the replacement cost is modified. If I didn't put it in the EntityImpl, I'd have to remember to call it every time a replacement cost changed.

  • Error while trying to call Java Class from Peoplecode

    Gurus,
    I am trying to read a property file from peoplecode using standard java classes. However, I am getting this error more than one overload matches
    Below are 2 ways in which I tried doing this and both ended up in the same error
    Code 1>_
         Local JavaObject &file = CreateJavaObject("java.io.File", "D:\\psft.properties");
         Local JavaObject &properties = CreateJavaObject("java.util.Properties");
         Local JavaObject &reader = CreateJavaObject("java.io.FileReader", &file);
         &properties.load(); Error thrown : "Calling Java java.io.FileReader.<init>: more than one overload matches"
    Code 2>_
         Local JavaObject &file = CreateJavaObject("java.io.File", "D:\\psft.properties");
         Local JavaObject &properties = CreateJavaObject("java.util.Properties");
         Local JavaObject &properyFile = CreateJavaObject("java.io.FileInputStream", &file);
         &properties.load();
    Error thrown : "Calling Java java.io.FileInputStream.<init>: more than one overload matches."
    The above error is thrown on the 3rd line when I try to invoke the FileInputStream or FileReader class/constructor.
    In fact both the above code pieces work absolutely fine when I write them into a java class and run them on a java runtime. Any inputs would be of great help !! Alternatively, I will have to use peoplecode file.readline(), etc to read the property file. Since java has this smarter way to reading a property file, I thought of giving it a try ..
    -Sudripta

    I tested this on one of my windows servers using PT 8.50:
    Local JavaObject &joCurrFile = CreateJavaObject("java.io.File", "c:/temp/test-date.txt");
    Local JavaObject &jlongtime = CreateJavaObject("java.util.Date");
    Local number &modifytime = &jlongtime.getTime();
    MessageBox(0, "", 0, 0, "original time: " | &joCurrFile.lastModified());
    Local boolean &filemodified = &joCurrFile.setLastModified(&modifytime);
    MessageBox(0, "", 0, 0, "&modifytime: " | &modifytime, "");
    MessageBox(0, "", 0, 0, "&filemodified: " | &filemodified, "");
    MessageBox(0, "", 0, 0, "new time: " | &joCurrFile.lastModified());Here are the results:
    PeopleTools 8.50.05 - Application Engine
    Copyright (c) 1988-2010 PeopleSoft, Inc.
    All Rights Reserved
    original time: 1287677026144 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: original time: 1287677026144 (0,0) (0,0)
    &modifytime: 1287677277845 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: &modifytime: 1287677277845 (0,0) (0,0)
    &filemodified: True (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: &filemodified: True (0,0) (0,0)
    new time: 1287677277845 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: new time: 1287677277845 (0,0) (0,0)
    Application Engine program DSS_TEST_IO ended normallyDoes your app server have permissions to modify the files you are trying to modify? Also, how did you verify the date/time of the files? Were you using Windows Explorer? Did you refresh the view first? Or did you use the console dir/ls? I seriously doubt there is a security manager in place that would restrict what you can do with Java. Security managers are common in applets/browser context, but not in apps.

Maybe you are looking for

  • Hello, i'm a new mac book user and i'm having a little issue with music

    hello, i am a new mac user and i was trying to copy all my music over to the laptop 100gb worth. but someone i managed to delete them off my external hard drive and i just checked my HD on the mac and its there in a folder called "others" i know its

  • Is there any way to remove the 'Java web start window' message on windows?

    This is unacceptable. You can download an application in any language and install it. If so many hoops have to be jumped through for security, and it changes the display to boot, this is simply not worth the (2 days!!) of effort is has taken to look

  • Diagnostics Setup - Warning on Step "Wilyhost Agent Details"

    Hi All I am having a bit of dificulty configuring the Wily Agent via Solution Manager diagnostics. I am currently getting the following errors when trying to set up the Wilyhost Agent when I run the setup wizard I am getting the following results: Wi

  • Problem saving docs outside libraries

    Saving documents from a library to disk (save as...) seems not to work with GW 7.0.2 (german). The files are stored with the name of the drive letter only, no extension! When saving multiple documents, only the last one is saved, and also with only t

  • Formula IF ELSE

    Hi, I have 2 columns, PP Jan and PP Feb. What I want is a FORMULA for BEX that has the logic, IF PP JAN is 0 then PP FEB is 0. Please provide a  bex formula not the words but a full formula that I can copy paste and test. this will be helpful Regards