Help in using record type and object type

Hi Experts,
I am new to object types and record types.
I want to return the output of this query using one OUT parameter
from the procedure using RECORD type or OBJECT type.
with out using refcursor.
SELECT empno,ename,sal FROM emp WHERE deptno=30;
Let us assume the query is returning 50 records.
I want to send those 50 records to OUT parameter using record type or object type.
Please provide the for the requirement code using RECORD TYPE and OBJECT TYPE separately.
Your earliest response is appreciated.
Thanks in advance.

Hi All,
I have tried this.But it ising not work
CREATE OR REPLACE PACKAGE maultiplevalues_pkg
IS
TYPE t_record IS RECORD
(empno emp.empno%TYPE,
ename emp.ename%TYPE,
sal emp.sal%TYPE);
V_RECORD t_record;
TYPE t_type IS TABLE OF V_RECORD%TYPE;
PROCEDURE maultiplevalues_pROC(p_deptno IN emp.deptno%TYPE,
dept_result OUT t_type);
END;
CREATE OR REPLACE PACKAGE body maultiplevalues_pkg
IS
PROCEDURE maultiplevalues_pROC(p_deptno IN emp.deptno%TYPE,
dept_result OUT t_type)
is
begin
dept_result :=t_type();
for I in(
select EMPNO,ENAME,SAL from EMP WHERE deptno=p_deptno
LOOP
dept_result.extend;
dept_result(i).empno :=i.empno;
dept_result(i).ename :=i.ename;
dept_result(i).sal :=i.sal;
END LOOP;
END;
END;
Please help me OUT return multiple values through single OUT variable in a procedure.
Thanks.

Similar Messages

  • Dense Rank and Object types (oracle 9i and 10g difference).

    Hi all,
    One of my queries in my procedure uses scalar subqueries and object types.
    The code works fine in 10g but not in 9i. Both Object types and Dense_rank used below are present in both 9i and 10g.
    The following is a part of a bigger query.. but this is what it comes down to when I zero in on the error.
    -- In both 9i and 10g...
    CREATE OR REPLACE TYPE t_audit_type as object(
       add_tms date,
       add_user_id varchar2(20),
       order member function match (t t_audit_type) return integer
    Type created.
    CREATE OR REPLACE TYPE BODY t_audit_type as
    order member function match   (t t_audit_type) return integer is
    begin
      if add_tms < t.add_tms then
         return -1;
      elsif add_tms > t.add_tms then
        return 1;
      else
        return 0;
      end if;
    end;
    end;
    Type body created.
    create table t ( x int, y date);
    insert into t values(1, sysdate);
    insert into t values(1, sysdate+1);
    commit;In Oracle 10g..
    select min(t_audit_type(x,y))
    keep (dense_rank first order by x) result
    from t;
    RESULT(ADD_TMS, ADD_USER_ID)
    T_AUDIT_TYPE('19-JAN-10', 'User2')In Oracle 9i....
    9i> select min(t_audit_type(x,y))
      2   keep (dense_rank first order by x) result
      3   from t;
    select min(t_audit_type(x,y))
    ERROR at line 1:
    ORA-03113: end-of-file on communication channelHave any of you seen this before..? The connection is always being terminated when I run this command.?!

    Thanks Dom for your reply.
    Here is the message I found in the trace file for the error.
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [0000000100D72F84] [SIGSEGV] [Address not mapped to object] [0x000000018] [] []
    Current SQL statement for this session:
    select min(t_audit_type(x,y))
           keep(dense_rank first order by x)x
    from tI will look in metalink and see if this has been addressed before.
    Thanks...!

  • What is the message type and basic type used for catsdb in idoc help me

    what is the message type and basic type used for catsdb in idoc help me
    ANY IDOC FOR CATSDB PLEASE TELL,
    Regards,
    Jagrut BharatKumar Shukla
    points will be awarded

    Hi,
    Check these message types.
    ATT_ABS_WITH_COST and WORKSCHED_WITH_COST.

  • How to trigger a form based on object type and process type

    Hi all,
    I am new into SRM.. I have been asked to develop a form by cloning an existing standard form..
    Using bbp_output_change_sf badi you can trigger the form by passing the object type but the scenario is such that depending on the object type and process type the new form should be triggered.
    The parameter iv_object_type passes the object type but how could i pass the process type ?
    In the badi I noticed an import parameter is_event that has a field called transction_type that carries the process type but this field never got populated when i checked using debugger.
    Please help as to how i can trigger the form based on the object_type and the process_type.
    Thanx in advance.

    Thanx again Jay Yang.. Well is there any possibility that you could get the items that were confirmed..
    Let me eleborate..
    Suppose in the PO u order an item for 10 nos and 5 gets confirmed and u return 2..
    Well in my case it is that i need to fill up a field Qty returned / Qty confirmed..
    I was able to get the number of items from the PO by passing the the passing the parameter to the FM "bbp_pd_conf_getdetaill"
    but i dont know how to get the number of items been confirmed..
    The quantity field in the line item structure gives me the number of items returned..
    Can u tell me how to get the number of items been confirmed....

  • Calling Oracle Stored proc with record type and table Type

    I have a oracle SP which takes record type and table Type which are used for order management.
    Is there anay way to populate parameters with these datatypes and call the stored procedure using ODP.NET?
    Please help.
    Thanks in advance

    Hi,
    ODP supports associative arrays and REF Cursors. There is no support for PLSQL table of records.
    Jenny

  • XML attributes and object types

    I want to create an XML Document of the following form
    <family>
    <parent attr1="val1">
    <child attr2="val2" attr3="val3"/>
    </parent>
    </family>
    Using object table and object type (for the child element), I am able to produce the following XML Document (with a "select * from family" query)
    <family> <!-- rowset -->
    <parent> <!-- row -->
    <attr1>val1</attr1>
    <child>
    <attr2>val2</attr2>
    <attr3>val3</attr3>
    </child>
    </parent>
    </family>
    The question is: how am I going to query these data so that the "attr" elements are mapped to attributes (using XSU only, without XSLT)?
    I have already tried the following:
    1. Using
    SELECT attr1 as "@attr1",
    f.child.attr2 "@attr2",
    f.child.attr3 "@attr3"
    FROM family f
    all the attributes are obviously appended to the "parent" element.
    2. Using nested table for "child" and the following query
    SELECT attr1 as "@attr1",
    CURSOR (
    SELECT n.child.attr2 as "@attr2", n.child.attr3 as "@attr3"
    FROM TABLE(f.child n)
    ) AS "child"
    FROM family f
    I am getting the following document
    <family>
    <parent attr1="val1">
    <child>
    <child_ROW attr2="val2" attr3="val3"/>
    </child>
    </parent>
    </family>
    Is there a smart SQL query to produce the desired document? What data types
    is it recommended to use to define my db schema (object types, nested tables...)?
    Thank you in advance
    null

    Finally, I got the desired XML format output from relational tablse using schema based XMLType views.
    Wherein I created Object Types from relational table, generated the schema for the Object type, registered the schema and finally created XMLType Views for populating the XML data from Relational Tables.
    I guess, you all might aware of my problem, where I got struck. Instead of printing the data in XML format I am successful in generating the XML format data Using the Query Select from BLABLA_Type_view* . I am able to print the number of rows, that I require which is in the fallowing format.
    Column Name
    1. SYS.XMLTYPE ----- As a row
    The view I am querying for is printing the data in a string format, where in I got to do the fallowing query
    SELECT SYS.XMLTYPE.getStringVal(OBJECT_VALUE) FROM BLABLA_Type_view. Which ultimately gave me the required data in XML format with tags.
    Thanks for every one who tried to give a try to solve, especially "mdrake"

  • How does a record type and table type works

    Hi,
    How a record type and table type work for the ref cursor,
    below i m giving an example but its giving me errors
    can any one help me for this?
    declare
    type empcurtyp is ref cursor;
    type rectype is record (veid t.emp_id%type, vename t.ename%type);
    TYPE tabtype IS TABLE OF rectype;
    empcv empcurtyp;
    vtab tabtype;
    begin
    open empcv for select emp_id,ename from t;
    loop
    fetch empcv into vtab;
         exit when empcv%notfound;
         dbms_output.put_line(vtab.vename||vtab.veid);
    end loop;
    close empcv;
    end;
    here we hav table t and i m taking only two fields of the table t which r emp_id and ename.

    Hi,
    What errors are you getting with this? From experience you don't need a loop to put the records into the ref cursor its usually done on block.
    HTHS
    L :-)

  • No archive information found for object type  and document type

    Hi All,
    When i try to view the print preview for a perticular doc type, system is giving the error as "No archive information found for object type  and document type"
    Diagnosis
        No information was found about optical archiving. This may be due to
        either of the following reasons:
        1.  No valid archiving parameters were passed
        2.  Your system is not configured for optical archiving
    System Response
        Processing is cancelled.
    Procedure
        Specify valid archiving parameters or check whether your system is configured for optical archiving
    Regds,
    CB

    Hello,
    You are trying to Print & also archive by selecting the option Print & Archive.
    You have to do archivelink configurations and then create document type and assign to the object type with content repository with archivelink table.
    If you want to archive the spool or output then you have to use object type as DRAW. If you are archiving invoice document or letters or so on then you have to know the object type/Business object of the transaction.
    Please note that for archivelink configuration, attachment will be either stored in archive server or in SAP database table based on business requirement.
    Hope this will give you some understanding on archiving area.
    -Thanks,
    Ajay

  • How to get object type and object key of bapi_acc_gl_posting_post

    Hi,
       I want to upload data from flat file to FB01 transaction using BAPI. For this i found bapi_acc_gl_posting_post. How should i get the obj type and object key for this bapi.
    Please let me know wether this is correct bapi for fb01 transaction.
    Thanks in advance,
    Regards,
    Sun.

    Hi,
       I want to upload data from flat file to FB01 transaction using BAPI. For this i found bapi_acc_gl_posting_post. How should i get the obj type and object key for this bapi.
    Please let me know wether this is correct bapi for fb01 transaction.
    Thanks in advance,
    Regards,
    Sun.

  • Which IDoc Type and Message Type to use for Credit Memo?

    Could you guys please tell me which IDoc type and Message Type to use for Credit Memo? Also if possible tell me the process code/ function module.
    Will certainly give points for right answer. Thank you for reading.

    Hi,
    You can use IDoc type FIDCCP02 with message type FIDCC1/FIDCC2 for Credit Memo.
    Also you can use this FM FI_IDOC_CREATE_FIDCC1/
    FI_IDOC_CREATE_FIDCC2 to generate the IDoc.
    Regards,
    Ferry Lianto

  • Transaction SMOEAC does not display Object type and Object Name options.

    Dear all,
    When I go to transaction SMOEAC system does not display fields Object type and Object Name option instead displays an empty frame allowing only to create new objects.
    System does not allow and display existing objects to edit.
    Most imp with the same ID, I am able to see the existing objects and two fields "Object type" and "Object Name" on different machine. So there is no authorization issue.
    My SAP GUI version where these fields are not visible is 640 Final Release with 6405.5.18.1016 version and Patch level 18.
    My SAP GUI version here these fields are visible is 640 Final Release with 6404.4.14.1012 version and Patch Level 14.
    Any idea what could be the reason?
    Regards,
    Sandeep Parab

    With installation of latest version of SAP GUI 710 final Release resolved my problem.
    Regards,
    Sandeep

  • How could I retrieve metadata about Array Type and Table Type?

    I use DatabaseMetaData.getUDTs() method for obtain metadata about Object Types, but this method doesn't work with Array Type and Table Type.

    JJ,
    Go into the diagrams of the DBTools List Columns and DBTools Get Properties respectively. When you inspect this diagram, you will see the raw ActiveX properties and methods called to get the size information. The value of -1 means the requested recordset is already closed. This is the sort of thing that is controled by the driver (ODBC, OLE DB, Jet, etc) you are using. Notice that you can right click on the property and invoke nodes and get more information about these specific items directly from the ADO online help.
    Crystal

  • Difference between line type and table type

    hi,
    can any one explain the difference between line type and table type . and how to declare a internal table and work area in BSP's

    hi,
    Go through this blog, this might help you.
    /people/tomas.altman/blog/2004/12/13/sdn-blog-how-to-do-internal-tables-in-bsp
    People who have worked with ABAP for a while sometimes forget that the internal table concept is rather different than what exists in most programming languages. It is very powerful, but at the same time can be confusing.
    In SAP it is possible to have a table which is the rows and a headerline which is the working area or structure which can then be commited to the table.
    With a BSP, if we try to create an internal table within the BSP event or layout we will get the following error: mso-bidi-
                            "InternalTableX" is not an internal table - the "OCCURS n" specification is mso-bidi- missing.
    class="MsoNormal"><![if !supportEmptyParas]>The problem we are seeing as an inconsistency has to do with the difference between classic ABAP and ABAP Objects. When SAP introduced ABAP Objects they decided to clean up some of the legacy syntax and create stricter rules. However they didn't want to break the millions of line of code that already existed, so they only implemented these stricter checks when OO is being used. Therefore you can declare a table with a header line in a regular ABAP program or Function Module but you can't have one with a header line in OO.
    Because everything in BSP generates ABAP OO classes behind the scenes, you get these same stricter syntax checks. My suggestion is that you have a look in the on-line help at the section on ABAP Objects and always follow the newer syntax rules even when writing classic ABAP programs.
    In a BSP when we need to work with a table we must always do the following:
    1, in the Types definitions create a structure:
                            types : begin of ts_reclist,
    mso-bidi-        style='mso-tab-count:2'>                            receiver type somlreci1-receiver,
    mso-bidi-        style='mso-tab-count:2'>                 style='mso-tab-count: 1'>             rec_type type somlreci1-rec_type,
    mso-bidi-         style='mso-tab-count:2'>                            end of ts_reclist.
    mso-bidi- <![if !supportEmptyParas]> <![endif]>
    but we must remember this is only a structure definition and we cannot store anything in it, although we can use it elsewhere as a definition for Structures(WorkAreas)
    2, in our Types definitions (this is the best place for this one as we can then access it from many areas without having to create it locally) so in the Types definitions we must create a TableType:
    class="MsoNormal">                         types : tt_reclist type table of ts_reclist.
    class="MsoNormal"><![if !supportEmptyParas]> <![endif]> this TableType is our table definition and again we cannot store anything in it, but we can use it elsewhere as a definition for InternalTables
    3, now that you have laid the foundations you can build and in the event handler, it is now simply a case of creating the InternalTable based upon the Table definition:
                           data: t_reclist type tt_reclist.
    and creating the structure based upon the structure definiton:
    <![if !supportEmptyParas]>   <![endif]>                         data: s_reclist type ts_reclist.
    as described above, the structure becomes the work area and this is where you assign new values for elements of the table eg:<![endif]>
                            s_reclist-receiver = '[email protected]'.   "<-- change address
    mso-bidi- <![if !supportEmptyParas]> <![endif]>
    mso-bidi-                         s_reclist-rec_type = 'U'.
    and then once the data is in the elements of the structure, the structure can be appended to the internal table as follows: class="MsoNormal">
                            append s_reclist to t_reclist.
    <![if !supportEmptyParas]> <![endif]>
    the internal table will then be readable for the ABAP function and can be applied for example as follows: class="style1">           style='mso-tab-count:1; font-family: "Courier New", Courier, mono;'>          
    class="style1">CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                            EXPORTING
    style='mso-tab-count:2'>                                    document_data = docdata
    style='mso-tab-count:2'>                                    DOCUMENT_TYPE = 'RAW'
    style='mso-tab-count:2'>                                    PUT_IN_OUTBOX = 'X'
    style='mso-tab-count:2'>                                    COMMIT_WORK = 'X' "used from rel.6.10
                            TABLES
    mso-bidi-font-size: style='mso-tab-count:2'>                                    receivers = t_reclist
    class="style1"> <![if !supportEmptyParas]>   <![endif]>
    <![if !supportEmptyParas]>F inally, a comment from Thomas Jung,
    <![if !supportEmptyParas]> “when defining my work area for an internal table I like to use the like line of statement. That way if I change the structure of my table type, I know that my work area will still be OK. Second, your types and table types don't have to just be declared in your code. You can create a table type in the data dictionary and use it across multiple programs(also great for method and function parameters). I really push hard for the other developers at my company to use the Data Dictionary Types more and more.”
    Hope this helps, Do reward.

  • Idoc type and message type

    how to find the idoc type and msg type for particular delivery no.
    [[i can see the idoc no in vl33n which i have to display in itab.]]

    <b>Message type</b>. A message type represents the application message exchanged between R/3 systems and R/3 and an external system. A message type characterizes the data sent across systems and relates to the structure of the data called an IDOC type (see below). For example, MATMAS is a message type for Material Master, and INVOIC is a message type for an Invoice (Billing Document). ALE supports over 200 message types in R/3 and about 200 application areas.
    <b>
    IDOC type and IDOC</b>. An Intermediate Document (IDOC) type represents the structure of the data associated with a message type (DEBMAS02 for message type DEBMAS — Customer Master, and WMMBID02 for message type WMMBXY— Goods Movements), while an IDOC is an object containing the data of a particular message type. IDOCs are data containers with intelligence built in. Each IDOC contains one and only one business object. For example, an IDOC of type SHPMNT01, message type SHPMNT, will contain data only of one Shipment Document. Generally, the architecture of an IDOC is independent of the message type by virtue of ALE’s ability to redefine it for any message type.
    <b>Use transaction BD64 or the following menu path to maintain the model: From the IMG (Implementation Guide), Cross-Application Components -> Distribution (ALE) (*) -> Distribution Customer Model -> Maintain Distribution Customer Model Directly -> Maintain Distribution Customer Model Directly.</b>
    Hope this helps you....
    Regards,
    Pavan

  • Diff b/w reference type and elementary type

    hi all
    can any one what is the diff b/w reference type and elementary type in data element ....
    thanks
    lokesh

    The data type attributes of a data element can be defined by:
    Specifying a domain whose attributes are copied by the data element.
    Specifying a build-in type where the data type, number of places, and possibly decimal places can be directly specified.
    Specifying a reference type, i.e. reference to a class, an interface, a type defined in the Dictionary, a built-in type, or a generic reference to ANY or DATA.
    In the maintenance screen you can set the option you require by setting the appropriate flag (domain, built-in type, reference type) and filling in the corresponding input fields.
    A reference type is a reference to another type. There are the following kinds of reference types:
    Reference to a class or an interface
    Reference to a type defined in the Dictionary
    Generic reference to ANY, OBJECT, or DATA
    Reference to a built-in Dictionary type with specification of the length and possibly also the decimal places
    You can use a reference type to define the data type properties for a data element, or for typing the component of a structure or the line type of a table type.
    In the field Referenced type, enter the name of a class, an interface, the generic references DATA, OBJECT, ANY, or the name of a type defined in the Dictionary. If the reference type is to be a predefined Dictionary type, choose the reference to the predefined type. Enter the number of characters and, if required, the number of decimal places.
    where as
    The data class describes the data format at the user interface.
    If a table field or structure field or a data element is used in an ABAP program, the data class is converted to a format used by the ABAP processor. When a table is created in the database, the data class of a table field is converted to a corresponding data format of the database system used.
    You can find a detailed description of the data classes allowed in the ABAP Dictionary in Overview of the Data Classes.

Maybe you are looking for