Help with call to BAPI

Hi all!
I need help trying to create order with multiple line items in SAP using BAPI.
I'm very new to SAP and I'm trying to work on a prof of concept to create orders in SAP using/calling BAPI's from Visual Basic (in Visual Studio 2005). I got the .net connector that I'm using for the proxy connection and I'm able to create order with one line item. But the problem is when I try to create one with multiple line items. I'm calling BAPI_SALESORDER_CREATEFROMDAT2 and loading item table with 3 items and also loading the schedule table but what I get is order gets created with 3 line items but all are the same item and its the last one.
I'm guessing that problem is one how I'm adding the items to the table, it know that I have 3 items but the detail informations gets over written by the last item that I'm adding.
Any ideas?
Thank You

Hi,
  Welcome To SDN!!
Try this out...
Report ZBapi .
data: po_items type table of bapiekpo with header line.
parameters: p_ebeln type ekko-ebeln.
call function 'BAPI_PO_GETDETAIL'
exporting
purchaseorder = p_ebeln
ITEMS = 'X'
ACCOUNT_ASSIGNMENT = ' '
SCHEDULES = ' '
HISTORY = ' '
ITEM_TEXTS = ' '
HEADER_TEXTS = ' '
SERVICES = ' '
CONFIRMATIONS = ' '
SERVICE_TEXTS = ' '
EXTENSIONS = ' '
IMPORTING
PO_HEADER =
PO_ADDRESS =
tables
PO_HEADER_TEXTS =
po_items = po_items
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_SCHEDULES =
PO_ITEM_CONFIRMATIONS =
PO_ITEM_TEXTS =
PO_ITEM_HISTORY =
PO_ITEM_HISTORY_TOTALS =
PO_ITEM_LIMITS =
PO_ITEM_CONTRACT_LIMITS =
PO_ITEM_SERVICES =
PO_ITEM_SRV_ACCASS_VALUES =
RETURN =
PO_SERVICES_TEXTS =
EXTENSIONOUT =
check sy-subrc = 0.
loop at po_items.
write:/ po_items.
endloop.
Refer
http://abap.wikiprog.com/wiki/BAPI_PO_GETDETAIL1
Regards
Kiran SURE

Similar Messages

  • Problem with call to BAPI when the data contains spaces

    Hi everyone,
    I've a table in R3 that has 2 fields which is consulted via BAPI from XI. The Bapi call run correctly while the data don't contain spaces preffixed but when for example the data is ' A31' the BAPI call doesn't return nothing.
    The table structure is:
    CODE             DESCRIPTION
    values:
    ' A31'               'Desc A'
    'A30'                'Desc B'
    When I call the bapi with A30 value the Bapi return me Desc B, but when I try it with the value ' A31' the Bapi doesn't return any value.
    Could anyone help me?
    Thanks in advance

    >>The problem isn't the trim, because the bapi call must contain the spaces.
    Are you able to get expected results while testing the BAPI with data containing spaces?
    I have seen some cases where you get correct results when you test the RFC in SE 37, but the same data when passed from XI does not get the desired results. It was coz. when testing the RFC in R/3 some user exits are called and the data fets populated in the correct way. Check this.
    Regards,
    Jaishankar

  • Help with calling a Get URL

    I am having a problem with calling a series of web pages
    within my movie. I have an index.fla that I publish to html. Within
    the index.html, I am calling multiple swf files to load content.
    Home.swf loads when the index page displays. Then the user clicks
    on any button and each button loads another swf replacing the main
    content with perhaps loading it's own swf files of content also.
    Everything is working fine. However, on one called swf file, called
    students.swf, I also have a menu swf file that is called when
    students loads. This menu swf file has text listed with
    actionscripting calling a data file that causes the text to expand
    and rollout and display a label of the url. When the user clicks on
    the list name I have a get url to the url of the label. Everything
    works fine in the swf files when I test the movies for the swf for
    the menu file and for the student file swf. However, when I publish
    and run the index page and start testing out the student swf that
    is called, the menu will not open up a new browser window with the
    link designated in the get url. I can't figure it out! It works
    fine in the swf files, but not when I test it out through the index
    controlling file. Please Help!!!

    if you're using as2, try adding
    this._lockroot=true;
    to the movieclip that contains getURL, the student file
    swf.

  • Need help with Call By Reference on cRIO-9012

    I have a RT application running on a cRIO-9012 in which I am attempting to establish references to a variable number of clones of the PID Autotuning (Temperature).vi, and then passing these references to a FOR loop in which I am opening each clone with a Call By Reference node to perform the PID.  Essentially, I am trying to make the PID Autotuning (Temperature).vi accept an array of process variables, similar to the behaviour that some of the simpler PID VIs provide out-of-the-box. 
    The code I am using to obtain the references is here:
    ...and the code within the control loop where I am trying to do the processing is here:
    The problem I am encountering, according to the Highlight Execution tool, is that all inputs to the Call By Reference node are present and reach the node, but all processing stops at this point on the first iteration and the cRIO hangs.  I cannot stop the SubVI or the RT parent VI without performing a software restart on the target.
    I don't know if I am using the Call By Reference node or Open VI Reference functions incorrectly, or if there is a problem with the VI being part of a library, or if something else is wrong.  Any help would be appreciated.
    Sean

    I'm not sure this is your issue, but I think there's a conflict between opening a bunch of rereferences, and then setting the asynchronous call pool size for one of them.You don't need asynchronous execution here, you just need reentrant parallel execution (you may not even need the parallel part; your current code, if it worked, would execute sequentially, and the PID calculation is just math so should be quick and may not benefit from parallel execution). You do need reentrant execution to maintain separate data spaces.
    Try opening the references with the 0x08 (Prepare for Reentrant Run) flag instead. Remove the Populate Asynchronous Call Pool. If this works, you can run in parallel by enabling For loop parallelism - but you might find that's actually slower, especially on a cRIO.

  • Need help with Calling objects

    I have created an object named "user" and I currently have 1 Frame in my program. The first frame is called "LogonFrame" and the second is called "UserDataFrame".
    In the main method of the application I declare a "User" object as user and then call LogonFrame to retreive the logon_name and password from the user. The logon_name and password will be placed in the User object to be accessed throughout the application.
    When I compile the application I receive the following error message:
    Error: (85) variable user not found in class GL2.LogonFrame
    *I know that 85 is the line number that the error is located
    *GL2 is the name of the package.
    Has anyone ever encountered this error before, and if so how can I fix this error.
    *Listed below is the code used in the User object if it helps at all.
    Jason Franz
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    * A Class class.
    * <P>
    * @author Jason T. Franz
    public class User extends Object {
    private static int user_id;
    private static String first_name;
    private static String last_name;
    public static void User(){
    user_id = 0;
    first_name = "";
    last_name = "";
    //sets the user ID
    public static void setUserID(int newID){
    user_id = newID;
    //Returns the User ID
    public static int getUserID(){
    return user_id;
    //Sets the User First Name
    public static void setFirstName(String newFirstName){
    first_name = newFirstName;
    //Gets the Users First Name
    public static String getFirstName(){
    return first_name;
    //Sets the Users Last Name
    public static void setLastName(String newLastName){
    last_name = newLastName;
    public static String getLastName(){
    return last_name;
    //Resets all data in the User Class
    public static void reset(){
    user_id = 0;
    first_name = "";
    last_name = "";

    The code below is a small portion of the program.
    If it helps at all I am useing Oracle JDeveloper version 3.2.3 with JDK1.2.2_JDeveloper
    This section is the User object
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    * A Class class.
    * <P>
    * @author Jason T. Franz
    public class User extends Object {
      private String first_name;
      private String last_name;
      public User(){
        first_name = "Jason";
        last_name = "Franz";
      //Sets the User First Name
      public void setFirstName(String newFirstName){
        first_name = newFirstName;
      //Gets the Users First Name
      public String getFirstName(){
        return first_name;
      //Sets the Users Last Name
      public void setLastName(String newLastName){
        last_name = newLastName;
      public String getLastName(){
        return last_name;
      //Resets all data in the User Class
      public void reset(){
        first_name = "";
        last_name = "";
        logon_name = "";
        user_password = "";
    }Here is the main method.
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * GL2.DevilsHead
    * <P>
    * @author Jason T. Franz
    public class DevilsHead {
      public User user = new User();
       * Constructor
      public DevilsHead() {
        AddUserFrame frame = new AddUserFrame();
        //Center the window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        frame.setLocation((screenSize.width - frameSize.width)/2, (screenSize.height - frameSize.height)/2);
        frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });
        frame.setVisible(true);
       * main
       * @param args
      public static void main(String[] args) {
        try  {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        catch (Exception e) {
          e.printStackTrace();
        new DevilsHead();
    }and here is the Frame which calls the user object to display the Information.
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * A Swing-based top level window class.
    * <P>
    * @author Jason T. Franz
    public class AddUserFrame extends JFrame {
      BorderLayout borderLayout1 = new BorderLayout();
      JPanel jPanel1 = new JPanel();
      Button button1 = new Button();
       * Constructs a new instance.
      public AddUserFrame() {
        super();
        try  {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
       * Initializes the state of this instance.
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(borderLayout1);
        this.setSize(new Dimension(400, 300));
        button1.setLabel("button1");
        button1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            button1_actionPerformed(e);
        this.setTitle("Add a User");
        this.getContentPane().add(jPanel1, BorderLayout.CENTER);
        jPanel1.add(button1, null);
      void button1_actionPerformed(ActionEvent e) {
        System.out.println(user.getFirstName());
        System.out.println(user.getLastName());
    }The error I receive is
    Error: (51) variable user not found in class GL2.AddUserFrame

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
    &#91;code&#93;
      // your code block goes here.
    &#91;/code&#93;

  • URGENT, Please help with calling one program in another

    I am am trying to call Ch4Ex5 within Ch3Ex5. The teacher said it should take about 6 lines of modification within Ch3Ex5 to be able to call out Ch4Ex5. I also might need to modify Ch4Ex5 to get it to work. But I spent many hours and its due soon and I still cant figure it out. I think the teacher assigned this too early in the semester because most the kids dont know how to do it.
    Here is Ch3Ex5
    import java.util.*;
    public class Ch3Ex5
         public static void main(String[] args)
              Scanner kb = new Scanner(System.in);
              int aCount = 0, bCount = 0, cCount = 0, dCount = 0, fCount = 0;
              int nScores = 0;
              int lowest, highest;
              int currentScore;
              int totalOfScores = 0;
              double average;
              do
                   System.out.print("Enter a score (negative value to quit): ");
                   currentScore = kb.nextInt();
                   kb.nextLine();
                   if(currentScore > 100)
                        System.out.println("Scores cannot be greater than 100, please try again");
              } while(currentScore > 100);
              lowest = currentScore;
              highest = currentScore;
              while(currentScore > 0)
                   nScores++;
                   totalOfScores += currentScore;
                   if(lowest > currentScore)
                        lowest = currentScore;
                   if(highest < currentScore)
                        highest = currentScore;
                   if((100 >= currentScore) && (currentScore >= 90)) aCount++;
                   else if(currentScore >= 80) bCount++;
                   else if(currentScore >= 70) cCount++;
                   else if(currentScore >= 60) dCount++;
                   else fCount++;
                   do
                        System.out.print("Enter a score (negative value to quit): ");
                        currentScore = kb.nextInt();
                        kb.nextLine();
                        if(currentScore > 100)
                             System.out.println("Scores cannot be greater than 100, please try again");
                   } while(currentScore > 100);
              System.out.println("Number of scores: " + nScores);
              if(nScores > 0)
                   System.out.println("Number of A's = " + aCount);
                   System.out.println("Number of B's = " + bCount);
                   System.out.println("Number of C's = " + cCount);
                   System.out.println("Number of D's = " + dCount);
                   System.out.println("Number of F's = " + fCount);
                   System.out.println("Percent A's = "+(100.0*aCount/nScores));
                   System.out.println("Percent B's = "+(100.0*bCount/nScores));
                   System.out.println("Percent C's = "+(100.0*cCount/nScores));
                   System.out.println("Percent D's = "+(100.0*dCount/nScores));
                   System.out.println("Percent F's = "+(100.0*fCount/nScores));
                   System.out.println("High score: " + highest);
                   System.out.println("Low score: " + lowest);
                   average = (double) totalOfScores / nScores;
                   System.out.println("Average score = " + average);
    import java.util.*;
    public class Ch4Ex5
         public static void main(String[] args)
              Scanner kb = new Scanner(System.in);
              double gradeA, gradeB, gradeC, gradeD, gradeF, total;
              double aCount, bCount, cCount, dCount, fCount;
              System.out.println("Enter in the number of each grades");
              System.out.println("In this order, A's, B's, C's, D's, F's");
              gradeA = kb.nextDouble();
              gradeB = kb.nextDouble();
              gradeC = kb.nextDouble();
              gradeD = kb.nextDouble();
              gradeF = kb.nextDouble();
              System.out.println("0    10   20   30   40   50   60   70   80   90   100");
              System.out.println("|    |    |    |    |    |    |    |    |    |    |");
              System.out.println("***************************************************");
              total = gradeA + gradeB + gradeC + gradeD + gradeF;
              aCount = (((gradeA) / (total)) * 100);
              bCount = (((gradeB) / (total)) * 100);
              cCount = (((gradeC) / (total)) * 100);
              dCount = (((gradeD) / (total)) * 100);
              fCount = (((gradeF) / (total)) * 100);
                   for (int i= 0; i < aCount; i = i +2)
                   System.out.print('*');
              System.out.println("A");
                   for (int i= 0; i < bCount; i = i +2)
                   System.out.print('*');
              System.out.println("B");
                   for (int i= 0; i < cCount; i = i +2)
                   System.out.print('*');
              System.out.println("C");
                   for (int i= 0; i < dCount; i = i +2)
                   System.out.print('*');
              System.out.println("D");
                   for (int i= 0; i < fCount; i = i +2)
                   System.out.print('*');
              System.out.println("F");
    }

    Here's a tip for you: it doesn't really matter if you post in New to Java or Java Programming. Post once, be patient and you will get a reply. As I said keep up this style of posting and nobody will be willing to help you.
    Why am I freaking out over double posting? Lets say Fred reads and replies in Thread A. Then Barney comes along and reads Thread B not knowing that Fred has already given an answer in Thread B. So Barney ends up wasting his time by posting the same answer in Thread B. Once again it aint rocket science!

  • Help with calling a web service on an external system

    All right you Xi gurus, I'm a Basis guy whom has installed XI 3.0 SP13 and now I would like to get setup a fairly "real world" example.  I have read the help section but it kind of hard to follow.  I have followed the demo examples and they somewhat work and I followed the "XI30SP14_SimpleUse.pdf" which showed me how to do a simple file transfer and mapping but a considerable amount of work was done for me.  And yesterday I received the 'SAP Exchange Infrastructure' book from SAP-Press.  Thumbing through the book I see it contains detailed information on the functionality but nothing so far on how to setup the whole process of start to finish.
    Here is what I would like to do...I would like to call an external web service from my R/3 4.6C system via XI.   Could someone help by detailing the general steps of setting this up?  Thanks in advance.

    Hi Kartik,
    have you seen this blog by Thomas?
    <a href="/people/thomas.jung3/blog/2005/01/11/publishing-abap-webservices-to-an-external-uddi-server ABAP WebServices to an External UDDI Server</a>
    Regards
    Raja

  • Help with calling a java application from inside another one

    Hello!
    I am having this problem which is getting on my nerves and dont know how to solve..
    I want to call from my java application, another java application. So i use the exec command. Then i want to read the output of this execution from my own application, (the "parent" process).
    But it doesn work properly. Something seems to happen and i dont get the whole output.
    The java program i want to call is created for running an application created with Matlab java builder.
    This program works when called from cmd, but seems not to work when called from inside a java application.
    The code of my java application is:
    Runtime rt = Runtime.getRuntime();
    Process child;
    // The java class getmagic is a special kind of java file that uses classes that work in matlab. It uses a component (.jar) file that is created from matlab java builder. thats why it wants the -classpath and the rest options.
    //I hope you wont get messed up in here.
    String[] callAndArgs = {"java","-classpath",".;C:\\Program Files\\MATLAB\\R2006b\\toolbox\\javabuilder\\jar\\javabuilder.jar;..\\MagicDemoComp\\magicsquare\\distrib\\magicsquare.jar -Djava.library.path=C:\\Program Files\\MATLAB\\R2006b\\bin\\win32;","getmagic","4"};
    try{
    child = rt.exec(callAndArgs);
    InputStream is = child.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line;
    while ((line = br.readLine()) != null)
    System.out.println(line);
    is.close();
    System.out.println(child.waitFor());
    System.out.println("Finished");
    }catch(IOException e) {
    System.err.println("IOException starting process!");
    }catch(InterruptedException e) {
    System.err.println("InterruptedException starting process!");
    The java program (getmagic) thats uses matlab gives the following output (after some time) when called in cmd with argument 4
    Magic square of order 4
    16 2 3 13
    5 11 10 8
    9 7 6 12
    4 14 15 1
    My program shown above only prints:
    Magic square of order 4
    1
    Finished.
    Do i do something wrong? How can i get the rest of the output???
    Thank you very much in advance,
    Stacey
    PS: I am sorry for the length of my post.

    Hello CaptainMorgan08, thanx for the instant reply.
    I tried, but no, i cant.
    Because i cannot include this java aplication that uses matlab into my application, cause 1) it needs special arguments in the compiler and during execution so it can be run and 2) it uses classes that java doesnt have. only the java-like matlab code.
    For example it uses:
    import com.mathworks.toolbox.javabuilder.*;
    import magicsquare.*; //the component which is made from matlab java builder.
    So i cannot compile it with my application!
    If you know of a way, please let me know!
    I know i might be missing something.. something that is obvious to you.. but i ve been working days=nights hardly no sleep..so you can excuse me if i say something foolish..
    Message was edited by:
    Stacey_Gr

  • Help with calling windows executable and hiding it using java

    Hi,
    I have a small utility which calls sqlplus from java , which basically executes a sql file .
    Process sqlProcess = runtime.exec(command);
    Where command is string and has all the required parameters.
    (sqlplus_exe , username_password_sid , sql-file_to_execute_path)
    This works fine but it pops up a sql plus window on screen which kindof the user has control .
    Like the user can close that sqlplus window before the script gets executed completely.
    I want that window to be hidden so that user doesn't have any control on the window and can't interfere with the sql execution.
    So thoght about windows api , ShellExecute where you can provide a parameter to hide the window.
    Details are in below
    [http://support.microsoft.com/kb/224816]
    Now the options I have considered to call ShellExecute are JNI / JNA / Smooth
    I am using eclipse hellios on winxp
    JNI
    I Got the code from some website which has all the required files from here [http://www.heimetli.ch/shellexec.html]
    But I am not able to run the code .
    It says Exception in thread "main" java.lang.UnsatisfiedLinkError: no HSWShellExec in java.library.path
    which I am not able to resolve .
    Even I had put the dll and .h file in the JAVA Build Path> Library section.
    JNA
    looks very simple .But I don't know which library to load and call which funtion :(
    JSMOOTH
    It always gives jsmooth.Native.isAvailable() as false.
    And I dont know how to make it true
    And also thinks that it works the other way around i.e. Jsmooth loads the JVM .Don't know if it can be called from within jvm
    So there I am stuck .
    Any suggestions guys.
    Any example code would be great.
    Thanks in advance.
    Edited by: Rajinder_Sandhu on Jul 14, 2010 7:58 AM

    I got it working with JNI and the sample code from the website
    The whole matter was get the path correctly setup in eclipse.
    The solution is posted here.
    [http://www.eclipsezone.com/eclipse/forums/t49342.html]

  • Help with calling stored procedure and preparing statement

    hi guys help please..I want to call a procedure set the ResultSet to TYPE_SCROLL_INSENSITIVE and CONCUR_UPDATABLE in order for me to scroll thru the resultset from 1st row to end row and vice-versa..but currently, my code has an error becuase im hot sure on how to do this..Can you please help me guys to solve this? Thanks in advance!
    CODE:
                int c = 0;
                String searchArg = txtSearch.getText();
                String studName, mInitial;
                searchArg = searchArg.replace('*', '%');           
                con = FuncCreateDBConnection();
                con.prepareCall("{call dbsample.usp_StudentInfo_SEARCH(?, ?)}");
                *cStmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);*
                cStmt.setString("searchArg", searchArg);
                cStmt.setString("searchType", cmboSearchBy.getSelectedItem().toString());           
                rs = cStmt.executeQuery();           
                if (rs != null){
                    listModel = new DefaultListModel();           
                    lstSearchResult.setModel(listModel);
                    while (rs.next()){                                      
                          mInitial = rs.getString(4).substring(0, 1).toUpperCase();
                          studName = rs.getString(3) + ", " + rs.getString(2) + " " + mInitial + ".";                     
                          listModel.addElement(studName);
                    System.out.println("Rows:"+ rs.getString(2));                                                     
                          c++;
    ERROR:
    Incompatible Types
    Found : java.sql.Statement
    Required: java.sql.CallableStatement

    Nevermind guys..i got it..
    CODE:
                int c = 0;
                String searchArg = txtSearch.getText();
                String studName, mInitial;
                searchArg = searchArg.replace('*', '%');           
                con = FuncCreateDBConnection();           
                cStmt = con.prepareCall("{call dbsample.usp_StudentInfo_SEARCH(?, ?)}",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
                cStmt.setString("searchArg", searchArg);
                cStmt.setString("searchType", cmboSearchBy.getSelectedItem().toString());           
                rs = cStmt.executeQuery();           
                if (rs != null){
                    listModel = new DefaultListModel();           
                    lstSearchResult.setModel(listModel);
                    while (rs.next()){                                      
                          mInitial = rs.getString(4).substring(0, 1).toUpperCase();
                          studName = rs.getString(3) + ", " + rs.getString(2) + " " + mInitial + ".";                     
                          listModel.addElement(studName);
                    System.out.println("Rows:"+ rs.getString(2));                                                     
                          c++;
                }     Edited by: daimous on Jan 31, 2008 6:04 PM

  • Help with call to web service

    Hello,
    I am using a web service to do address validation. I created the web service and it ran OK, but the report always says no data found. I wanted to see what was in the returned collection, so I created a new region with the following SQL:
    SELECT CLOB001
    FROM wwv_flow_collections c
    WHERE c.collection_name = 'P37_VALIDATECCSZ_RESULTS'
    This has data in it: "Marion 0 Wayne true true 14505 1.0 AddressResponse: /Marion, NY 14505/Val = true/Rel = 1.0/Incp = true/Geo = 0 NY true"
    The default report is failing because the response is not XML code I believe.
    I ran the web service using java and it returns:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns:validateCCSZResponse xmlns:ns="http://validation.util.oss.paetec.com">
    <ns:return xmlns:ax28="http://sag.oss.paetec.com/xsd" xmlns:ax22="http://rmi.java/xsd" xmlns:ax23="http://io.java/xsd" xmlns:ax21="http://client.validation.util.oss.paetec.com/xsd" type="com.paetec.oss.util.validation.client.AddressResponseArray">
    <ax21:responses type="com.paetec.oss.util.validation.client.AddressResponse">
    <ax21:city>Marion</ax21:city>
    <ax21:code>0</ax21:code>
    <ax21:country />
    <ax21:county>Wayne</ax21:county>
    <ax21:incomplete>true</ax21:incomplete>
    <ax21:incorporated>true</ax21:incorporated>
    <ax21:locClli />
    <ax21:postalCode>14505</ax21:postalCode>
    <ax21:postalCodeExtension />
    <ax21:reliability>1.0</ax21:reliability>
    <ax21:shortDescription>AddressResponse: /Marion, NY 14505/Val = true/Rel = 1.0/Incp = true/Geo = 0</ax21:shortDescription>
    <ax21:state>NY</ax21:state>
    <ax21:streetName />
    <ax21:streetNumber />
    <ax21:unit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></ax21:unit>
    <ax21:validated>true</ax21:validated>
    </ax21:responses>
    </ns:return>
    </ns:validateCCSZResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    So, does anyone know why the web service call from APEX does not return the XML code? I am getting the values from the XML code, but I have no way to parse it to get what I need...
    Thanks,
    -- Johnnie

    Hey Jason,
    That is very close to what the generated report looked like, as soon as I put in //validateCCSZResponse/return/responses instead of //validateCCSZResponse/return I get no data found.
    You can run this directly in TOAD, this one returns a row:
    SELECT extractValue( value(T), '//city', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) city
    ,extractValue( value(T), '//county', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) county
    ,extractValue( value(T), '//incomplete', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) incomplete
    ,extractValue( value(T), '//postalCode', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) postalCode
    ,extractValue( value(T), '//reliability', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) reliability
    ,extractValue( value(T), '//state', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) state
    ,extractValue( value(T), '//streetName', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) streetName
    ,extractValue( value(T), '//streetNumber', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) streetNumber
    ,extractValue( value(T), '//validated', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) validated
    FROM TABLE(xmlsequence(extract(XMLTYPE.createxml('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns:validateCCSZResponse xmlns:ns="http://validation.util.oss.paetec.com">
    <ns:return xmlns:ax28="http://sag.oss.paetec.com/xsd" xmlns:ax22="http://rmi.java/xsd" xmlns:ax23="http://io.java/xsd" xmlns:ax21="http://client.validation.util.oss.paetec.com/xsd" type="com.paetec.oss.util.validation.client.AddressResponseArray">
    <ax21:responses type="com.paetec.oss.util.validation.client.AddressResponse">
    <ax21:city>Marion</ax21:city>
    <ax21:code>0</ax21:code>
    <ax21:country />
    <ax21:county>Wayne</ax21:county>
    <ax21:incomplete>true</ax21:incomplete>
    <ax21:incorporated>true</ax21:incorporated>
    <ax21:locClli />
    <ax21:postalCode>14505</ax21:postalCode>
    <ax21:postalCodeExtension />
    <ax21:reliability>1.0</ax21:reliability>
    <ax21:shortDescription>AddressResponse: /Marion, NY 14505/Val = true/Rel = 1.0/Incp = true/Geo = 0</ax21:shortDescription>
    <ax21:state>NY</ax21:state>
    <ax21:streetName />
    <ax21:streetNumber />
    <ax21:unit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></ax21:unit>
    <ax21:validated>true</ax21:validated>
    </ax21:responses>
    </ns:return>
    </ns:validateCCSZResponse>
    </soapenv:Body>
    </soapenv:Envelope>'),'//validateCCSZResponse/return','xmlns="http://validation.util.oss.paetec.com"'))) T
    This returns no rows:
    SELECT extractValue( value(T), '//city', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) city
    ,extractValue( value(T), '//county', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) county
    ,extractValue( value(T), '//incomplete', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) incomplete
    ,extractValue( value(T), '//postalCode', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) postalCode
    ,extractValue( value(T), '//reliability', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) reliability
    ,extractValue( value(T), '//state', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) state
    ,extractValue( value(T), '//streetName', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) streetName
    ,extractValue( value(T), '//streetNumber', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) streetNumber
    ,extractValue( value(T), '//validated', 'xmlns="http://client.validation.util.oss.paetec.com/xsd"' ) validated
    FROM TABLE(xmlsequence(extract(XMLTYPE.createxml('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns:validateCCSZResponse xmlns:ns="http://validation.util.oss.paetec.com">
    <ns:return xmlns:ax28="http://sag.oss.paetec.com/xsd" xmlns:ax22="http://rmi.java/xsd" xmlns:ax23="http://io.java/xsd" xmlns:ax21="http://client.validation.util.oss.paetec.com/xsd" type="com.paetec.oss.util.validation.client.AddressResponseArray">
    <ax21:responses type="com.paetec.oss.util.validation.client.AddressResponse">
    <ax21:city>Marion</ax21:city>
    <ax21:code>0</ax21:code>
    <ax21:country />
    <ax21:county>Wayne</ax21:county>
    <ax21:incomplete>true</ax21:incomplete>
    <ax21:incorporated>true</ax21:incorporated>
    <ax21:locClli />
    <ax21:postalCode>14505</ax21:postalCode>
    <ax21:postalCodeExtension />
    <ax21:reliability>1.0</ax21:reliability>
    <ax21:shortDescription>AddressResponse: /Marion, NY 14505/Val = true/Rel = 1.0/Incp = true/Geo = 0</ax21:shortDescription>
    <ax21:state>NY</ax21:state>
    <ax21:streetName />
    <ax21:streetNumber />
    <ax21:unit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"></ax21:unit>
    <ax21:validated>true</ax21:validated>
    </ax21:responses>
    </ns:return>
    </ns:validateCCSZResponse>
    </soapenv:Body>
    </soapenv:Envelope>'),'//validateCCSZResponse/return/responses','xmlns="http://validation.util.oss.paetec.com"'))) T

  • Help with calling perimeter and area

    how do i get this program to call perimeter and area in main
    public class Rectangle{
    public static void main (String[]args){
    Rectangle1 rectangle = new Rectangle1();
    rectangle.setColor ("white");
    rectangle.setHeight(1);
    rectangle.setWidth(1);
    System.out.println(rectangle.toString());
         class Rectangle1 {
         private String color = "red";
         private double height = 40;
         private double width = 4;
         private double area;
         private double perimeter;
    Rectangle1 () {
         public double getHeight(){
         return height;
         public void setHeight(double height) {
         this.height = height;
         public double getWidth(){
         return width;
         public void setWidth(double width){
         this.width = width;
         public String getColor(){
         return color;
         public void setColor(String color){
         this.color = color;
         //area and perimeter
    double getArea(){
    return height * width;
    double getPerimeter(){
      return height* 2 + width* 2;
    public String toString(){
    return("the area is " + area + "\n" + "the perimeter is " + perimeter + "\n"
    + "color is " + color);
         }     

         public class Rectangle{
    public static void main (String[]args){
    Rectangle1 rectangle = new Rectangle1();
    rectangle.setColor ("white");
    rectangle.setHeight(1);
    rectangle.setWidth(1);
    System.out.println(rectangle.toString());
    rectangle.setArea();
    rectangle.setPerimeter();
    //area and perimeter
    double getArea(){
    return height * width;
    public void setArea(double area){
    this.area = area;
    double getPerimeter(){
      return height* 2 + width* 2;
    public void setPerimeter(double perimeter){
    this.perimeter = perimeter;
    }this is what i did still coming up with zero

  • Help with calling methods of different classes

    I have two classes. In class A I read a line of input from the console
    myVar= x.readLine();
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION here
    in this method I wish to call another method but this time of class B so I create an instance of class B in class A
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION here
    What am I doing wrong?

    What am I doing wrong?Not posting a short snippet of java code that demonstrates your problem.
    In class A I read a line of input from the console
    myVar= x.readLine();
    How is that related to the NPE's?
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION hereSomething is probably wrong in methodA(). Impossible to say anything more with the information given.
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION hereDid you ever assign instanceVar to an actual object with something like instanceVar = new B(); ?

  • Help with calling Oracle Procedure

    First, let me state that I'm new to Oracle and using it with
    ColdFusion, but I've used CF on and off for the past 6 years. So
    this might be a simple "newbie" problem with Oracle and CF.
    My boss wrote the following simple Oracle procedure to
    concatenate three variables together (I know I could do this in CF
    directly, but I need to be able to use his existing procedures in
    Oracle)
    SPEC:
    function ShowCaption(inprecaption in long,
    incaption in long,
    inpostcaption in long,
    method in varchar2,
    xcoord in number,
    ycoord in number)
    return long;
    BODY:
    function ShowCaption(
    inprecaption in long,
    incaption in long,
    inpostcaption in long,
    method in varchar2,
    xcoord in number,
    ycoord in number)
    return long
    is
    begin
    return inprecaption || incaption || inpostcaption;
    end ShowCaption;
    I'm trying to call that procedure using the attached code but
    when I run this code I receive the error "ORA-01008: not all
    variables bound" and I'm not sure why. Searching Google hasn't come
    up with anything and I've used other procedures, but can't seem to
    make this one work. I know the procedure works within Oracle as I'm
    able to run it.
    I would really appreciate any ideas.

    Since he wrote his PL/SQL as a FUNCTION instead of a
    PROCEDURE, it complicates returning the result to ColdFusion. You
    haven't provided any means of capturing the return value of your
    function call in your CFSTOREDPROC call. If he had declared this a
    procedure, then you probably would have added an OUT parameter to
    the PL/SQL and an OUT CFPROCRESULT tag, but since it is a function,
    you are going to have to capture the result differently.
    Try adding a returncode="yes" parameter to your CFSTOREDPROC
    tag, then check the cfstoredproc.statusCode variable for your
    returned result value:
    <cfoutput>#cfstoredproc.statusCode#</cfoutput>
    Normally, I avoid calling Oracle
    functions from ColdFusion because in older versions of CF,
    there was no way of capturing the return value, so I rarely ever do
    it this way. In other words, I strictly write PL/SQL
    procedures for use with ColdFusion. However, if you are
    required to work with an existing function, then the method
    mentioned above may work for you.
    Phil

Maybe you are looking for

  • Schedule the Process Chain automatically in BW

    Hi SDN Guru's, I have an urgent requirement in BW. I want to run the Process Chain automatically in BW when the job for the deltas in R/3 are completed. I know that in BW we can trigger the process chain by the background job only by giving the date

  • Simple layout structure for a webshop, need help, details inside

    Studied htmldb for abit. Still abit confused as how it all works. Read the user guide/done some of the examples in the 2day course pdf. Here is the thing. For starters I like to have two regions: sidebar with some kind of tree structure where it's po

  • Mobile/Cellular Data Setting - Pic Attached

    In Settings > Cellular/Mobile > Use Mobile Data For, the only available Apps are FaceTime and Passbook, none of my other Apps are showing. They always have, then one day disappeared. I have updated to iOS8 but that didn't fix it. I have been hesitant

  • Size of comment icon

    I would like to know how to change the size of the comment symbol. I don´t know what I did but the symbol (standard speech bubble) got much bigger than usual and I would like to get back to the original size.

  • Installing CS 5

    My office has two licenses for Adobe Web Premium CS 5. I am trying to retrieve an unused license and installation. It has been a year since the software was installed on one computer. Thanks for any help. Georgette L. Keeler [private data removed]