Sorting and return values from parralell arrays

import java.io.*;
import java.util.*;
class Check{
     String words;
     String signature;
     Check(String w, String s){
          words = w;
          signature = s;
class Test{
     static String[]a = new String[100];
     static String[]b = new String[100];
     public static void main(String[] args)throws IOException{
          Scanner in = new Scanner(new FileReader("input.txt"));
          //Check []ch = new Check[100];
          String str = in.next();
int z = 0;
      while(!(str.equals("$$$$"))){            
       a[z] = str;
       b[z] = getNumberSequenceFromString(str);
       z++;
       str = in.next();
          insertionSort(a,0,z);
          insertionSort(b,0,z);
     //     for(int i = 0; i < z; i++){
///     System.out.println(a);
          for (int i = 0; i < z ; i++){
               System.out.println(a[i]+" "+b[i]);
          String key = "225533";//should give the word "move", istead it is giving me "TEXT" which is incorrect
          int rope = binarySearch(key,b,0,z-1);
          System.out.println("rrrrrrrrrrrrrrropr "+ rope);
          System.out.println("i found him :"+a[rope/2]);
     }//end main
     public static String getNumberSequenceFromString(String word){
          int l = word.length();
          String str = " ";
          word = word = word.toLowerCase();
     for(int i = 0; i < l; i++){
               char y = word.charAt(i);
     if(y < 100){
          str +=2;
     }else if(y < 103){
          str +=3;
     }else if( y < 106){
          str +=4;
     }else if( y < 109){
          str += 5;
     }else if(y < 112){
          str += 6;
     }else if(y < 116){
          str += 7;
     }else if (y < 119){
          str += 8;
     }else{
          str +=9;
     }//end for
          return str;
     }//end getWord();
     public static void insertionSort(String[]list,int lo, int n){
     for(int j = lo+1; j < n; j++){
          String key = list[j];
          int k = j-1;
          while(k >= lo && key.compareToIgnoreCase(list[k]) < 0){
               list[k + 1] = list[k];
               --k;
          }//end while
          list[k+1] = key;
     }//end for
}//end insertion sort
     public static int binarySearch(String key, String[]b, int lo, int hi){
     while(lo <= hi-1){
          int mid = (lo + hi)/2;
          System.out.println("i am mmmmmmmmmmmmmid" + mid);
          int cmp = key.compareToIgnoreCase(b[mid]);
          if (cmp==0)return mid;
          if (cmp < 0)hi = mid -1;
          else lo = mid + 1;
     }//end while
     return lo;
}//end binarysearch
}//end classAbove is my revise code.  Your idea worked fine, thank you.  I have a problem though.  I tried to create a class eg:
class Check{
String words;//for words
String signature; //for numbers
Check (String w, String s){
words = w;
signature = s;
The idea was to store the word and its signature as an object, after which I would sort.  Howerver, when I tried reading in the values eg: check[]=str, number, it did not work.  I tried 2 separate arrays, but now I cannot return the correct word. I need some help on this one.
Questions:
How could I combine both arrays so that I could sort them, then search a value in the array and return the correct string?
I tried a class but i could not get it to work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

I'm not going to try to read all that messy code. Here is some advice.
1. Don't use parallel arrays.
2. If you're going to insist on doing it the wrong way and using parallel arrays, then first get your sort working for a single array.
3. If you're going to insist on doing it the wrong way and using parallel arrays, then after getting the sort to work with a single array, in the part where you're swapping elements, whatever you do to swap in the first array, you'll need to do to the second array as well.
4. Break your code down into methods.

Similar Messages

  • Calculating min and max value from number array

    I have array which is having return type Number.i want to calculate min and max value of this array..try to help asap..
    Thanks
    dhanu

    hi there,
    public class MinMax {
         int arr[]= { 27, 3, 42, 18, 243, -43, 6, -8 };
         int min, max;
         public MinMax() {
    // it's very bad way to do it.
    //          min=99999;
    //          max=-99999;
    // this must be as following
                    min = max = arr[0];
              search();
              System.out.println("The minimum value is: "+min);
              System.out.println("The maximum value is: "+max);
         private void search() {
    // and here we can search from <1> index instead of <0>
              for (int j=1; j<arr.length; j++) {
                   if (arr[j]<min) {
                        min=arr[j];
                   else if (arr[j]>max) {
                        max=arr[j];
         public static void main(String args[]) {
              new MinMax();
    there is a bug in the supplied code. Your homework is
    to figure out what it is without posting another
    message for help with your homework.well, i think it's a tragedy :(

  • Multithreading and Returning Value from RMI

    Hi all,
    I have an RMI Object which is Multi Threaded. The scenario is like this:
    The client program will pass different program specific codes to the RMI object. Multiple clients can pass same or different codes. If the codes are different they can share common data in an asynchronous way other wise they need to be synchronized.
    This RMI object will do some database transactions and will return a value to the client. I am not sure how to return a value to the client which has invoked this method as this method executes asynchronously.
    I am sorry if this posting is inappropriate for this forum.
    Thanks in Advance
    Srinivas

    If the database transaction executes asyncrhonously, the remote method has to wait for it and return the result via the return statement.
    As the remote request is already executing in a thread of its own there is of course no need for the database transaction to execute asynchronously from RMI's point of view so if you can get rid of that complication in your architecture you may as well do it. OTOH your application architecture may do it for other reasons

  • Returning both raise_application_error and return value from db function...

    Hi ,
    I use Oracle 10g and forms10g.
    I have written a db packaged function such as:
    function fnc_ipologismos_xiliometron(code_poleis_apo_var in varchar2,code_poleis_pros_var in varchar2)
       return number
       is
        apostasi_var ref_apostaseis_poleon.apostasi%type;
        onomasia_pol_apo_var ref_poleis.onomasia%type;
        onomasia_pol_pros_var ref_poleis.onomasia%type;
        begin
         begin
            select onomasia into onomasia_pol_apo_var
              from ref_poleis
              where code_poleis=code_poleis_apo_var;
         end;
         begin
            select onomasia into onomasia_pol_pros_var
              from ref_poleis
              where code_poleis=code_poleis_pros_var;
         end;
         begin
          select apostasi into apostasi_var
           from ref_apostaseis_poleon
           where code_poleis_apo=code_poleis_apo_var and code_poleis_pros=code_poleis_pros_var;
          exception
           when no_data_found
    then
    apostasi_var:=0;
    return apostasi_var;
    raise_application_error(-20015,'a message');
    --return apostasi_var;
    end;      return apostasi_var;
        end;The problem is that when the exception written above (in bold) returns 0 and exits the function.... whereas i want this value to be returned as well as the message in the raise_application_error....
    I call this function in WHEN-VALIDATE-ITEM of a block item... such as:
    if pkg_mod3_general.fnc_ipologismos_xiliometron
    (:mod3_entoli_metakinisis.code_poleis_apo_type_id,:mod3_entoli_metakinisis.code_poleis_type_id)=0
                  and :mod3_entoli_metakinisis.seq_code_meso_metakin_type_id=2
                  then
                    raise form_trigger_failure;
      end if;     When the above condition is true then no message is displayed and the cursor sticks to the item(as the raise_application_error in the db packaged function is after the exit of the function) and when the condition is false then no message is displayed again ... as expected.....
    How is it get the desired result.....- get the message from the raise_application_error and the function returns 0.....?????
    Many thanks,
    Simon

    you cannot RETURN and RAISE a function.
    RETURN ends the function immediately
    RAISE ends the program unit and jumps in the EXCEPTION-Handler, if it exists. Else the function ends

  • How to Sort by the length of the returned value from a query.

    Hi,
    I was wondering if it is possible to sort by the length of the returned value from a query?
    For example if I want to get a list of people with the name 'Samuel', I would like to short by how short the length of the whole name is.
    Sort by length of the name in SQL
    Samuel Syda
    Samuel Indranaka
    Samuel Johnsons
    Samuel Longhenderson
    Thank you.

    Hi,
    Sorting is done by an ORDER BY clause at the end of the main query.
    In most cases, you can ORDER BY any expression, even f it is not in the SELECT clause.  In this case, it sounds like you just need:
    ORDER BY  LENGTH (name_column)
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Post your query, using an ORDER BY clause like the one above, and point out where that query is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • Finding the smallest value from an array

    Hi there :)
    I started learning Java a few days ago and have now run into my first problem :p
    I am using Netbeans on Mac OS X.
    I need to find the smallest value from an array. So far I've had no luck. Any suggestions would be fantastic.
    The code so far:
    * Math Problems
    * Created on May 4, 2007, 10:54 AM
    * PROJECT 1: - IN PROGRESS
    * Create a program that allows you to create an integer array of 18 elements with the following values
    * 3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0
    *  - The program computes the sum of elements 0 to 14 and stores it in element 15                              // COMPLETED
    *  - The program computes the average and stores it in element 16                                              // COMPLETED
    *  - The program finds the smallest value from the array and stores it in element 17
    * PROJECT 2: - TO DO
    * Write a program that accepts from the command line and prints them out. Then use a for loop to print
    * the next 13 numbers in the sequence where each number is the sum of the previous two. FOR EXAMPLE:
    *  - input>java prob2 1 3
    *  - output>1 3 4 7 11 18 29 47 76 123 322 521 843 1364
    * PROJECT 3: - TO DO
    * Write a program that accepts from the command line two numbers in the range from 1 to 40. It then
    * compares these numbers against a single dimension array of five integer elements ranging in value
    * from 1 to 40. The program displays the message BINGO if the two inputted values are found in the array
    * element. FOR EXAMPLE:
    *  - input>java prob3 3 29
    *  - output>Your first number was 3
    *  -        Your second number was 29
    *  -        Its Bingo!  // This message if 3 and 29 are found in the array
    *  -        Bokya!      // This message if 3 and 29 are not found in the array
    *  -        The array was 7 5 25 5 19 30
    * PROJECT 3 EXTENSION: - OPTIONAL
    * Generate the array of 5 unique integers using random numbers
    package mathproblems;
    * @author Mohammad Ali
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            int A[]={3,2,4,5,6,4,5,7,3,2,3,4,7,1,2,0,0,0};
            int O = A.length - 3;
            int B = A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] + A[7] + A[8] + A[9] + A[10] + A[11] + A[12] + A[13] + A[14];
            A[15] = B;  // Stores the sum of the integers in A[15]
            int C = B / O;
            A[16] = C;  // Computes and stores the average in A[16]
            int D = 101;
                if (A[0] < A[1]) { D = A[0]; }
                else { D = A[1]; }
                if (A[1] < A[2]) { D = A[1]; }
                else { D = A[2]; }
            System.out.println("There are " + O + " numbers in the Array");
            System.out.println("Those numbers add up to " + B + ".");
            System.out.println("The average of those numbers is " + C + ".");
            System.out.println("The smallest value in the array is " + D + ".");
    }The code is incomplete, but it works so far. The problem is I know there must be an easier way. SAVE ME :)

    OK :)
    Just thought I should show you the output as to help anyone else with the same problem:
    * Math Problems
    * Created on May 4, 2007, 10:54 AM
    * PROJECT 1: - IN PROGRESS
    * Create a program that allows you to create an integer array of 18 elements with the following values
    * 3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0
    *  - The program computes the sum of elements 0 to 14 and stores it in element 15                              // COMPLETED
    *  - The program computes the average and stores it in element 16                                              // COMPLETED
    *  - The program finds the smallest value from the array and stores it in element 17                           // COMPLETED
    * PROJECT 2: - TO DO
    * Write a program that accepts from the command line and prints them out. Then use a for loop to print
    * the next 13 numbers in the sequence where each number is the sum of the previous two. FOR EXAMPLE:
    *  - input>java prob2 1 3
    *  - output>1 3 4 7 11 18 29 47 76 123 322 521 843 1364
    * PROJECT 3: - TO DO
    * Write a program that accepts from the command line two numbers in the range from 1 to 40. It then
    * compares these numbers against a single dimension array of five integer elements ranging in value
    * from 1 to 40. The program displays the message BINGO if the two inputted values are found in the array
    * element. FOR EXAMPLE:
    *  - input>java prob3 3 29
    *  - output>Your first number was 3
    *  -        Your second number was 29
    *  -        Its Bingo!  // This message if 3 and 29 are found in the array
    *  -        Bokya!      // This message if 3 and 29 are not found in the array
    *  -        The array was 7 5 25 5 19 30
    * PROJECT 3 EXTENSION: - OPTIONAL
    * Generate the array of 5 unique integers using random numbers
    package mathproblems;
    * @author Mohammad Ali
    import java.util.Arrays;
    public class Main { 
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
         public static void main(String[] args) {
                  int A[]={3,2,4,5,6,4,5,7,3,2,3,4,7,1,2,0,0,0};
              Arrays.sort(A);
              System.out.println("The smallest value in the array is " + A[0] + ".");
              int num = A.length;
              System.out.println("There are " + num + " values in the Array.");
              int sum = 0;
              for (int i = 0; i < A.length; i++) {
                   sum+=A;
              System.out.println("Those numbers add up to " + sum + ".");
              double d = (double)sum/num;
              System.out.println("The average value of those numbers is " + d + ".");
    What Iearned:
    1) How to create for loops properly
    2) How to import java.util.Arrays ( =D )
    3) How to get a more accurate average using double instead of int
    4) This forum is the best and has very helpful people 24/7 ( =D)
    Thanks Again,
    Mo.

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Get distinct values from plsql array

    Hi,
    I have declared a variable as below in plsql proc.
    type t_itemid is table of varchar2(10);
    inserted set of items in to this using a program
    now i want distinct values from that array how can i get it.

    I am using 9i so i cannot use set operator and more over my problem is that i am declaring the variable inside the plsql block . when i tried i am getting the below errors:
    SQL> r
    1 declare
    2 type t_type is table of varchar2(10);
    3 v_type t_type;
    4 begin
    5 v_type := t_type('toys','story','good','good','toys','story','dupe','dupe');
    6 for i in (select column_value from table(v_type)) loop
    7 dbms_output.put_line(i.column_value);
    8 end loop;
    9* end;
    for i in (select column_value from table(v_type)) loop
    ERROR at line 6:
    ORA-06550: line 6, column 41:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 6, column 35:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 10:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 7, column 22:
    PLS-00364: loop index variable 'I' use is invalid
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • How to get return values from stored procedure to ssis packge?

    Hi,
    I need returnn values from my stored procedure to ssis package -
    My procedure look like  and ssis package .Kindly help me to oget returnn value to my ssis package
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [TSC]
    -- Add the parameters for the stored procedure here
    @P_STAGE VARCHAR(2000)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    --SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
    truncate table [INPUTS];
    INSERT
    INTO
    [INPUTS_BASE]
    SELECT
    [COLUMN]
    FROM [INPUTS];
    RETURN
    END
    and i am trying to get the return value from execute sql task and shown below
    and i am taking my returnn value to result set variable

    You need to have either OUTPUT parameters or use RETURN statement to return a value in stored procedures. RETURN can only return integer values whereas OUTPUT parameters can be of any type
    First modify your procedure to define return value or OUTPUT parameter based on requirement
    for details see
    http://www.sqlteam.com/article/stored-procedures-returning-data
    Once that is done in SSIS call sp from Execute SQL Task and in parameter mapping tabe shown above add required parameters and map them to variables created in SSIS and select Direction as Output or Return Value based on what option you used in your
    procedure.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Getting Return values from RFC function call with visual basic

    Hi,
    I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
       SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
            Export parameters (to SAP):
                    - Student Name [char 10]         ==> "STUNAME"
                    - Student ID         [char 20]        ==> "STUID"
           Return values (From SAP):
                    - Results [char 10]        ==> "RESULT"
                    - Remarks [char 200]        ==> "REMARKS"
    i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
    Here's my vb code to accessing the function
            Dim R3 As Object
            Dim FBFunc As Object
            Dim returnFunc As Boolean
            Dim connected As Boolean
            R3 = CreateObject("SAP.Functions")
            R3.Connection.Client = "000"
            R3.Connection.User = "BCUSER"
            R3.Connection.Password = "minisap"
            R3.Connection.Language = "DE"
            R3.Connection.System = "dtsystem"
            R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx" 
            connected = R3.Connection.Logon(0, True)
            If connected <> True Then
                MsgBox("Unable to connect to SAP")
            End If
            FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
            FBFunc.exports("STUNAME") = "Jonny"
            FBFunc.exports("STUID") = "12345"
            returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
    thanks alot.
    Edited by: Eugene Tan on Mar 4, 2008 7:17 AM

    Hi Gregor,
    Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
    Below is the code snippet.
    Set impReturn = CHPASS_FN.Imports("RETURN")  <<=== is RETURN the standard keyword to get a                                                                                return object?
      expPassword.Value = currpass
      expNewPass.Value = newpass
      expFillRet.Value = "1"
    ''' Call change password function
      If CHPASS_FN.Call = True Then
        outFile.Write (", Called Function")
        Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return                                                               value variable names?
        outFile.WriteLine " : " & Message
      Else
        outFile.Write (", Call to function failed")
      End If
    thanks alot...all your help is very appreciated.

  • How to store the return value from a select list in page item ?

    I'm sorry, I'm sure you will all flame me for this (and its long too :-(. I'm still trying to pick this up and havn't had time to read manual and this forum and up against the clock (as usual), but this must be something thats simple to do, otherwise why have 2 cols on LOV (display text and return value.
    normal kind of thing - master /detail, a master table and a detail table, master.id is PK in master, master.name is the name of the master item. detail.id is pk in detail, detail.mid is foreign key to master.id. I have a tabular report that displays a join of cols from master and detail, with 2 cols being links, one is a link on master.name, that passes master.id to page P1 and it displays a row from master. The other col displays detail.name and passes detail.id to page P3, P3 displays a row of the detail table.
    I want to populate a LOV with possible master.name values, but display the name of the current P3_MID value (from detail.mid). Then a user can pick a different master and it needs to update P3_MID so on submit it updates the row.
    I just can't seem to see in the manual how you can specify where the return value on a LOV goes?
    As I said, sorry for long post and not having had time to read docs correctly - someone just point me at the subject matter somewhere, please.

    Sorry, I was trying to be to complex and obviously APEX is just too damn cleaver - I figured out how this works - basically APEX pulls the LOV and then matchs the mid to it to display the correct name - simple and easy - just me making it difficult

Maybe you are looking for

  • How do I turn off applications operating in the background

    I used to be able to turn off applications operating in the background.  Since the last software update, I can't do it.

  • Oracle Apps R12.1.1 is not working properly with Toad

    Hi, Environment TOAD 7.6.0.11 Oracle Database 11.1.0 Oracle Apps 12.1.1 Q) When I Connect Oracel Application R12.1.1 database through Toad is not showing object definication like Procedures, function and Trigers defination in Toad. But it is working

  • Can't load mac drivers

    When I try to load mac drivers I get the following message" Bootcamp X64 is unsupported on this computer model."   Windows installed properly except for this problem. I could run Microsoft Office but I need the Mac drivers to run video applications I

  • An app reflects installed but no icon, how do I find it.

    I installed iBooks but there is not an icon. The app appears in my settings and in the app store as installed. What do I do now to find or be able to reinstall.

  • Encore authored DVD displaying wrong audio track language info

    Authored a number of DVDs using Encore CS6. Some play fine and some show incorrect audio track language info when played back on a DVD player even though they are programmed correctly and the same as the ones playing correctly. Has anyone else encoun