Passing to a method.

I have a String array in my main method called "names" it holds several names of people.
What I want to be able to do is create a new method called doBubbleSort(). Creating the bubble sort is not a problem for me... but I don't know how to go about setting up the method so I can pass the "names" array to it for use within the method. Also, how do I go about returning it again so I can output the changed Array.
Thanks.

This isn't a bubble sort or anything but it's just a little sort programme I made to demonstrate passing string arrays as arguments.
import java.util.*;
class passArray
     public static void main(String[] args)
          String[] strNames = { "John", "Mark", "William", "Emma", "Jane" };
          // Display Names in current order
          System.out.println("The names in the current order are:\n");          
          for(int i = 0; i < strNames.length; i++)
               System.out.println("\t" + strNames);
          // Pass the string array to another method
          strNames = sortNames(strNames);
          // Display Names in the sorted order
          System.out.println("\n\nThe names in the sorted order are:\n");          
          for(int i = 0; i < strNames.length; i++)
               System.out.println("\t" + strNames[i]);
     public static String[] sortNames(String[] strNames)
          Arrays.sort(strNames);
          return strNames;

Similar Messages

  • Urgent help req : work item id not getting passed in the method

    Hi ,
    I have created a subtype zcats of business object CATS and delegated it .
    I have created a new method Approve1 ( with attributes  SYNCRONUS & DIALOG )  in zcats which is similar in coding  to Approve method of CATS ( DIALOG) .
    I have include the method Approve1 of business object zcats in a standard task .
    The problem is that when the eorkflow gets triggered ,  the workitem id is not getting passed in the method APProve1 of zcats.
    Can someone please help me with this .
    Points would surely be awarded .

    BEGIN_METHOD APPROVE1 CHANGING CONTAINER.                 
      DATA: WORKITEMID_IMP LIKE OBJECT-KEY-ITEMID.              
      DATA: WI_CHCKWI LIKE SWWWIHEAD-WI_ID.                     
      DATA: WORKITEM TYPE SWC_OBJECT.                           
       <u> WORKITEMID_IMP = OBJECT-KEY-ITEMID</u>.                     
        SWC_GET_ELEMENT CONTAINER '_WORKITEM' WORKITEM.         
        SWC_GET_PROPERTY WORKITEM 'WorkitemReference' WI_CHCKWI.
        IF SY-SUBRC EQ 0 AND NOT WI_CHCKWI IS INITIAL.          
          WORKITEMID_IMP = WI_CHCKWI.                           
        ENDIF.                                                  
        CALL FUNCTION 'CATS_WF_APPROVAL'                        
          EXPORTING                                             
            WORKITEMID_IMP = WORKITEMID_IMP                     
          TABLES                                                
            CONT_IMP = CONTAINER.                               
      END_METHOD.                                               
    hi ,
    the above is the code in the method .
    At the first step of execution underlined above , the work item id is appearing blank .
    I think that the value is not passed to the container , but i am not sure og how to pass data to this conatiner

  • Passing Parameter between Methods

    I have some problems because i don't really know how to pass parameter between methods in a java class.
    How can i do that? below is the code that i did.
    I want to pass in the parameter from a method called dbTest where this method will run StringTokenizer to capture the input from a text file then it will run storeData method whereby later it will then store into the database.
    How can i pass data between this two methods whereby i want to read from text file then take the value to be passed into the database to be stored?
    Thanks alot
    package com;
    import java.io.*;
    import java.util.*;
    import com.db4o.ObjectContainer;
    import com.db4o.Db4o;
    import com.db4o.ObjectSet;
      class TokenTest {
           private final static String filename = "C:\\TokenTest.yap";
           public String fname;
         public static void main (String[] args) {
              new File(filename).delete();
              ObjectContainer db=Db4o.openFile(filename);
         try {
            String fname;
            String lname;
            String city;
            String state;
             dbStore();
            storeData();
         finally {
              db.close();
         public String dbTest() {
            DataInputStream dis = null;
            String dbRecord = null;
            try {
               File f = new File("c:\\abc.txt");
               FileReader fis = new FileReader(f);
               BufferedReader bis = new BufferedReader(fis);
               // read the first record of the database
             while ( (dbRecord = bis.readLine()) != null) {
                  StringTokenizer st = new StringTokenizer(dbRecord, "|");
                  String fname = st.nextToken();
                  String lname = st.nextToken();
                  String city  = st.nextToken();
                  String state = st.nextToken();
                  System.out.println("First Name:  " + fname);
                  System.out.println("Last Name:   " + lname);
                  System.out.println("City:        " + city);
                  System.out.println("State:       " + state + "\n");
            } catch (IOException e) {
               // catch io errors from FileInputStream or readLine()
               System.out.println("Uh oh, got an IOException error: " + e.getMessage());
            } finally {
               // if the file opened okay, make sure we close it
               if (dis != null) {
                  try {
                     dis.close();
                  } catch (IOException ioe) {
                     System.out.println("IOException error trying to close the file: " +
                                        ioe.getMessage());
               } // end if
            } // end finally
            return fname;
         } // end dbTest
         public void storeData ()
              new File(filename).delete();
              ObjectContainer db = Db4o.openFile(filename);
              //Add data to the database
              TokenTest tk = new TokenTest();
              String fNme = tk.dbTest();
              db.set(tk);
        //     try {
                  //open database file - database represented by ObjectContainer
        //          File filename = new File("c:\\abc.yap");
        //          ObjectContainer object = new ObjectContainer();
        //          while ((dbRecord = bis.readLine() !=null))
        //          db.set(fname);
        //          db.set(lname);
        //          db.set(city);
            //          db.set(state);
    } // end class
         Message was edited by:
    erickh

    In a nutshell, you don't "pass" parameters. You simply call methods with whatever parameters they take. So, methods can call methods, which can call other methods, using the parameters in question. Hope that makes sense.

  • Unable to detect any parameter in html (webresource) when value is passed from onload method of form

    Unable to detect any parameter in html (webresource) when value is passed from onload method of form
    I am trying out some stuff. For which I created a simple Entity. In the form of the entity I have added a simple web resource (html). And for the onload of the form I am calling the following function
    function HelpDeskActivityOnLoadhandler()
     var customParameters = encodeURIComponent("first=First Value&second=Second Value&third=Third Value");
        Xrm.Utility.openWebResource("tsi_scriptzz",customParameters);
    Here is the code for the  tsi_scriptzz.html
    <html>
     <body>
      <script type="text/javascript">
        var vals = new Array();
        if (location.search != "") {
         vals = location.search.substr(1).split("&");
         for (var i in vals) {
          vals[i] = vals[i].replace(/\+/g, " ").split("=");
      </script>
     </body>
    </html>
    MY PROBLEM IS -> location.search is always coming back with empty string. So, it not getting the parametrs I am passing from the load method of the form.
    Could someone kindly help me.
    Thanks,
    Hasib

    Hello, I tried it myself. I got a new_test.htm file and a new_test.js file. The loadWebResource function is called on the OnLoad event of an Entity.
    function loadWebResource()
    var params = encodeURIComponent('param1=value one&param2=value two&param3=value three');
    Xrm.Utility.openWebResource('new_test.htm', params);
    <html>
    <head>
    <title>Web Resource Parameter Example</title>
    <!-- Use ../ClientGlobalContext.js.aspx if your webresource is in a deeper folder on CRM -->
    <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
    <script type="text/javascript">
    document.onreadystatechange = function () {
    if (document.readyState == 'complete') {
    var params = getParams();
    for(var i=0; i<params.length; i++)
    log(params[i].name + ' ' + params[i].value);
    // this functions puts the params in a 'dictionary format'
    // f.e params[0].name = param1 & params[0].value = 'value one'
    // You could customize this function or find some on the internet to retrieve a param fe by name...
    // This is just an example how to get the name and values
    function getParams(){
    var params = [];
    var querystring = Xrm.Page.context.getQueryStringParameters().Data;
    var querystringparts = querystring.split('&');
    for(var i=0; i<querystringparts.length;i++)
    var split = querystringparts[i].split('=');
    params.push({
    name: split[0],
    value: split[1]
    </script>
    </head>
    <body>
    </body>
    </html>
    Hope it helps now. Kind Regards

  • Call Paje jsp passing parameters with method post

    How can I call a jsp page with outputlink, passing parameters with method post ?
    Ex: I need that the word "?pNumMensagem=#{currentRow["NumMensagem"]}" not was exposed when a call P0077_2.jsp.
    <h:outputLink binding="#{P0077.hyperlink1}" id="hyperlink1" target="t1" value = "#{facesContext.externalContext.requestContextPath}/faces/P0077_2.jsp?pNumMensagem=#{currentRow["NumMensagem"]}">
    <h:outputText binding="#{P0077.outputText14}" id="outputText14" value="#{currentRow['NumMensagem']}"/>
    </h:outputLink>
    Thanks.
    Heitor.

    Any body have an idea ?

  • How to construct a standard rowKeyStr based on a value passed to a method ?

    Hi to all im on a proyect and i really appreciate some people can help with this
    looking ADF joins all use rowKey values and i need to know how to generate a standard rowKeyStr based on a value passed to an event, so it let me access any page on my Jsp ADF application and pass some values to a method and get the rowKeyStr.
    i have this method actually getting the current row, how i can generate a standard rowKeyStr value.
    public String myrowKeyStr(String id) {
    if (id != null) {
    PbeVisitasViewImpl vo = (PbeVisitasViewImpl)getPbeVisitasView1();
    Key k = new Key(new Object[]{id});
    Row[] found = vo.findByKey(k,1);
    vo.setCurrentRow(vo.findByKey(k,1)[0]);
    return someRowKeyStr;
    }

    once you do the
    Key k = new Key ( new Object[] { p1 } );
    The rowkeystring comes from:
    String strRowKeyStr = k.toStringFormat();
    Just type k. and press ctrl-space to see the list of methods.

  • Passing values from method array to class array

    HELP!! Plz excuse any ignorance. Am a noob and have created an array within my class. I then try to alter those array values from inside one of the classes methods. When I try to access the new values from the class array, they don't exist. I think it's a duration/scope issue and am struggling to get around it. This is the only way I can implement the task required and would appreciate any advice you can thorw. cheers in advance.. =~D

    I suspect that you're altering an array passed as a parameter, rather than array that's a field of the instance, but as you didn't post any of your code, that can only be a guess.

  • Passing Vectors to Methods

    import java.util.*;
    public class usingVectors
    static Scanner console = new Scanner(System.in);
    public static void main(String[] args)
              int VECTOR_SIZE;
              System.out.print("Enter the size of the array: ");
              VECTOR_SIZE = console.nextInt();
              System.out.println();
    Vector<Integer> listA = new Vector<Integer>();
    System.out.print("Enter " + VECTOR_SIZE + " integers: ");
    fillArray(listA, VECTOR_SIZE);
    System.out.println();
    System.out.print("List of Integers that you inputted: \n ");
    printArray(listA, VECTOR_SIZE);
    System.out.println();
    System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));
    System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
    public static void fillArray(int list, int sizeOfVector)
    int index;
    for (index = 0; index < sizeOfVector; index++)
    list[index] = console.nextInt();
         public static void printArray(int list, int sizeOfVector)
              int index;
              for (index = 0; index < sizeOfVector; index++)
              System.out.print(list[index] + " ");
         public static int indexSmallest(int list, int sizeOfVector)
              int index;
              int smallIndex = 0;
              for (index = 0; index < sizeOfVector; index++)
              if (list[smallIndex] > list[index])
         smallIndex = index;
              return smallIndex;
    Im trying to pass a vector to a method. Im not sure what i am doing wrong if anyone could look at what im doing wrong i would appreciate it.
    ER:usingVectors.java:19: fillArray(int,int) in usingVectors cannot be applied to (java.util.Vector<java.lang.Integer>,int)
    fillArray(listA, VECTOR_SIZE);

    My first problem was to write a method, smallestIndex that takes as its parameters an int array and its size. Return the smalles element in the array and its postion. Now i have that done and it was good. He wants us to change that program to use vectors. So i feel like i have done most of it right but like you said the error. It won't pass the vector through to the method. I believe
    ok thank you. I guess what i should ask you now. In my line of code. How do i set the parameters to pass a Vector instead of the int?
    THANK YOU FOR YOU HELP
    Vector<Integer> listA = new Vector<Integer>();                     
            System.out.print("Enter " + VECTOR_SIZE + " integers: ");                       
            fillArray(listA, VECTOR_SIZE);  **This is where i call my method with the vector name listA, and the int VECTOR_SIZE, it pops the problem here or would it be in the declaring the new varibles at the start of the method**                      
            System.out.println();                                  
            System.out.print("List of Integers that you inputted: \n     ");                       
            printArray(listA, VECTOR_SIZE);                       
            System.out.println();                                        
            System.out.println("The position of the smallest integers in the array is: " + indexSmallest(listA, VECTOR_SIZE));  
            System.out.println("The smallest integer in the array is: " + listA[indexSmallest(listA, VECTOR_SIZE)]);
        public static void fillArray(int list, int sizeOfVector) *Or would it be here?*
            int index;
            for (index = 0; index < sizeOfVector; index++)
                list[index] = console.nextInt();
        }

  • Passing Objects to methods, why aren't they changed permanently?

    If an object is passed by reference, and primitive types are passed by value; then why does the following programme not alter the original values of A and B?
    I m trying to pass parameters into a method so that they can be altered and returned, can any one suggest a way to do this.
    Thanks,
    Ben.
    public class Application2 {
    Application2(){ }
         void goProc(){
              Integer A=new Integer(4);
              Integer B=new Integer(6);
              add(A,B);
              System.out.println("A2 " + A);
              System.out.println("B2 " + B);
         void add(Integer A,Integer B){
              System.out.println("A " + A);
              System.out.println("B " + B);
              A=A.valueOf(String.valueOf((A.intValue()+B.intValue())));
              System.out.println("added " + A);
    //Main method
         public static void main(String[] args) {
              Application2 App = new Application2();
              Integer A=new Integer(4);
              Integer B=new Integer(1);
              App.add(A,B);
              System.out.println("A1 " + A);
              System.out.println("B1 " + B);
              App.goProc();
    OUTPUT.
    A 4
    B 1
    added 5
    A1 4
    B1 1
    A 4
    B 6
    added 10
    A2 4
    B2 6

    If an object is passed by reference,It isn't. Instead, a pointer to the object is passed
    by value.That is exactly what passing by reference is.
    Objects passed by reference can be modified and it will affect the caller, but modifying the reference (assiging a new object) won't affect the caller.
    I m trying to pass parameters into a method so that
    they can be altered and returned, can any one
    suggest a way to do this.I think this is bad OO programing, it results in less readable code and may be hard to debug. Better is to make the method return the result and let the caller assign the new value. (This is my personal oppinion at least)

  • Passing values between methods in the same class

    Hi,
    How to pass internal tables or values between methods in the same class.
    How to check if the internal method in another method is initial or not.
    How to see if the method has already been executed.
    Thanks.

    Just declare the internal table as an attribute in the class - that way every method in this class has access to it.
    Since any method has access to all class attributes you can easily check if the internal table is initial or not.
    I am not aware of any standard functionality if a method has already been executed or not, one way would be to declare a class attribute for each method and set it once the method has been executed. That way every method in that class would know which method has already been executed or not.
    Hope that helps,
    Michael

  • Passing array as method to activex

    Dear Users;
    Sorry if this is a repeat question - I could not find relevant code in the faq.
    I have an activeX control which contains a method (PassArray) which accepts an array, and modifies its contents... The array *seems* to be correctly passed in, and I can make the modifications to the data. The data is then passed back out... In labview I use the Variant -> Data object to return the underlying dataset. However all my modifications are lost. (Sample code below).
    Ie: it seems Labview is passing me a copy of the original data, and does not accept that changes have occured. When I create a method which returns a variant containing a new array (ReturnArray), everything works properly. Does this occur because methods use 'const' keywords for parameters? Is there a solution where labview accepts that the data has changed?
    Any hints would be useful...
    thanks,
    Marc
    VARIANT CAcxLVArrayCtrl::ReturnArray(short Lendth)
    VARIANT vaResult;
    VariantInit(&vaResult);
    // TODO: Add your dispatch handler code here
    // Ok use this code to generate an array based upon size of Lendth.
    double* lpusBuffer;
    //Assigns the Variant to hold an array of doubles (real 8-byte numbers)
    vaResult.vt = VT_ARRAY | VT_R8;
    SAFEARRAYBOUND rgsabound[1];
    //Set bounds of array
    rgsabound[0].lLbound = 0; //Lower bound
    rgsabound[0].cElements = Lendth; //Number of elements
    //Create the safe array of doubles, with the specified bounds, and only 1 dimension
    vaResult.parray = SafeArrayCreate( VT_R8, 1, rgsabound );
    SafeArrayAllocData( vaResult.parray );
    SafeArrayAccessData( vaResult.parray, (void**)&lpusBuffer );
    //Fill in the buffer
    for( int i=0; i
    *(lpusBuffer + i ) = i + 1;
    SafeArrayUnaccessData( vaResult.parray );
    return vaResult;
    short CAcxLVArrayCtrl:assArray(const VARIANT FAR& ArrayInOut)
    // TODO: Add your dispatch handler code here
    long LowerBound, UpperBound, cbElements;
    if(ArrayInOut.vt != (VT_ARRAY | VT_I4))
    MessageBox("Data is not an array of Longs");
    return -1;
    if(SafeArrayGetDim(ArrayInOut.parray) != 1)
    MessageBox("Data must be a 1D array");
    return -1;
    SafeArrayGetLBound(ArrayInOut.parray, 1, &LowerBound);
    SafeArrayGetUBound(ArrayInOut.parray, 1, &UpperBound);
    if( (UpperBound - LowerBound) = 0)
    MessageBox("Data array is not initialised");
    return -1;
    long* lpusBuffer;
    SafeArrayAccessData( ArrayInOut.parray, (void**)&lpusBuffer );
    //Fill in the buffer
    for( int i=LowerBound; i
    *(lpusBuffer + i ) = i + 1;
    SafeArrayUnaccessData( ArrayInOut.parray );
    return 0;

    Fortunately I was able to determine what I was doing wrong. LabView and Visual Basic for Applications (VBA) only support the VARIANT data type for arrays. Visual Basic, however, supports more descriptive array parameter specifications in IDL. In other words, there are numerous valid ways to declare array parameters in IDL, however, some tools only support a subset. LV only supports VARIANTs. So in the previous IDL example:
    [id(3), helpstring("method NSEnumDevice")] HRESULT NSEnumDevice([in] int devIndex, [in] SAFEARRAY(int) *ports);
    becomes -
    [id(3), helpstring("method NSEnumDevice")] HRESULT NSEnumDevice([in] int devIndex, [in] VARIANT ports, [out, retval] VARIANT *devObj);
    Where devObj is an ActiveX wrapped object. VARIANT "ports" is an array of integer values. To specify returning an array of values, you still just use "[out, retval] VARIANT *array".
    --ddixon

  • Passing array via methods

    I am trying to enter x amount of marks by passing a method but placing in an array. When i compile i get no faults but method isn't passing. if i set a number it works but only to to that set number.
    Any help would be appreciated.
    import javax.swing.*;
    public class HomeWork8Week10
         public static void main(String args [])
              int mark = 0;
              getInt(mark);
              int size=0;
              getMarks(size);
         private static int getInt(int mark)
              String number = JOptionPane.showInputDialog(null,"Enter number of marks",
                                  "Homework 8",JOptionPane.QUESTION_MESSAGE);
              return Integer.parseInt(number);
         public static int[] getMarks(int size)
              int[] marks = new int[size];
              for(int i =0; i<marks.length; i++)
                   String numberOfMarks = JOptionPane.showInputDialog(null,"Enter mark",
                                  "Homework 8",JOptionPane.QUESTION_MESSAGE);
                   marks[i] = Integer.parseInt(numberOfMarks);
              return marks;
    }

    Right, and anticipating a possible questions, you'd code it like this:
    int[] results = getMarks(marks);
    Also, there seems not need to send the method getInt anything at all.

  • Help with passing values to methods

      GregorianCalendar baseTime = new GregorianCalendar();
      long baseSystemTime = System.currentTimeMillis();
      // After some iterations I want to update the
      // calendar to reflect the current time.
      // I do not want to go through instantiating a new calendar
      baseTime = updateTimestamp(baseTime,baseSystemTime);
      private static GregorianCalendar updateTimestamp(GregorianCalendar GC, long lastTime){
        // This gets the difference between the last time check and now.
        // It then adds that difference to the calendar and returns the updated
        // calendar.
        int msDifference =
          new Long(System.currentTimeMillis() - lastTime).intValue();
        GC.add(GregorianCalendar.MILLISECOND,msDifference);
        lastTime = new Long(System.currentTimeMillis()).longValue();
        return GC;
      }The problem is that the lastTime variable that it passed gets updated to the current MS value. But, the original baseSystemTime never changes.
    I thought that if you pass something to a method and it gets altered in the method the original object is updated. Am I wrong?

    So objects are passed by reference but primitives are
    passed by value?Simply speaking: Yes.
    Strictly speaking: No. Every parameter is passed by value because Object obj IS a reference. So when you do call(myObject), you are passing the value of the reference of the object (the adress of the object).

  • Default method - how to pass value to method container?

    Hello,
    I am dealing with a hyperlink in 'Objects and Attachements' section of the workitem.When i click on the link, the default method of the business object gets called automatically.
    My question is: How to pass values to the default method (i.e. method container) as i don't invoke the method in my workflow explicitly?  The method gets called when we click on the hyperlink.
    Regards,
    Monica.

    Hello Monica,
    a default method doesn't require parameters (and cannot make use of them), as they are designed to be called from various situation, such as the view from a workflow container, the display button within a workitem or the attachment list. So this is part of the system design.
    To make an object dependent of workitem values I usually follow two different design patterns:
    <b>1) Using a flowitem/workitem instance with a special default method</b>
    - Create a subobject from type WORKITEM (if I'm going to use values from the current workflow instance) or subobject from type WORKINGWI (if I'm going to use values from the current dialog workitem).
    - Do not make a general substitution for this new object type
    - If using a ZWORKITEM, create an instance of this object type before the dialog step and then pass this object to the dialog workitem
    - If using ZWORKINGWI, assign the object instance during the data flow to the step.
    - In the properties of the object choose (any one) default method
    - Within the coding you have the reference to the workitem/flowitem as object-key-... and you can further use functions/methods to read the workitem/flowitem container and do whatever has to be done
    <b>2) Retrieving values from the current workitem on-the-fly</b>
    Within the coding of the default method call the function module SWO_QUERY_REQUESTER that returns the instance/id of the current workitem-in-work (with is also set when using the hyperlink from a workitem). If the list is empty, there's no active workitem, otherwise use functions/methods to read the workitem container.
    --> edit: Solution is not release safe, is it aint working with SAP R/3 Enterprise and higher
    Best regards,
       Florin
    Message was edited by:
            Florin Wach

  • Passing value from method to Workflow

    Hi All,
    I am new to workflow. I am trying simple examples to understand the concepts of work flow.
    I have copied a std business object and I have a method in that. Now, I am trying to pass some value to this method from the work flow and get back some value after manipulation with in this method.
    In the program for the method,  I need to get 2 parameters as input and one parameter as outut. With in this method I am trying to write the code for adding this 2 nos. I have seen some Help docs and came to know I should use SWC_GET_ELEMENT_CONTAINER and SWC_SET_ELEMENT_CONTAINER for this. But, I am ot sure of the syntax.
    Can you help me with a sample program for this...
    Any help is highly appreciated.
    Thanks,
    Jai Shankar

    hi Jai Shankar,
    I give you the sample code of the method where i am finding number of agents
    BEGIN_METHOD ZLCPRNUMBEROFUSERS CHANGING CONTAINER.
    DATA:
          TEMAILID LIKE SOLI OCCURS 0,
          TAPPROVERS LIKE ZSAFAPPROVERS OCCURS 0,
          WAPPROVERS LIKE TABLE OF ZSAFAPPROVERS WITH HEADER LINE.
          DATA NUMBER LIKE VBAK-VBTYP.
          DATA emailid TYPE STRING.
          data userid type string.
    this is the coding where the value that you give the method container
      SWC_GET_TABLE CONTAINER 'TEmailId' TEMAILID.
      SWC_GET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
      SWC_GET_ELEMENT CONTAINER 'NUMBER' NUMBER.
    here you can use your own coding like (select query or any other)
      CALL FUNCTION 'Z_LC_PR_NUMBER_OF_USERS'
        TABLES
          T_EMAIL_ID = TEMAILID
          T_APPROVERS = TAPPROVERS
        EXCEPTIONS
          OTHERS = 01.
      CASE SY-SUBRC.
        WHEN 0.            " OK
        WHEN OTHERS.       " to be implemented
      ENDCASE.
      SWC_SET_TABLE CONTAINER 'TEmailId' TEMAILID.
      SWC_SET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
    READ TABLE TAPPROVERS INDEX NUMBER INTO WAPPROVERS.
    CALL FUNCTION 'Z_LC_GET_EMPLOYEE_INFO'
    EXPORTING
        USER_ID                   = WAPPROVERS-APPROVER_USRID
    IMPORTING
         EMP_EMAIL                 = emailid.
    here i am doing some manupulation in the function module and i am getting that value to the method container as below.
      SWC_SET_ELEMENT CONTAINER 'EMAILID' emailid.
      SWC_SET_ELEMENT CONTAINER 'USERID' WAPPROVERS-APPROVER_USRID.
    SWC_SET_TABLE CONTAINER 'EMAILID' emailid.
    SWC_SET_TABLE CONTAINER 'TApprovers' TAPPROVERS.
    END_METHOD.
    I think it is helpful for you,
    Regards,
    Balaji E.

Maybe you are looking for