Object to user defined object

I pushed user defined objects in to the Vector or Stack.
But they return an java defined Object type when I try to use them.
Is there way that I can convert this Object into my defined object.
MyClass a;
MyClass b;
Stack table = new Stack();
table.push(a);
table.push(b);
//now when i use pop to get it back it returns an Object type
Object temp = table.pop();
//how do I change this object into MyClass so i can have access to MyClass stuff?

dam..thank you so much I feel stupid..Don't.
Casting is one of those things that can take a while to get used to.
In your original post, you asked: how do I change this object into MyClass so i can have access to MyClass stuff?
It's important that you understand that casting doesn't change the object in any way.
All it does is cause a reference that's been declared as one type to be treated as a different type. So even though all the compiler knows about what's returned from pop() is that it refers to an Object, you're telling it you know better, and that the object pointed at will in fact be a MyClass, and so you can access MyClass' members.
If, at runtime, the object you happen to pop off the stack isn't a MyClass, casting won't magically turn it into one. You'll get a ClassCastException.

Similar Messages

  • Crystal Report Templates for User-Defined Objects

    Hello Experts,
    I am running SAP B1 8.8 PL11. In the current patch SAP has default Crystal Reports that can be used as Layouts for Invoices, Credit Memo's so on. Is it possbile to have layouts for user defined objects ( say for instance i have a customized form under sales module, can i import a crystal template for this customized form?). In the report layout manager i don't see an option to import user-defind objects.
    Any help would be appreciated.
    Thanks,
    Praneeth

    If this is still a problem please re-post to the SAP Integration Kit forum.

  • How can i send user defined Object as a argument to the MBean methods in authentication provider to create user?

    I developed our own Authentication, Identity Assertion & Authorization providers
    for weblogic 8.1 SP1. In the authenticator MBean i have one method which takes
    user defined object as a argument and returns a user defined object. i am able
    to call all the methods which takes java objects(for example: String, int, ArrayList,
    HashMap, Etc...) as a argument and returns also a java object but when i user
    any user defined object then it gives exception. if in the argument i used user
    defined object then it is not able to call that method telling NoSuchMethodException.
    Is there any way to use user defined object as an argument to MBean method?
    can anyone please help us as we r in the final stage of the project?
    Thanks
    Lakshmi

    "Lakshmi Padhy" <[email protected]> wrote in message
    news:3fc2f50c$[email protected]..
    >
    I developed our own Authentication, Identity Assertion & Authorizationproviders
    for weblogic 8.1 SP1. In the authenticator MBean i have one method whichtakes
    user defined object as a argument and returns a user defined object. i amable
    to call all the methods which takes java objects(for example: String, int,ArrayList,
    HashMap, Etc...) as a argument and returns also a java object but when iuser
    any user defined object then it gives exception. if in the argument i useduser
    defined object then it is not able to call that method tellingNoSuchMethodException.
    >
    Is there any way to use user defined object as an argument to MBeanmethod?
    >
    I seem to remember that jmx only supports scalar datatypes. Ask in the
    weblogic.developer.interest.management newsgroup.

  • Can Automation be used to send User-defined CC's to Environment objects?

    Hi, this is probably a really dumb question but I'll ask it anyway:
    I've bought a controller-environment for a synth (Alphajuno2, PG300 programmer) for Logic, the faders in the environment layer use sysex to communicate with the synth.
    Apparently it is possible to map an external midi-controller to these environment-faders, and that's all and fine, but what I'm after is a method of using automation to control the environment-faders. How would I go about doing it?
    I've only ever really automated some volume changes or plugin parameter changes, I've not yet automated faders in the environment, so how would I go about doing it?
    Would I create a fader which I'd link to the sysex-sending fader, and automate the fader, or maybe an environment-monitor (and add it to the arranger) and somehow configure a set of CC#'s to be automated with that arranger object, and then just cable them up to the various Sysex-sending faders (I do know enough to be able to set the input of those sysex-faders to match the CC#'s which the automation would be sending).
    Is this kind of "User-defined CC#'s in Automation" possible? How should I go about it?
    Message was edited by: esaruoho to further clarify it

    Is it just because there is currently no way whatsoever of Automation CC, and I should have known to use Hyper Draw to talk to an Environment object directly, which would then be connected to the Faders of choice?

  • User-defined field assignment  in Contact object

    Good Day
    Experts:
    I guess this might apply to all SAP Business Objects.  Specifically, I am working with the oContact object.  A User-defined field has been added to the OCLG table.  I need to populate the field with the current logged on User.  I see that I can do the following with the intellisense but I am not sure where to go from here.
    vContact.UserFields.Fields.Item
    I tried but I get a message "Expression is a value and therefor cannot be the target of an assigment:
    vContact.UserFields.Fields.Item("U_Creator") = (GetUserCodeSess(g_B1Connection.Company.UserName))
    It feels like I should be able to set the User-defined variable through the object but I don't think I am doing it correctly.
    Any helpful hints?
    Thanks,
    Ed

    Hi Robert,
    I think the only supported way is to give full rights to the users and block changing field in the Item Master Data form through your addon.
    A non supported way is to use a query to update the item master fields
    Regards
    Ad

  • Send a array of user-defined java objects to stored procedure

    hi,
    I´d like to know if its possible send java user-defined objects to a collection. I've tried the exemple bellow but it doesn´t work:
    1) In database
    -- nested table type
    create or replace type client_table_type is table of client%rowtype;
    -- table client:
    teste
    ( id number(18,0),
    name varchar2(80),
    birthday date)
    -- stored procedure
    create or replace package client_pkg
    is
    procedure insert_clients(
    p_array_clients client_table_type
    end;
    2) In Java
    java.lang.Class.forName ("oracle.jdbc.driver.OracleDriver");
    java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin .....);
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("client_table_type", conn);
    ARRAY a2 = new ARRAY(descriptor, conn, anArrayIn);
    PreparedStatement ps = (PreparedStatement)conn.prepareStatement("{ call client_pkg.insert_clients(?) }");
    ps.setArray(1, a2);
    ps.execute();
    Where anArrayIn is an array of Client and Client is a java user-defined class with these attributes:
    public class Client{
    public long id;
    public String name;
    public Date birthday;
    3) when I´ve tried to run the java code its returned the error in the ArrayDescriptor line:
    Exception in thread "main" java.sql.SQLException: .....:
    Unable to resolve type: "SISSERV.CLIENT_TABLE_TYPE"
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1976)
    at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:199)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:118)
    at teste_array_oracle.Carga.callPLSQL(Carga.java:60)
    at teste_array_oracle.Carga.<init>(Carga.java:41)
    at teste_array_oracle.Carga.main(Carga.java:32)
    erro de execuþÒo
    Tks for any help!

    A brief answer to this from my side (not knowing Java that wel), but hopefully suffices to put you on the right track.
    <p>
    A SQL user defined type is basically a class (it can contain properties and methods). It has only superficial resemblence to a traditional record struct. So you cannot use one. Even if you could (assuming you code a PL/SQL "traditional" record struct), there are issues around how char and numeric data are represented binary inside Oracle and issues around byte/word alignment.
    <p>
    So bottom line - what you're doing will not work (as the errors show).
    <p>
    Okay, so what then? Well, the OCI (Oracle Call Interface) supports all Oracle data types, including these user types (also called Advance Data Types in Oracle-speak). You therefore need to use the supplied API calls to deal with instantiated objects (structures) of these type.
    You're best bet is to have a look Oracle® Database Java Developer's Guide

  • Manual document number in User-Defined Object

    Hi Experts,
    I have a user-defined object of document type.  I am trying to post a document using the General Service. However, I cannot assign manual document number.  There is no handwritten property available.  Is it possible to assign manual document number in user-defined objects using the DI API?
    Thanks.
    Melvin

    Hi,
    This issue has been resolved.  For the benefit of those who will be encountering this error, it was resolved by manually assigning the Handwrtten field to 'Y'.  Here is the code fragment:
    shipmentHeader.SetProperty("Handwrtten", 'Y')';

  • How to Use Sequence Object Inside User-defined Function In SQL Server

    I'm trying to call sequence object inside SQL Server user-defined function. I used 
    Next Value for dbo.mySequence  to call the next value for my sequence created. But I'm getting an error like below.
    "NEXT VALUE FOR function is not allowed in check constraints, default objects, computed columns, views, user-defined functions, user-defined aggregates, user-defined table types, sub-queries, common table expressions, or derived tables."
    Is there any standard way to call sequence inside a function?
    I would really appreciate your response.
    Thanks!

    The NEXT
    VALUE FOR function cannot be used for User Defined function. It's one of the limitation.
    https://msdn.microsoft.com/en-us/library/ff878370.aspx
    What are you trying to do? Can you give us an example and required output?
    --Prashanth

  • Problems with User Defines Mapping Objects - Dynamic Configuration

    We have a mapping object that takes data passed in from R3 and does an HTTP Post to another system using a URL and file name that is passed from the header record. We had a consultant set this up for us last year and in creating the new one we just pretty much copied what he did. The problem is, it is not working for us. We have the url and file name, we pass it to the user defined code that is supposed to pass it to the url and file name in the configuration. The java code looks like this:
    public String getPcurlOut(String pcurl,Container container){
    String ourSourceFileName = "START";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    if (conf != null) {
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key, pcurl + ".xml");
    ourSourceFileName = conf.get(key);
    } else {
    ourSourceFileName = "conf == null";
    Basically we want to pass a url and file name to our communication channel based on values that come from our file in R3
    It is almost exactly like the one that works. Can anyone help with this?
    Thanks
    Mike
    Message was edited by:
            Michael Curtis

    Hi Michael
    <i>Basically we want to pass a url and file name to our communication channel based on values that come <b>from our file in R3</b></i>
    --> This means you have file as a sender adapter.
    Check adapter specific message properties in sender adapter.
    Please refer this blog , it is really worth.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Also
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory")
    Try writing this as
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","<b>FileName</b>")
    Regards

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • Some DB objects like User-defined datatypes being missed out?

    Dear all.
    I create an Oracle model for a captured SQL Server model and then right click -> click on 'Generate' to create the DB creation script.
    (1) But few objects like user-defined datatypes are missed out in the script.
    (2) Also, a simple stored proc as defined below missed out:
    CREATE PROCEDURE [SalesLT].[SayHi]
    AS
    SELECT 'Hi I am a job scheduler'
    GO
    Rgds, Abhi

    Hello,
    An OracleDI Dataserver connection to an RDBMS is, most of the time, defined with a single set of parameters: a user account name, a password and a URL.
    OracleDI may need to access numerous tables on the RDBMS which may not all be stored in the same database schema, catalog, library, ...and for which access privileges may not be identical.
    For this reason, it is necessary to ensure that the RDBMS user account has sufficient access privileges for these schema, catalog, librairies ...
    The user account should have at least read/right access permission for any OracleDI Physical Schema referenced for the concerned Dataserver (depending on the project within which it is used, a Physical Schema may store both source and/or target tables).
    Moreover, for project requirements, it may be necessary to use/create/drop certain RDBMS
    components such as stored procedures, views, temporary tables, system tables ...
    For this reason, make sure the user account referenced in the dataserver connection parameters is attributed sufficient privileges to any object it may manipulate with OracleDI.
    2nd point: you can use any logical name for the data server Name.

  • DTW user-defined object issues

    Dear all,
    I've tried to import a user-defined object with a template through DTW.
    However, I got an error message "To generate this document, first define the numbering series in the Administration moduleApplication-defined or object-defined error.
    Any ideas?
    Pls help.
    Thanks

    Hi,
    It is a limitation of the UDO that it is not possible to enter new values via DI or DTW. 
    There is a way to automatically fill your object's user tables. Please see the Note [804685|https://websmp130.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=804685] for more details regarding the issue description and the workaround available.                               
    hope it helps,
    Regards,
    Ladislav
    SAP Business One Forum Team

  • UDO--user defined object

    how to use UDO--user defined object in sap b1????

    Creating UDO in SAP B1
    1. Create UDT, ( Create UDT as Document if want the code to be in auto increament form)
    2. Create UDFs for created UDT,
    3. Register Object using  "Object Registration Wizard",
                    (a) Put UDT's unique name in "UNIQUE ID" field of UDO (Image - UDO01.jpg) ,
                    (b) Do further as per requirements,
    4. After Registering the UDO, you can access it from where you have set it to access (@ UI Settings of "User - Defined Object Registration Wizard"),
    5. If you wana change the field location / change the design of the form, Open screen painter as and click on "Open User Defined Object List " (Mostly 3rd icon from Left in screen painter),
    6. Make required changes and save it by clicking "Save Form To Database" ( Mostly 2nd icon from Left in Screen Painter),
    7. Now the UDO is ready and can be used by user.

  • Transfer user defined object between 2 databaeses

    i have created a user defined object in my local db.
    i need to import it to the companies server.
    what should i do ?

    If you are talking about the definition - you can use the Copy Express Add-On from SAP.
    Regards

  • Problen in ChooseFromList & User Defined Object

    Hello.
    I'm trying to use a [ChooseFromList] that calls info from one User Table called @LABS this table is MasterData type.
    I add a User Defined Object in runtime, called UO_Labs
    Then, I add one ChooseFromList to my form (This form was made in ScreenPainter)
    The user object was created fine, the ChooseFromList is added fine, the form loads fine, but, when I press tab or the button of the ChooseFromList I get this error: "Internal error (-1003) ocurred [Message 131-183]"
    I try to use my ChooseFromList in one Matrix and in one EditText objects. And gives me the same error in both objects.
    I'm using SAP 2007 PL 35
    This is my code:
    Adding the User Defined Object -
    Dim UO As SAPbobsCOM.UserObjectsMD
    UO = CompanyObj.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
    UO.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO
    UO.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
    UO.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
    UO.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
    UO.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
    UO.CanLog = SAPbobsCOM.BoYesNoEnum.tNO
    UO.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tNO
    UO.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES
    UO.Code = "UO_Labs"
    UO.Name = "Laboratory Info."
    UO.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData
    UO.TableName = "LABS"
    If UO.FormColumns.Count = 0 Then UO.FormColumns.Add()
    UO.FormColumns.SonNumber = 0
    UO.FormColumns.FormColumnAlias = "Code"
    UO.FormColumns.FormColumnDescription = "Code"
    UO.FormColumns.Add()
    UO.FormColumns.SonNumber = 0
    UO.FormColumns.FormColumnAlias = "Name"
    UO.FormColumns.FormColumnDescription = "Name"
    If UO.Add() <> 0 Then
          Application.MessageBox(CompanyObj.GetLastErrorDescription)
    End If
    END Adding the User Defined Object -
    This code adds my UDO and it works fine, has data and do the work.
    Adding the [ChooseFromList] Object -
    '// form object is send in parameters.
    Dim oCFLs As SAPbouiCOM.ChooseFromListCollection = f.ChooseFromLists
    Dim oCFL As SAPbouiCOM.ChooseFromList
    Dim oCFL_CP As SAPbouiCOM.ChooseFromListCreationParams
    Dim matrix As SAPbouiCOM.Matrix = form.Items.Item("matrix").Specific
    oCFL_CP = App.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
    oCFL_CP.MultiSelection = False
    oCFL_CP.ObjectType = "UO_Labs"
    oCFL_CP.UniqueID = "cfl_Labs"
    oCFL = oCFLs.Add(oCFL_CP)
    matrix.Columns.Item("labCode").ChooseFromListUID = "cfl_Labs"
    matris.Columns.Item("labCode").ChooseFromListAlias = "Code"
    form.Refresh()
    END Adding the [ChooseFromList] Object -
    Thanks for your time...
    Greetings
    Gabriel Vasquez.

    Hi Gabriel,
    Please check in B1 if the UDO is created correctly, specifically the CanFind option. I got that error once, with one of my addons, that somehow was created with CanFind=tNo, despite my code indication CanFind=tYes...
    Also, try adding the CFL directly in the XML form.
       <column uid="C_labCod" type="116" title="Lab. Code" description="Laboratory Code" visible="1" AffectsFormMode="1" width="70" disp_desc="1" editable="1" right_just="0" val_on="Y" val_off="N" backcolor="-1" forecolor="-1" text_style="0" font_size="-1" ChooseFromListUID="cfl_Labs" ChooseFromListAlias="Code">
          <databind databound="1" table="@LABS" alias="U_labCode"></databind>
          <ExtendedObject linkedObject="" LinkedObjectType=""></ExtendedObject>
       </column>
       <ChooseFromListCollection>
          <action type="add">
             <ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1"></ChooseFromList>
             <ChooseFromList UniqueID="cfl_Labs" ObjectType="UO_Labs" MultiSelection="0" IsSystem="0"></ChooseFromList>
          </action>
       </ChooseFromListCollection>
    Also, it's a good practice to your SAP partner's NameSpace as prefix to UDOs, UDTs, UDFs and UDKeys, in order to avoid conflicts with other partner's add-ons.
    Regards,
    Vítor Vieira

  • How to assign a query retrived value to a user defined  object in a table

    how to assign a query retrived value to a user defined  object in a table

    Rajeshwar,
    If you use the "Search" feature in this forum, you should be able to find helpful links to similar questions.  You could also look at the RecordSet and DoQuery documentation in the SAP Business One SDK Help Center documentation to assist you with your question.
    HTH,
    Eddy

Maybe you are looking for

  • Remote not working on apple tv

    My Apple TV not responding to remote.  I tried to pair but Apple TV is not responding.

  • Customized form opening in a dialog box

    Hi All, I have customized a form for the Document library. after saving the details it is saved to document library however when i open any item it just opens the document name to edit instead of all other fields. could you please give me steps on ho

  • Help with administrator password!

    I changed my administrator password but it's not working, nor is the original.  Any suggestions?

  • Intermediate Attributes in Test Script Specifications

    It is great that we can now view the specification of a test script (i.e. input values and expected outcome values for each case) to accompany the test script report, which shows the success or failure of each outcome and case. Thanks Oracle! The spe

  • Using an external display with Powerbook G4

    I have a Powerbook G4 15" (1.25GHz powerpc G4). I would like to purchase an Apple external display to use with it.I have two questions please: a) Is this Powerbook compatible with both the 20-inch Apple Cinema Display AND the 23-inch Apple Cinema HD