Doubt in creation of a new object

Hi All,
             I have one doubt in creation of a new object.If a new object is to be created and it is not a subtype
of any existing object, then what should we enter in the Program field for creating the object?
I hope I am clear with my question.
Thanks in Advance,
Saket.

Hi Saket,
Following will be required for created a custom business object.
1. Object Type - ZTEST (Internal Techincal Key)
2. Object Name - ZTESTNAME (Technical Key Name)
3. Name - TEST (Name of BO, it is used while selecting the object type)
4. Description - (Short Description of BO)
5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
6. Application - A or B.. etc (Area to which your BO is related)
Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
Regards,
Gautham Paspala

Similar Messages

  • Reusing a variable from a new object instance

    I'm developing a stock list array for an assignment I'm currently working on. I've got most of it done, and it seems to be working for the most part, but I'm having trouble getting an array to accept individual variable entries created by new object instances in TestQ3.java.
    I think problem is because the variable itemCode in CraftItem.java is being overwritten by the creation of a new object instance in the TestQ3.java file. I've tested it and believe this to be true.
    I can add a String of my own choosing by using testArray.addCraftItemToStock(itemCode); line but I want to get the program to reuse the itemCode values that have already been created by the four new object instances in TestQ3.java. For example, I want to be able to add more instances of them to the testArray.
    As I'm still relatively new to Java programming, I'm wondering how to do this. I've tried several solutions but I'm not getting anywhere. I'd appreciate it if anyone has any ideas?
    Here's my code:
    TestQ3.java
    public class TestQ3 {
      public static void main(String args[]) {
        // creating a new StockItem array
        CraftStock testArray = new CraftStock(CraftStock.initialStockCapacity);
        // creating new object instance for Glue
        Glue gluePVA = new Glue("PVA Glue",250,"789012",2.50);
        // adds gluePVA item code to the testArray list
        // testArray.addCraftItemToStock(gluePVA.getItemCode());
        // creating new object instance for Card
        Card colouredCard = new Card ("Coloured Card","A3","654321",1.25);
        // adds coloured card item code to the testArray list
        // testArray.addCraftItemToStock(colouredCard.getItemCode());
        // creating new object instance for Glue
        Glue superGlue = new Glue ("Super Glue",25,"210987",1.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(superGlue.getItemCode());
        // creating new object instance for Card
        Card whiteCard = new Card ("White Card","A4","123456",0.50);
        // adds superGlue item code to the testArray list
        // testArray.addCraftItemToStock(whiteCard.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
        // this adds the itemCode from gluePVA to the array but
        // it comes out as the last itemCode entry 123456 rather than 789012
        // when I run the code. The problem may lie with variable itemCode
        testArray.addCraftItemToStock(gluePVA.getItemCode());
        // display complete stocklist
        testArray.displayCraftStockList();
    CraftItem.java
    public class CraftItem {
      // instance variables
      public static String itemCode;
      private double price;
      //private int stockCount;
      // constructor
      public CraftItem(String itemCodeValue, double itemPriceValue){
        itemCode = itemCodeValue;
        price = itemPriceValue;
        //CraftStock.addCraftItemToStock(itemCode);
        //stockCount++;
      // getter for itemCode
      public String getItemCode() {
        return itemCode;
      // getter for price
      public double getPrice() {
        return price;
      // setter for itemCode
      public void setItemCode(String itemCodeValue) {
        itemCode = itemCodeValue;
      // setter for price
      public void setPrice(double itemPriceValue) {
        price = itemPriceValue;
      // toString() value
      public String toString() {
        return "Item code is " + itemCode + " and costs " + price + " pounds.";
    Glue.java
    public class Glue extends CraftItem{
      // Instance variables
      private String glueType;
      private double glueVolume;
      // Constructor
      public Glue(String glueType, double glueVolume,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            glueType = glueType;
            glueVolume = glueVolume;
      // getter
      public String getGlueType() {
        return glueType;
      // getter
      public double getGlueVolume() {
        return glueVolume;
      // setter
      public void setGlueType(String glueTypeValue) {
        glueType = glueTypeValue;
      public void setGlueVolume(double glueVolumeValue) {
        glueVolume = glueVolumeValue;
      // toString
      public String toString() {
        return glueType + ", " + glueVolume + "ml, item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    Card.java
    public class Card extends CraftItem{
      // instance variables
      private String cardType;
      private String cardSize;
      // Constructor
      // added super(itemCodeValue, itemPriceValue) to call on CraftItem
      public Card(String cardTypeValue, String cardSizeValue,
       String itemCodeValue, double itemPriceValue) {
            super(itemCodeValue, itemPriceValue);
            cardType = cardTypeValue;
            cardSize = cardSizeValue;
      // getter
      public String getCardType() {
        return cardType;
      // getter
      public String getCardSize() {
        return cardSize;
      // setter
      public void setCardType(String cardTypeValue) {
        cardType = cardTypeValue;
      // setter
      public void setCardSize(String cardSizeValue) {
        cardSize = cardSizeValue;
      // toString
      // using super. to call on methods from superclass CraftItem
      public String toString() {
        return cardType + ", size " + cardSize + ", item code is "
         + super.getItemCode() + " and costs " + super.getPrice() + " pounds.";
    CraftStock.java
    public class CraftStock {
        public static int currentStockLevel;
        public static String[] craftStock;
        public static int initialStockCapacity = 10;
        public CraftStock(int initialStockCapacity) {
            currentStockLevel = 0;
            craftStock = new String[initialStockCapacity];
        public int currentStockLevel() {
            return currentStockLevel;
        public static void addCraftItemToStock(String itemCodeValue) {
            if(currentStockLevel == 10){
              System.out.println("Stock list full: cannot add new item code." +
                "\nPlease remove an item if you want to add a new one.");
            else{
            craftStock[currentStockLevel] = itemCodeValue;
            currentStockLevel++;
            System.out.println("Item added");
        public void removeCraftItemFromStock(String itemCode){
          findStockItem(itemCode);
          int i = -1;
            do {
                i++;
            } while (!craftStock.equals(itemCode));
    for (int j = i; j < currentStockLevel - 1; j++) {
    craftStock[j] = craftStock[j + 1];
    currentStockLevel--;
    System.out.println("Item removed");
    private int findStockItem(String itemCode){
    int index = 0;
    for(int i = 0; i < currentStockLevel; i++){
    if(craftStock[i].equals(itemCode)){
    index = i;
    break;
    else{
    index = -1;
    return index;
    public void displayCraftStockList() {
    if(currentStockLevel == 0){
    System.out.println("There are no items in the stock list");
    else{
    for(int i = 0; i < currentStockLevel; i++){
    System.out.println("Item at " + (i + 1) + " is " + craftStock[i]);
    Message was edited by:
    Nikarius

    An instance variable relates to an object. If you require a variable to be available across multiple objects of the same class then I suggest you declare a class variable using the static keyword in your declaration.
    HTH

  • Getting ORA-20001: Creation of new object is not allowed: !!

    Hi Am getting ORA-20001: Creation of new object is not allowed while enabling constraints after importing the dumps from source to target datbase,can anyone assist me to fix this issue.

    Hi Osama/Mustafa,Thanks for your quick response,can you please explain me the following things-
    1)As i don't have privilege to run the DBA_XX views,am not able to run those queries-
    SELECT OWNER, TRIGGER_NAME, TRIGGER_BODY FROM DBA_TRIGGERS WHERE TRIGGER_TYPE IN ('AFTER EVENT', 'BEFORE EVETN') AND TRIGGERING_EVENT LIKE '%CREATE%';
    can you tell me what output it'll throw,based on this output how will we fix the issue.
    2)SELECT * FROM dba_sys_privs WHERE privilege = 'UNLIMITED TABLESPACE';
    why we need to check this privilege?as i don't have privilege to run this one in my db.
    3)select * from dba_source where upper(text) like upper('%Creation of new object is not allowed%');
    as i don't have privilege to run this one in my db,already i got the object name from my logfile
    and more you have quoted"This is an error of someone that coded purposely on your database, probably dba or a developer who has privilege and again it is in a database event trigger"
    4)can you explain me much more deeper about the root cause and as already sent note to my DBA,can you explain me the solution to fix this issue ?

  • Creation of new object link for DMS

    i have searched a lot  about Creation of new object link for DMS on internet .
    and all replies  focus on that documentation :
    1.     Program two screens for the following module pools for the SAP object that is to be linked additionally:
    u2013 SAPLCV00
    u2013 SAPLCVIN
    The process logic must be according to that of screen 0204 in program SAPLCV00 and must not be changed.
    2.     Create the function module OBJECT_CHECK_XXXX (XXXX = name of the SAP object).
    i need  to know how to implement that  in more detailed step by step
    as  i know DMS and  abap also.

    Hi Reda,
    Hope the below URL will help to understand how the Process of adding a object link works.
    Enhancement Without Modification of the Object Links - Engineering Change Management (LO-ECH) - SAP Library
    Thanks & Regards,
    Seshadri.

  • Step By Step Creation Of A new Business Object

    hi,
      Please Give Me Details Of A Business Object,like step by step creation of a new business object and it's utilization.

    Create a business object (SWO1).
    Give the business object name prefixed with Z_.
    Enter the following fields with values:
    Object type:      Z_TESTXX
    This is the internal technical key. Page: 1
    Object type can have maximum 10 characters. This must be unique across all object type. Objects are specific instances of object types at runtime.
    Object name: Object_Name_for_XX  
    The object type is addressed with this name by external applications. This is a descriptive English name and can be up to 32 characters. This also must be unique across all object type.
    Name:      Object Name: XX       
    This is a meaningful name of the business object.
    Description:     Object Description: XX     
    Page: 1
    Object description, can be up to 40 characters.
    Program:      Z_TESTXX       
    Each object type has an ABAP/4 program in which methods of the object are implemented. This program is generated automatically when you create or revise an object type.
    Application: indicates cross application.
    3: Create an event.
    Open the Object type in change mode. When you change your subtype the first step is to create a new event, this is done by selecting the Event node and clicking the create button. Give the event a name and a description.  Next set the status of this object type component to implemented.
    Event:          Z_EVENT_XX                              
    Name:          Event name: XX                          
    Description:     Event Description: XX                   
    Click on the new event andu2026
    Edit - Change Release Status- Object Type Component - Implemented
    (A small box sign vanishes from the right side of the event, indicating that it is implemented)
    There can be multiple triggering events for a standard/customer task.
    In R/3 4.0 the release strategy for new Object Types and Object Type Components (methods, attributes, events, etc.) was enhanced.  Now when an object type and/or components are created, there are different statuses to select, based on its required purpose.  The statuses are:
    u2022     Modeled - objects cannot be accessed at runtime.  This is the status that is automatically set when an object type or component is created.  Items with a modeled status cannot be referenced in any type of workflow task.
    u2022     Implemented - objects can be used internally in a test environment.  They are accessible, but may not be stable (especially if no delegation has been defined).
    u2022     Released - objects are ready for production. Note:  Local objects cannot be released.
    u2022     Obsolete - objects are typically replaced by new functionality or incompatible with previous versions.   This status is optional.
    4: Create a method.
    Next a method must be created without using any function module template. When creating the method ensure that the method call is synchronous - this means that the method doesn't require a terminating event.
    A method can be synchronous or asynchronous. Synchronous Method
    Method that, for the duration of its execution, assumes the process control and, after its execution, reports to the calling component (work item manager, in this case).
    Synchronous methods can return the following data, if defined: Return parameters, one result and Exceptions.
    Terminating events can also be defined for a single-step task described with a synchronous method. At runtime, the relevant work item is then terminated either when the synchronous method is successfully executed or when one of the defined terminating events occurs.
    Asynchronous Method
    Method that, after its execution, does not report directly to the calling component (work item manager, in this case).
    Asynchronous object methods do not return results, parameters or exceptions.
    At least one terminating event must be defined for a single-step task described with an asynchronous object method.
    At runtime, the relevant work item is only terminated if one of the defined terminating events occurs.
    Next set the status of this object type component to implemented. The methods are not implemented unless you once open their program.  Select the method and open its program. It gives a message u201CDo you want to generate a template automatically for the missing sectionu201D. Click u201CYesu201D. Inside the program insert the code u201CCALL TRANSACTION u2018FB03u2019. Display Financial Document.
    Method:     Z_METHODXX                              
    Name:      Method name: XX                        
    Description:     Method Description: XX                                                                               
    Edit - Change Release Status - Object Type Component - Implemented
    5. Create Key fields.
    Create key fields with ABAP dictionary field proposal.
    It is the identifying key, via which the system can access a specific object, that is, an instance of the object type. The key fields of an object type are usually also the key fields in the table containing the header data for the object type. Only character-based data types are allowed as key fields. The total length allowed for all key fields is 70 characters. Each key field refers to a field in the ABAP Dictionary.
    Enter u2018BKPFu2019 in table name field and select all the key fields. Press Continue button. Next set the status of these key fields to implemented.
    Edit - Change Release Status -Object Type Component - Implemented
    6:Implement business object.
    The whole business object needs to be implemented so click on the business object title andu2026
    Edit - Change Release Status - Object Type - Implemented
    Now you can check the syntax, generate the Business Object and then test it. Execute the custom method you created and give the Company code, Document number and Year.

  • Use String Variable in New Object Creation

    Thanks to those who review and respond. I am new to Java, so please be patient with my terminoloy mistakes and fumblings. I am reading in a file and I want to create a new object based on specific field (car for example). As you will notice I grab field 8 here label sIID.
    String sIID = dts.group(8);
    BTW this regex grouping works fine. The problem is seen when I try to use the sIID variable in my new object creation process.
    DateParse sIID = new DateParse();
    My IDE is reporting "Variable sIID is already defined in the scope"
    Is this possible? The assumption is that the sIID will have different value during the processing of the file. For example, car could mean truck, sedan, etc with operators like color, number of doors, mileage, top speed, etc.

    Thanks for the reply. I have include similar and much shorter code for the sake of brevity.
    My problems are centered around the x variable/object below. Ideally this would translate to three objects PersonA, PersonB, etc that I could reference later in the code as PersonA.newname if I wanted to. Hopefully this makes sense.
    public class TestingObjects {
      public static void main(String[] argv) {
           String [] names;
           names = new String[3];
           names[0] = "PersonA";
           names[1] = "PersonB";
           names[2] = "PersonC";
           for (String x:names) {
             PN x = new PN();  // <- Problem
             x.name = x;
             x.SayName();
            System.out.println(x.newname);
    public class PN {
           String name;
           String newname;
      public String SayName() {
           newname = "Name = " + name;
           System.out.println(name);
          return newname;
    }

  • Aborting new object creation

    I want to test the input parameters to a constructor and determine if an invalid parameter has been supplied.
    If I use:
    Thingy myThingy = new Thingy("invalid value");
    is it up to the programmer of the above to catch the error, either through exception handling or some other form of error checking, and perform
    myThingy = null;
    to render the partially initialized object ready for garbage collection?
    Is there a way in the constructor itself to indicate that the object shouldn't be created and null should be returned as the result of the "new" operation?
    Thanks,
    John

    But I'd say Clem1986 still has a point. Even in the constructor
      Foo() throws Exception {
        throw new Exception("Bollocks");
      }there's the implicit call to super() and instance initializers before you arrive at throw. From JVM spec: The new instruction does not completely create a new instance; instance creation is not completed until an instance initialization method has been invoked on the uninitialized instance. Which is done above. Whether this qualifies in OP's context as completing instance creation or instantiating an object I don't know. But you could work with it in the constructor, and once you get to throw, memory has been allocated, all superclasses have been initialized (which might involve heavy allocation/computation), default values were assigned to fields and instance initializers have executed. Only now can you decide to "abort new object creation" by completing abruptly and not "returning" the reference to the newly-(partially-)created object to the caller.

  • New Object Creation vs. Field Setters

    I know this is massively context dependent, but is there some rule of thumb to follow when it comes to deciding between
    i) Making an class's fields final and creating a new object with new field values when needed, and
    ii) Leaving a class's fields mutable and using setter methods to alter the field.
    I tend toward option one, because not only do I tend to shy away from setters, but also because it helps prevent me from accidentally maintaining an old reference. However, purely from a performance standpoint, which option should you assume is better? How many object's of X size do I have to be making per unit of time before the performance benefits of "final" are lost?
    Thanks!

    I've been wishing for a while that Java would add a language level concept of immutability. Either an immutable keyword or an annotation. The compiler would bitch if you declared a class immutable and each of its fields was not final and either a primitive or a reference to an immutable class. Or perhaps it could simply check that there was no assignment to any field.
    It would be handy for me as a user of a class to know that it's immutable, for things like copying and thread-safety. It might or might not allow for runtime optimizations too.
    As for whether to make a given class immutable, like others say--it depends on the semantics of the class. If it's intended to represent something dynamic--e.g. a clock, or a piece on a board whose position changes with time, or the state of a network interface including packet sent and received--then it will make your code clunky and nonintuitive if you have to create a new object everytime the state of the thing you're modeling changes. But if it's something that changes less frequently, or that represents a fairly static entity or "value", then make it immutable.
    I do agree with duffymo: Better that an object comes out of construction in a valid and useful state. So even if the object is mutable, pass field values to the c'tor or set them to reasonable defaults inside the c'tor (e.g., "now", etc.)

  • New object type creation...in MASS transaction..

    Hi,
    I want to create new object type for Maintainace plan mass mainainace how to do it....can anybody tell me..??
    In standard MASS transaction i am not getting object type for Maintainace plan
    Regards,
    San Rao..

    hi
    O1CL-->select Table you asscosiate with class type( If it it not exists the click on New Item)
    ->Lets consider that it is MARA>double click on Plant->click on object types>click on New Item--->click on Object
    Similerly maintain class status,Org Area etc
    You can also check the existing class for Example...this will help you.
    Regards
    Sujit

  • Creation of a new order type

    Hello,
    Which are the impact on FI-CO module of the creation of a new order type to create a sales order?
    Thanks a lot.
    Emanuela

    Hi Emanuela,
    When production is based on sales order ( i.e Product cost by Sales order) in this scenario
    sales order is created as a cost object.
    This sales order is referenced when we create Cost estimate structure in CK51N
    In this way sales order is integrated with Product cost controlling in CO module.
    If your question is not answered, then give specific details about your requirement.
    With Regards
    AKBAR

  • Confused about creation of inner class object of a generic class

    Trying to compile to code below I get three different diagnostic messages using various compilers: javac 1.5, javac 1.6 and Eclipse compiler. (On Mac OS X).
    class A<T> {
        class Nested {}
    public class UsesA <P extends A<?>> {
        P pRef;
        A<?>.Nested  f() {
            return pRef.new Nested();  // warning/error here
    Javac 1.5 outputs "UsesA.java:11: warning: [unchecked] unchecked conversion" warning, which is quite understandable. Javac 1.6 outputs an error message "UsesA.java:11: cannot select from a type variable", which I don't really undestand, and finally the Eclipse compiler gives no warning or error message at all. My question is, which compiler is right? And what does the message "cannot select from a type variable" means? "pRef", in the above code, is of a bounded type; why is the creation of an inner object not allowed?
    Next, if I change the type of "pRef" to be A<?>, javac 1.6 accepts the code with no error or warning message, while javac 1.5 gives an error message "UsesA.java:11: incompatible types" (concerning the return from "f" above). Similarly to javac 1.6, the Eclipse compiler issues no error message. So, is there something that has changed about generics in Java between versions 5 and 6 of the language?
    Thanks very much for any help

    Checkings bugs.sun.com, it seems to be a bug:
    http://bugs.sun.com/view_bug.do?bug_id=6569404

  • Cancel the creation of a new record from a tree-form

    Hi all,
    We have an application with a tree-form interface. On the form is an option to create a new object (e.g. Employee, as an analogy). We would like to provide a way to cancel the creation and return to the previous selected node/employee; e.g. with a cancel button.
    How can we accomplish that?
    We tried to use the standard bindings rollback as an actionListener (#{bindings.Rolback.execute}), but this doesn't work as expected. The employee on the form is not the same as the selected one in the tree, but always the first one. After deep investigations it seems that the synchronization mthod
    JhsPageLifecycle.restoreRowCurrencies tries the synchronization with the (now obsolete) key of the new record.
    This gives the impression that rollback can be used to rollback changes on existing objects, but not to rollback the creation of a new record. So we're looking for another approach; any suggestions?
    Ciao
    Aino

    Hi,
    problem does not seem to be solved after all :-(
    As I wrote in the first post, the rollback tries to synchronize, using the id of the new row (that we retrieve from a database sequence when the viewrow is created).
    Any suggestion how we can synchronize with the 'selected' row?
    The strange thing is that it seems to work when we create a 'subordinate' (like create an employee from a department page), but it does not work when we create the same object (like a department from a department page).
    Ciao
    Aino

  • Design and registration of new objects

    We have the following three objects:
    - Order, which contains:
    -- OrderStatus
    -- Vector: OrderStatusHistoryItem
    Whenever order.setStatus(newStatus) is called we would like to create a new OrderStatusHistoryItem and add that to the vector of history inside the Order.
    Our first guess was to put this in the setStatus method of the Order object, so that noone would bypass the adding to history. But... When creating the OrderStatusHistoryItem inside the Order we of course get an error from TopLink, saying that the object was not registered in the UOW.
    Is there some way that we can tell TopLink that this relationship should be registered automatically on commit? If not, what would be the best way to design this? Of course we do not want to expose our domain layer to the internals of TopLink. Would a factory be the best way to handle registration upon creation?
    Thanks,
    Anders,

    Anders,
    New objects created and attached to working copies will be discovered during commit cycle and added to the persistent model including the appropriate INSERT. The only issue you will have is that you must make sure that setStatus(newStatus) is ONLY called on working copies read from or registered with a UnitOfWork. If this is true you should be able to create the new OrderStatusHistoryItem within the setStatus method and add it to the collection without registering it in the UnitOfWork.
    Doug

  • PDR Steps to create new object types

    We set a demo instance of the PDR tool here and it all works well.. I would now like to add purchase info records as an object that can be sequenced with all other master data like materials, material boms, variant class and ecms in a config folder. I know that new function modules would need be created but was wondering there was a document with steps expaining the entire procedure for doing this or if any other company has yet tried this with the tool.. It allows for the creation of new objects for the packet but would like to have some sort of guideline to follow if possible.

    Hello Mr Thorne,
    I knew there are some SAP Consultants that know how to implement a new object type. And there is a project together with the german army that expands the PDR with several object types.
    But you have to pay attention. The PDR consists of two main parts . The FOX - Frame work of Explosion and the UPS - Uniform Packaging Service.
    Creating a new Object type that can be "shipped" has to be in the UPS - BUT - if you are using the transaction CRWBD that new object type will not be found if you are exploding a baseline. That is the task of the FOX.
    And to add a new Object type into the FOX would be harder than add it into the UPS.
    I think the Consulting solution, uses a FOX exit to add that object into the UPS after the FOX-Run.
    I you need further information please contact SAP consulting (PLM).

  • Get error when add new object in crystal report

    hi
    i have this error "You are attempting to use functionality that falls under the Crystal Decisions Report Creation API license. This system does not have a valid license, or the evaluation copy of the license has expired. Please contact Crystal Decisions to obtain a Report Creation API license."
    when i add new object in crystal report with vb.net
    ""CRReport.Sections.Item(ii).AddTextObject("new text", 1000, 0)
    i do same program for 3 months ago but i lost it work without error
    ihave a license key for crystal report
    use cr10 with vb.net 2005
    can help me
    thanks

    Also, check out the blog [Use of the Report Designer Component (RDC) in VS .NET|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414700)ID0468837450DB00359707053703393347End?blog=/pub/wlg/15939].
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

Maybe you are looking for