Rfc function with table parameter

Hey,
im trying to call a RFC function from Webdynpro where i have to give a table as parameter.  When creating the table i following exception:
java.lang.IllegalArgumentException: model object must not be null
     at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
     at be.vrt.wdp.IPublicPlanning_Validation$IP_Update_TableElement.<init>(IPublicPlanning_Validation.java:3667)
     at be.vrt.wdp.IPublicPlanning_Validation$IContextNode.doCreateElement(IPublicPlanning_Validation.java:87)
     at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:854)
     at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1346)
     at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1365)
     at be.vrt.Planning_Validation.executeRFC_Z_Whatson_Sap_Update_Transmissio_Input(Planning_Validation.java:265)
The code from Planning_Validation (controller class)
  public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
    //@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
     Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();
     //transmiss.addP_Update_Table(new Zmm_S_Update_Status_Table());
     wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
     //wdContext.createP_Update_TableElement(new Zmm_S_Update_Status_Table());
     for (int i = 0; i < nodes.size(); i++){
          String [] node = (String[])nodes.get(i);
          IWDNodeElement el = wdContext.nodeP_Update_Table().createElement();
          el.setAttributeValue("Won_Id", node[0]);
          el.setAttributeValue("Won_Status", node[1]);
          el.setAttributeValue("Display_Status", display_value);
     try {
          // Call remote function          
          wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
          // synchronise data in context with data in model
          wdContext.nodeOutput().invalidate();
     } catch (WDDynamicRFCExecuteException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
Line 265 is where i call wdContext.nodeP_Update_Table().createElement();
Any ideas ?
grtz,
Hannes

Hey, thanks .. i managed to solve it
this is the code: 
//@@begin javadoc:executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
  /** Declared method. */
  //@@end
  public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
    //@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
     Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();     
     wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
     for (int i = 0; i < nodes.size() ; i++){
          String [] node = (String[])nodes.get(i);          
          Zmm_S_Update_Status_Table updEl = new Zmm_S_Update_Status_Table();
          updEl.setWon_Id(node[0]);
          updEl.setWon_Status(node[1]);
          updEl.setDisplay_Status(display_value);
          transmiss.addP_Update_Table(updEl);                    
     wdComponentAPI.getMessageManager().reportSuccess("wohoo!");
     try {
          // Call remote function          
          wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
          // synchronise data in context with data in model
          wdContext.nodeOutput().invalidate();
     } catch (WDDynamicRFCExecuteException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
    //@@end

Similar Messages

  • Rfc functions with export field type exid h

    Hi, in WAS700 I encountered rfc functions with export fields of the type exid h
    I found in the rfccal.c the following section:
            if (*exid == 'h')  continue;
                   I don't know how handle type 'h' (internal table)
                   with RFC API. Therefore ignore it.
    Example function : SWNC_GET_WORKLOAD_STATISTIC
    In the rfcsdk docs I can't find a thing how you should handle such an export field.
    Any solution for this ?

    hi hans,
    sorry i shouldn't have answered your question. to me RFC is tooo strange. I had a quick look at the FM, searched DDIC for something like exid and had a look at the WSDL of the webservice WSDL of that FM. nothing seemed very complicated to me in terms of a webservice call to it (apart from the semantically...uhm...questionable interface; MEM_OBJS_FR_YOUN anybody?) but I really have no idea of the inner workings of RFC.
    sorry again. hope you get it solved here.
    anton

  • How to use INVOKE function with INT parameter types

    Can you tell me how to use invoke function with int parameter type ?

    Pass the int as an Integer.

  • Syntax Error with Table Parameter (type: ANY) when Creating Function Module

    Hello experts,
    I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
    Could anyone tell me what the wrong is? And how can I fix it?
    Thanks,
    Shelwin

    Hi,
    For table parameters, you can only pass
    MSG_TABLE_ITM   TYPE STANDARD TABLE
    or
    MSG_TABLE_ITM  ( don't fill other columns TYPING ASSOCIATED TYPE  ).
    For reference check FM 'GUI_UPLOAD' - Table parameters
    Regards,
    DPM

  • XML Problem: RFC Function with XSTRING or raw table (4.6C)

    hello,
    I have a serialized XML-Document, i.e. a xstring or a raw table. Now I want to write a RFC Function Module that sends/receives this data. I'm running on 4.6C. Is this possible under 4.6C?
    I've managed to write a Function module with appropriate parameters (XML in a raw table) that works fine, but I can't declare it as a <b>remote</b> function module. Is there a standard method of importing binary XML Data via RFC in 4.6C?
    Regards,
      Alexander Schulz

    Can you please share the answer?

  • Dynamic Function Module call with table parameter?

    Hi All,
    I'm trying to call FMs dynamically with PARAMETER-TABLE. These FMs are mainly about searching data from inputs and returning internal table as outputs. I managed to pass data into import parameters as query conditions, but still failed to set tables parameter. The code is like below, could you please help me check what's the problem? Thank you very much!!
    data: lv_val type RS38L_TYP value 'ls_service_para-fmparam'.
    data: lt_interface TYPE rsfbintfv,
               ls_import_para TYPE rsfbpara,
               ptab TYPE abap_func_parmbind_tab,
               ptab_line TYPE abap_func_parmbind,
               ref_wa type ref to data.
    Field-symbols: <fs> type any,
    CALL METHOD cl_fb_function_utility=>meth_get_interface
           EXPORTING
             im_name             = LV_FM          "FM name
           IMPORTING
             ex_interface        = lt_interface
           EXCEPTIONS
             error_occured       = 1
             object_not_existing = 2
             OTHERS              = 3.
    ***loop IMPORT parameters and fill in data from lt_params***
    loop at  lt_interface-import into ls_import_para.
         read table lt_params into ls_param with key key = ls_import_para-parameter.  "check if exists query value
        if sy-subrc = 0 and ls_param-value is not initial.
              assign (lv_val) to <fs>.
               <fs> = ls_param-value.
              create data ref_wa type (ls_import_para-STRUCTURE).
              assign ref_wa->* to <fs2>.
               <fs2> = <fs>.  UNASSIGN: <fs>,<fs2>.
               ptab_line-name = ls_import_para-PARAMETER.
               ptab_line-value = ref_wa.
               ptab_line-kind = abap_func_exporting.
              insert ptab_line into table ptab.
         endif.
    endloop.
    ***loop at TABLE parameters to retrieve data from FM***
    loop at lt_interface-TABLES into ls_import_para.
         create data ref_wa type (ls_import_para-STRUCTURE).
          ptab_line-tables_wa = ref_wa.     "set data type
          ptab_line-name = ls_import_para-PARAMETER.
          ptab_line-kind = abap_func_tables.
         insert ptab_line into table ptab. "if commented, no exception occurs,but I cannot get any dataset.
    endloop.
    CALL FUNCTION LV_FM PARAMETER-TABLE ptab.
    if I execute the code, when there has TABLES parameter defined in the FM, I get CX_SY_DYN_CALL_PARAM_MISSING exception with runtime error DATREF_NOT_ASSIGNED. But in debug mode, as shown in the screen shot attached, I did see the field TABLES_WA has correct type. So maybe I misunderstand the usage of PARAMETER-TABLE. Does anyone has experience on it?
    Best Regards,
    Jeff

    Hi Rama,
    Yes, I'm not passing value to the table parameter, but that parameter is where I want to retrieve data from FM, not pass value to, so I don't assign any value to ptab_line-value for that parameter.
    BTW, I just did some test to pass value to the parameter using the following code and still got CALL_FUNCTION_PARM_MISSING exception:
    FM: ZLEAD_CONTACT
    parameters:
    IMPORT:  I_PARTNER TYPE BUT000-PARTNER mandatory
    TABLES: OT_CONT LIKE ZLEAD_INFO_S optional (here ZLEAD_INFO_S is a flat structure)
    ptab_line-name = ls_import_para-PARAMETER.
    ptab_line-kind = abap_func_tables.
    create data ref_type type table of (ls_import_para-STRUCTURE).
    ptab_line-tables_wa = ref_wa.
    ptab_line-value = ref_type.
    The detail of ptab:
    VALUE
    TABLES_WA
    KIND
    NAME
    ->2000000025
    {A:initial}
    10
    2000000025
    ->Standard Table[0x10(588)]
    ->Structure: flat & not charlike
    30
    OT_CONT
    And the same error if I set parameter using below code:
    create data ref_wa type RS38L_TYP.
    assign ref_wa->* to <fs>.
    <fs> = ls_import_para-STRUCTURE.
    ptab_line-tables_wa = ref_wa.
    The detail of ptab:
    VALUE
    TABLES_WA
    KIND
    NAME
    ->2000000025
    {A:initial}
    10
    2000000025
    ->Standard Table[0x10(588)]
    ->ZLEAD_INFO_S
    30
    OT_CONT
    Regards,
    Jeff

  • How to create Function Module with TABLE parameter (for internal table)

    Hi Guys,
    I am trying to create a function module by using TABLE parameter. I have to pass an internal table to this function module for processing.
    But it saying : TABLES parameters are obsolete!
    And I am not going further.
    Please suggest any work arround.
    Thanks

    Hi,
    create a table type in SE11..
    Then use that in your function module importing/exporting/changing parameter for passing internal tables..
    Thanks,
    Naren

  • PB in RFC function declaring table as CHANGING

    Hi all,
    I wrote an RFC function to get data between 2 SAP systems. I've to transmit to this function select-options felds. Therefor I've created a changing parameter in the function  I_LFDAT type RSPARAMS_TT which is a table type with structure RSPARAMS.
    I did it by this way as 'Tables are obsolete' in RFC functions.
    My problem is that by calling the function I've a dump saying ' (ungültiger Datentyp 17)'. This means the parameter is not correct.
    I checked anything and the table I'm sending has the same structure as the receiving parameter
    thanks in advance for your help

    Hello Fred
    I am not really a fan of CHANGING parameters in fm's.
    Since you have the table type RSPARAMS_TT I would recommend to use the following approach:
    DATA:
      lt_seloptions   TYPE rsparams_tt.  " itab with select-options
    " fm signature with 2 parameters:
      IMPORTING
        it_selopts = lt_seloptions
      EXPORTING
       et_selopts = lt_seloptions
    The RFC-fm gets IT_SELOPTS as input, can change them, and returns them as EXPORTING parameter ET_SELOPTS.
    Regards
      Uwe

  • Bind Operator to Function with optional parameter

    Hi,
    as mentioned in the subject, I would like to create an operator which is bind to an function with an optional parameter:
    CREATE OR REPLACE FUNCTION
              TS_Base_Func(iobject IN CIBase, format IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2 IS
    BEGIN
         RETURN interval_object.IntervalToString(format);
    END TS_Base_Func;
    I can bind the operator with a VARCHAR2 as second parameter, but how can I bind an operator without the second parameter to this function?
    Thanks!

    What about using a "wrapper" function to implement what you would like to do? Here is a small sample:
    SQL> CREATE OR REPLACE FUNCTION TEST
      2  (
      3          A       IN VARCHAR2
      4  ,       B       IN VARCHAR2     DEFAULT NULL
      5  )
      6  RETURN NUMBER
      7  AS
      8  BEGIN
      9          IF A = B THEN
    10                  RETURN 1;
    11          ELSE
    12                  RETURN 0;
    13          END IF;
    14  END;
    15  /
    Function created.
    SQL> CREATE OR REPLACE FUNCTION TEST_WRAPPER
      2  (
      3          A       IN VARCHAR2
      4  )
      5  RETURN NUMBER
      6  AS
      7  BEGIN
      8          RETURN TEST(A);
      9  END;
    10  /
    Function created.
    SQL> CREATE OR REPLACE OPERATOR TestOperator
      2  BINDING (VARCHAR2)              RETURN NUMBER USING TEST_WRAPPER
      3  ,       (VARCHAR2, VARCHAR2)    RETURN NUMBER USING TEST;
    Operator created.
    SQL> SELECT  TestOperator(1) FROM DUAL;
    TESTOPERATOR(1)
                  0
    SQL> SELECT  TestOperator(1,2) FROM DUAL;
    TESTOPERATOR(1,2)
                    0
    SQL> SELECT  TestOperator(1,1) FROM DUAL;
    TESTOPERATOR(1,1)
                    1
    SQL>The TEST_WRAPPER function has the signature you need for a one variable parameter. However, under the hood it calls the TEST function.

  • Activating explanation function with application parameter

    Hello,
    I found in documentation that it's possible to activate explanation function (mouse over) with url parameter sap-explanation=X. Is it also possible to activate explanations with application parameter, application configuration or GLOBAL_SETTINGS?
    Thanks and regards
    Marc

    I remember that JSF provides no support for accessing the indexed values as I right understand you.

  • Ago function with offset parameter dynamic

    Hi,
    I need to calculate a measure in rpd or answer that simulate the behavior of ago function with the offset parameter dynamic.
    i.e.
    ago(total_quantity, month, offset), where offset is a number provided by a logical column.
    Is it possible?
    Thanks.

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • How to define a function with table type parameter

    Hello All,
    Here is the requirement ..
    cursor c is select first_name, last_name , ssn from employee ;
    TYPE employee_type IS TABLE OF c%rowtype;
    tbl_employee_type employee_type;
    I want to pass the parameter to a function the ssn -: tbl_employee_type(1).ssn
    how the formal parameter should be declared
    ===========================
    function chk_notnull_blank ( ? ) return boolean is
    BEGIN
    if ( colname is NOT NULL and colname in ( -8E14, -7E14, -6E14, -5E14, -4E14, -3E14, -2E14, -1E14, -1E9 )) then
    RETURN TRUE ;
    else
    RETURN FALSE ;
    end if;
    END chk_notnull_blank;
    ======================
    pls advice
    thanks/kumar

    You cannot define a generic argument in a function,
    but you can overload several funtions with the same name and different types of arguments in a package,
    in this way (not tested):
    create table employees as
    select employee_id ssn, first_name, last_name from hr.employees;
    create or replace
    PACKAGE chk
    IS
      cursor c is select first_name, last_name , ssn from employees ;
      TYPE employee_type IS TABLE OF c%rowtype;
      TYPE employee_ssn_type IS TABLE OF employees.ssn%TYPE;
      TYPE employee_num_type IS TABLE OF number;
      FUNCTION chk_notnull_blank ( colname  employees.ssn%TYPE) RETURN boolean;
      FUNCTION chk_notnull_blank ( colnames  employee_type) RETURN boolean;
      FUNCTION chk_notnull_blank ( colnames  employee_ssn_type) RETURN boolean;
      FUNCTION chk_notnull_blank ( colnames  employee_num_type) RETURN boolean;
    END chk;
    create or replace
    PACKAGE BODY chk
    IS
      FUNCTION chk_notnull_blank ( colname  employees.ssn%TYPE) RETURN boolean IS
      BEGIN
        if ( colname is NOT NULL and colname in ( -8E14, -7E14, -6E14, -5E14, -4E14, -3E14, -2E14, -1E14, -1E9 )) then
          RETURN TRUE ;
        else
          RETURN FALSE ;
        END IF;
      END chk_notnull_blank;
      FUNCTION chk_notnull_blank ( colnames  employee_type) RETURN boolean IS
      BEGIN
         FOR i IN colnames.FIRST .. colnames.LAST LOOP
            IF NOT chk_notnull_blank( colnames( i ).ssn )
            THEN
               RETURN FALSE;
            END IF;
         END LOOP;
         RETURN true;
      END chk_notnull_blank;
      FUNCTION chk_notnull_blank ( colnames  employee_ssn_type) RETURN boolean
      IS
      BEGIN
         FOR i IN colnames.FIRST .. colnames.LAST LOOP
            IF NOT chk_notnull_blank( colnames( i ) )
            THEN
               RETURN FALSE;
            END IF;
         END LOOP;
         RETURN TRUE;
      END chk_notnull_blank; 
      FUNCTION chk_notnull_blank ( colnames  employee_num_type) RETURN boolean
      IS
      BEGIN
         FOR i IN colnames.FIRST .. colnames.LAST LOOP
            IF NOT chk_notnull_blank( colnames( i ) )
            THEN
               RETURN FALSE;
            END IF;
         END LOOP;
         RETURN TRUE;
      END chk_notnull_blank; 
    END chk;I assumed in this example that if the argument of the function chk_notnull_blank is of the table (collection) type,
    then the function returns true if all table elements pass the check, otherwise it returns false.

  • How to write a function with table name as parameter

    I created a function like this:
    create or replace function "GETNAME"
    (did in NUMBER, dtable in VARCHAR2)
    return VARCHAR2
    is
    dname varchar2(200);
    begin
    select lastname || ' ' || firstname
    into dname from dtable
    where id = did;
    return dname;
    end;
    i got an error: table or view does not exist.
    Could somebody tell me how to fix it?
    Thanks,
    Jen

    or by using a reference cursor:  create or replace function dynamic_cursor (pTab varchar2)
        return sys_refcursor as
        c sys_refcursor;
      begin
        open c for 'select * from '|| pTab;
        return c;
      end;
    SQL> exec :c := dnamic_cursor('emp');
    SQL> exec :c := dynamic_cursor('emp');
    PL/SQL procedure successfully completed.
    SQL> print c;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7945 CINDY      SALESMAN        7698 16-JAN-83       1800                    30
          7950 TINA       SALESMAN        7698 18-JAN-83       1850                    30
    16 rows selected.
    SQL>

  • How to execute a function with date parameter as an input?

    HI
    I have a function named fun1(v_fun in date), with date as an input parameter and it returns a number. I have created the function successfully. But i couldnt execute this function in sqlplus. How to pass the dates? Can any one help me in this regard.

    Hi,
    V11081985 wrote:
    HI
    I have a function named fun1(v_fun in date), with date as an input parameter and it returns a number. I have created the function successfully. But i couldnt execute this function in sqlplus. It's hard for me to say what you're doing wrong when I don't know what you're doing. Post a complete test script that people can run to re-create the problem and test their ideas. Include a function definition, CREATE TABLE and INSERT statements for any of your own tables (if necessary), and the results you want to get from that data, as well as your query.
    How to pass the dates? Can any one help me in this regard.You can call the function like this:
    SELECT  fun1 (hiredate)  AS fun1_results
    FROM    scott.emp
    ;

  • How to call a Stored Function with OUT parameter of %rowType from Java

    Hi everyone,
    I'm getting crazy trying to make this work.
    I have a function (not developed by me) in Oracle 10g declared in this way:
    type tab_RLSSP is table of TB_RLSSP_STOSTPRPAR_CL%ROWTYPE index by binary_integer;
    FUNCTION DBF_PERL_LISTA_PRATICHE (
    p_id_va IN NUMBER,
    p_seq_partita IN NUMBER,
    p_trattamento IN CHAR,
    lrec_RLSSP OUT tab_RLSSP ) RETURN NUMBER;
    And here is the code snipplet of my java method:
    sql="{? = call "+SCHEMA+PACKAGE+"."+FUNCTION_LIST+"(?,?,?,?)}";
    cs=connection.prepareCall(sql);
    cs.registerOutParameter(1, OracleTypes.NUMBER);
    cs.setLong(2,idVATitolare);
    cs.setLong(3,seqPartita);
    cs.setString(4,trattamento);// Caso Decesso
    cs.registerOutParameter(5, OracleTypes.OTHER);
    cs.executeQuery();
    result = (ResultSet) cs.getObject(5);
    if (result.next())
    listaPratiche.add(readPraticaPartita(result));
    The result (exception thrown at executeQuery with statement generated as
    SQL : {? = call PEDBA.DBK_PERL_RATEI_SUPPLETIVI.DBF_PERL_LISTA_PRATICHE(?,?,?,?)}:
    java.sql.SQLException: ORA-06550: line 1, column 13:
    PLS-00306: wrong number or types of arguments in call to 'DBF_PERL_LISTA_PRATICHE'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Changing to :
    sql="{call ? := "+SCHEMA+PACKAGE+"."+FUNCTION_LISTA+"(?,?,?,?)}";
    leading to
    SQL : {call ? := call PEDBA.DBK_PERL_RATEI_SUPPLETIVI.DBF_PERL_LISTA_PRATICHE(?,?,?,?)}
    don't change anything.
    What's wrong? Any suggestion?
    Edited by: 957158 on 5-set-2012 9.06

    >
    Taking for granted that it works, I wonder what's different, probably the output is defined as Cursor...
    >
    You mean because of this line?
    cs.registerOutParameter(5,OracleTypes.CURSOR);You can either use a cursor or use a function that returns a SQL type instead of the PL/SQL type.
    Here is sample code using a cursor
    CREATE OR REPLACE TYPE SCOTT.local_type IS OBJECT (
        empno   NUMBER(4),
        ename   VARCHAR2(10));
    CREATE OR REPLACE TYPE SCOTT.local_tab_type IS TABLE OF local_type;
    CREATE OR REPLACE PACKAGE SCOTT.test_refcursor_pkg
    AS
        TYPE my_ref_cursor IS REF CURSOR;
         -- add more cursors as OUT parameters
         PROCEDURE   test_proc(p_ref_cur_out OUT test_refcursor_pkg.my_ref_cursor);
    END test_refcursor_pkg;
    CREATE OR REPLACE PACKAGE BODY SCOTT.test_refcursor_pkg
    AS
         PROCEDURE  test_proc(p_ref_cur_out OUT test_refcursor_pkg.my_ref_cursor)
         AS
            l_recs local_tab_type;
         BEGIN
             -- Get the records to modify individually.
             SELECT local_type(empno, ename) BULK COLLECT INTO l_recs
             FROM EMP;
             -- Perform some complex calculation for each row.
             FOR i IN l_recs.FIRST .. l_recs.LAST
             LOOP
                 DBMS_OUTPUT.PUT_LINE(l_recs(i).ename);
             END LOOP;
             -- Put the modified records back into the ref cursor for output.  
             OPEN p_ref_cur_out FOR
             SELECT * from TABLE(l_recs);      
             -- open more ref cursors here before returning
         END test_proc;
    END;
    SET SERVEROUTPUT ON SIZE 1000000
    DECLARE
      l_cursor  test_refcursor_pkg.my_ref_cursor;
      l_ename   emp.ename%TYPE;
      l_empno   emp.empno%TYPE;
    BEGIN
      test_refcursor_pkg.test_proc (l_cursor);
      LOOP
        FETCH l_cursor
        INTO  l_empno, l_ename;
        EXIT WHEN l_cursor%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(l_ename || ' | ' || l_empno);
      END LOOP;
      CLOSE l_cursor;
    END;
    /

Maybe you are looking for