Combining types in an object

Hello all,
I have a swing app that creates a text string. I want to combine a graphic (jpg used as a letterhead) with the generated text string into an object (?) that I can send to a printer for printing....I have been working on this for two days and can't seem to find an answer...the code that creates what I need is below...
This puts a blue square and the words "short notes" on the screen but I can't figure out how to save the total image and then send it to a printer...or is there someway to avoid showing it on the screen and just print it directly?....thanks in advance...mike

I don't have any code I could give you - I've only worked maintenance on printing code, and that was covered by a confidentiality agreement. However, searching the fora led me to http://java.sun.com/j2se/1.4.1/docs/guide/jps/spec/appendix_2Dgraphicsdoc.fm.html#7083 which looks like it might help you. If you replace the g2d.drawString with a drawImage, you're probably sorted.

Similar Messages

  • [svn:bz-trunk] 11030: Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null .

    Revision: 11030
    Author:   [email protected]
    Date:     2009-10-20 11:35:02 -0700 (Tue, 20 Oct 2009)
    Log Message:
    Tweak the deserialization of ASObjects to treat an empty string for the type of an object as null. It appears that there is some logic in the LC remoting code that relies on a non-null class name to always exist. This change reverts to the old behavior of not allowing empty string as a value for the ASObject.namedType.
    This should fix bug 2448442 and its duplicates caused by the recent serialization changes.
    I don't think this is the perfect fix. Pending further investigation, a better fix would be either:
    a. If it's OK to assume that empty string should always mean null for the type of the ASObject, the code that enforces it should be in the setter/getter inside ASObject and not in the deserializer.
    b. ASObject doesn't guarantee that a named type exists or is valid. In that sense an empty string is as bad as some random characters that cannot be a valid class name in java, so depending on how disruptive it may be, the fix should be in any logic that uses ASObject.getType().
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/io/amf/AbstractAmfInput.java

    Hi Pavan,
    "In your payload there is no namespace prefix for the elements under PayloadHeader element."
    Yes, you are right - but this message is standard AQ Adapter Header message - it's not defined by me. I just used message which was automatically added to my project when I have defined AQ Adapter.
    "In your process is the default namespace is same as namespace value of tns ??"
    Do you mean targetNamespace? If yes it's different as it points to process "targetNamespace="http://xmlns.oracle.com/PF_SOA_jws/PF_APPS/APPS_PROCESS" (names of application and process have changed as I try different ways to do that)
    ns1 is: xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/aq/PF_SOA/PF_APPS/PO_AQ"
    "another thing is tns and ns1 should have same values.."
    When I create a variable of header type, namespace ns1 is automatically created for it. I set it as property of receive activity. When process is instantiated on the serwer I get the error in which you can see that namespace is tns.
    Maybe I'm doing something wrong but I don't see how I could fix this in my process.
    You can see that the message I get on the server has nothing in common with the application/project/process names. Is it possible to define such variable?
    Regards
    Pawel
    PS:
    In Transformation xsl file, both variables (source and target) has tns namespace for Header and PayloadHeader, and no namespace for subfields.
    Edited by: pawel.fidelus on 2010-01-05 02:37

  • Difference b/w DATA TYPE and DATA OBJECT & differences b/w TYPE and LIKE

    hai
    can any one say the differences between Data type and Data Object.
    And also differences between TYPE and LIKE
    thanks
    Gani

    hi,
    _Data Types and Data Objects_
          Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
          In the ABAP type concept, fields are called data objects. Each data object is thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.
    Data Types
       As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program using the TYPESstatement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
         All programming languages distinguish between various types of data with various uses, such as ….. type data for storing or displaying values and numerical data for calculations. The attributes in question are described using data types. You can define, for example, how data is stored in the repository, and how the ABAP statements work with the data.
    Data types can be divided into elementary, reference, and complex types.
    a. Elementary Types
    These are data types of fixed or variable length that are not made up of other types.
    The difference between variable length data types and fixed length data types is that the length and the memory space required by data objects of variable length data types can change dynamically during runtime, and that these data types cannot be defined irreversibly while the data object is being declared.
    Predefined and User-Defined Elementary Data Types
    You can also define your own elementary data types in ABAP using the TYPES statement. You base these on the predefined data types. This determines all of the technical attributes of the new data type. For example, you could define a data type P_2 with two decimal places, based on the predefined data type P. You could then use this new type in your data declarations.
    b.  Reference Types
    Reference types are deep data types that describe reference variables, that is, data objects that contain references. A reference variable can be defined as a component of a complex data object such as a structure or internal table as well as a single field.
    c. Complex Data Types
    Complex data types are made up of other data types. A distinction is made here between structured types and table types.
    Data Objects
          Data objects are the physical units with which ABAP statements work at runtime. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
           Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type). You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
            A data object is a part of the repository whose content can be addressed and interpreted by the program. All data objects must be declared in the ABAP program and are not persistent, meaning that they only exist while the program is being executed. Before you can process persistent data (such as data from a database table or from a sequential file), you must read it into data objects first. Conversely, if you want to retain the contents of a data object beyond the end of the program, you must save it in a persistent form.
    Declaring Data Objects
          Apart from the interface parameters of procedures, you declare all of the data objects in an ABAP program or procedure in its declaration part. These declarative statements establish the data type of the object, along with any missing technical attributes. This takes place before the program is actually executed. The technical attributes can then be queried while the program is running.
         The interface parameters of procedures are generated as local data objects, but only when the procedure is actually called. You can define the technical attributes of the interface parameters in the procedure itself. If you do not, they adopt the attributes of the parameters from which they receive their values.
    ABAP contains the following kinds of data objects:
    a.  Literals
    Literals are not created by declarative statements. Instead, they exist in the program source code. Like all data objects, they have fixed technical attributes (field length, number of decimal places, data type), but no name. They are therefore referred to as unnamed data objects.
    b.  Named Data Objects
    Data objects that have a name that you can use to address the ABAP program are known as named objects. These can be objects of various types, including text symbols, variables and constants.
    Text symbols are pointers to texts in the text pool of the ABAP program. When the program starts, the corresponding data objects are generated from the texts stored in the text pool. They can be addressed using the name of the text symbol.
    Variables are data objects whose contents can be changed using ABAP statements. You declare variables using the DATA, CLASS-DATA, STATICS, PARAMETERS, SELECT-OPTIONS, and RANGESstatements.
    Constants are data objects whose contents cannot be changed. You declare constants using the CONSTANTSstatement.
    c.  Anonymous Data  Objects
    Data objects that cannot be addressed using a name are known as anonymous data objects. They are created using the CREATE DATAstatement and can be addressed using reference variables.
    d.  System-Defined Data Objects
    System-defined data objects do not have to be declared explicitly - they are always available at runtime.
    e.  Interface Work Areas
    Interface work areas are special variables that serve as interfaces between programs, screens, and logical databases. You declare interface work areas using the TABLES and NODESstatements.
    What is the difference between Type and Like?
    Answer1:
    TYPE, you assign datatype directly to the data object while declaring.
    LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.
    Answer2:
    Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.
    Answer3:
    type refers the existing data type
    like refers the existing data object
    reward if useful
    thanks and regards
    suma sailaja pvn

  • Using all types of resultset Objects i need a single program

    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e
    # next() - moves the cursor forward one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned after the last row.
    # previous() - moves the cursor backwards one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned before the first row.
    # first() - moves the cursor to the first row in the ResultSet object. Returns true if the cursor is now positioned on the first row and false if the ResultSet object
    does not contain any rows.
    # last() - moves the cursor to the last row in the ResultSet object. Returns true if the cursor is now positioned on the last row and false if the ResultSet object
    does not contain any rows.
    # beforeFirst() - positions the cursor at the start of the ResultSet object, before the first row. If the ResultSet object does not contain any rows, this method has
    no effect.
    # afterLast() - positions the cursor at the end of the ResultSet object, after the last row. If the ResultSet object does not contain any rows, this method has no effect.
    # relative(int rows) - moves the cursor relative to its current position.
    # absolute(int n) - positions the cursor on the n-th row of the ResultSet object.
    Using all these result set methods i need a sample program all these methods must be used in a single program itself

    BalajiEnntech123 wrote:
    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e I don't know who "u" are but they're wrong if they think there are "8 types of resultset objects are there in jdbc technology".
    They'd be especially wrong to think that the methods you mention are "types of resultset objects".

  • Setting data type of an object at run time

    This is something of an advanced problem, so I hope there's
    someone out there who can speak to this. I apologize for the length
    of the post, I'm just trying to be clear about a rather unclear
    conundrum. --
    We all use arrays to hold collections of things. As you know,
    an array is its self a type (Array) and so there is no way to
    declare, for instance, an array of MovieClips or an array of
    Strings. Heres what happens: lets pretend that we have 3 movie
    clips clip1_mc, clip2_mc, and clip3_mc, and an Array called
    anArray. so we can legally do this. anArray.push( clip1_mc );
    anArray.push( clip2_mc ); anArray.push( clip3_mc );. An array of
    size 3. Now the code: trace( typeof anArray[0] ); will output
    "object." This can be a problem. If you try this: var
    newClip:MovieClip = anArray[0]; you get a type mismatch from the
    compiler. "Found Object where MovieClip is required." It
    necessitates this: var newClip:MovieClip = MovieClip( anArray[0] );
    Bummer no?
    Ok. So fast forward. Lets assume a class List that uses an
    array to hold the items in the list. So the class uses the Array
    class in "composition." So you have methods like insert( ); and
    retrieve(). Retriece() returns an item from an index in the array.
    Because of the aforementioned problem, no matter what type the
    thing was going into the list it comes out with type Object because
    the retrieve function must return an item of some type, the only
    option is to declare the return type of the retrieve() function as
    Object. Lets say you know that this is a list of Strings. You could
    write the retrieve()'s code like: return String( returnItem ); And
    type the object "on the way out" .. but what if you want the list
    to work with any type object, you would have to have a variable to
    hold the desired type of objects in the list. And then as the
    objects are being returned, you'd cast them to the type stored in
    that variable. I guess that you'd pass the type to the constructor
    of the List: var aList:List = new List( "AddressCard" ); -- That
    should declare a List (Array) of AddressCards.
    Is there a way to do this? have the type specified in casting
    be dynamic?
    And the flip-side of that is detecting the name of the class
    of an object instance. The thing here would be to try to derive a
    String from the name of the constructor function. (which is always
    the class name) In actionscript 3 there is a service package--
    mx.util -- I think, that has a function to return the qualified
    class name of an object. But is there a jimmy rig for this in AS2?
    My actual project does not use an Array to implement List. (
    or Stack ) It uses a structure called a "linked list" - which is a
    whole other topic, but same problem as with Arrays is also present
    in the linked list versions and so requires the same solution. If
    one is willing to type things explicitly when assigning an item in
    the list to a variable of some type, this thing is quite excellent.
    But I don't like it. I have the package with docs, code, sample
    fla's, diagrams and everything that I would encourage people to
    download, look at, try and whatever and then come back here with
    any thoughts on it. There is a component with Flash professional
    that is a list like structure, but it's so general that it crosses
    the line into bloat. Ie: if you are using a list as a stack, you
    only need getTop() and pop() and push() not all the other (12 or
    so) methods in the class. Mine are patterned after structures from
    the C++ standard template library. And the code style is C++, but I
    think it's actually easier to read that way.
    the files:
    http://www.null.bz/ADL_Lib/ADT_Lib.zip
    Thanks in advance, for your efforts! I really appreciate all
    of it, helpful or not.

    First reactions:
    >>var newClip:MovieClip = MovieClip( anArray[0] );
    Even though you must use a cast to prevent the compile time
    error, you don't get an error on this line because the compiler
    skips typechecking for values accessed with the [] operator.
    >>Is there a way to do this? have the type specified in
    casting be dynamic?
    Nope. You must effectively type check all objects used
    through array elements yourself.
    Reading on...

  • How to find out the type of the object ?

    how would i find out the type of an object reference variable ?
    it would be nice if there was some sort of getType() method that would return a string to tell me the type of the object -- just for testing purposes

    try
    Object.getClass().getName();
    or just
    Object.getClass().toString();
    so something like this in your code:
    Object obj = new Foo();
    System.out.println(""+obj.getClass());
    etc.

  • In Configuration of Adapter,forselecting adapter type i gotno objects found

    In Configuration of Adapter,forselecting adapter type i gotno objects found.
    Default Adapters not Appear.please send me description to solve this problem.

    Have you done a fresh installation? If so, you need to import the SWCV SAP BASIS in your IR. To do this, you need to download the component corresponding to your SP from service.sap.com.
    You can find the components here
    https://websmp205.sap-ag.de/~form/handler?_APP=00200682500000001943&_EVENT=SEARCH&HIDE=&SEARCH_SPAT=X&SEARCH_BPAT=X&SEARCH_CD=X&SEARCH_P=X&SEARCH_PV=X&SEARCH_C=X&SEARCH_CV=X&SEARCH_TA=&SEARCH_V=&HIDE_EXPERT_SEARCH=X&SEARCH_MAX_RESULT=20
    Make sure, you downloading the component for your corresponding SP.
    This has to placed in import directory and you can download it in IR after this...
    Regards,
    Jai Shankar.

  • Type Messages and Objects turned from white to black in PDF

    When I exported my Keynote presentation to a PDF the Type Messages and Objects turned from white to black. The display in ”Preview” is ok but in Acrobat PDF Viewer it looks black instead of white. Only happens on some slides. I could not find a reason why this happened. Seemed kind of random to me when it happened. But the error was reproducable unless I rebuild it with new silides.

    Can you get the exact wording for that error? Is it can't mount iPod?
    Also, make sure iTunes is up to date...
    iTunes
    Finally, make sure your iPod's battery is charged up.
    btabz

  • CREATE TYPE address_type AS OBJECT - ERROR

    I am not able to create type objects tried with different versions of oracle too.
    Currently I am using Oracle 11g enterprise edition (2.9GB).
    The problem is when i create a TYPE object and when i terminate the command with a semicolon ';',oracle sql does not stop only (the query does not execute) the loop goes on and on.
    I did like this and found that the SYNTAX is also perfect.
    SQL> CREATE TYPE address_type AS OBJECT
    2 (street varchar2(30),
    3 city varchar2(30),
    4 pincode number(10));
    5
    6
    7
    8...
    It goes on and on it never ends. Command never executes.
    Please Help!

    A type body will contain PL/SQL semicolons, so once SQL*Plus sees that you're entering a type it stops treating semicolons as the SQL*Plus multi-line statement terminator character. (A type header will not contain semicolons, but I expect Oracle decided it would be even more confusing if CREATE TYPE BODY behaved differently to CREATE TYPE.)
    Note you can also terminate entry by entering a dot (period) on a line on its own.
    I guess in older version there was nothing like that.Actually this has been around for over 10 years ;)

  • Add a foriegn key constraint to to a sub type on an object table

    Hi,
    I'm trying to set up a new table of an object type in our DB at work and on it I want to create a foreign key constraint on one of the attributes of one of the sub types
    The table is called documents and is a table of document_ot
    Definition:
    create or replace
    TYPE document_ot AS OBJECT (
    -- ATTRIBUTES
    created_date DATE,
    created_by VARCHAR2( 32 ),
    doc_id NUMBER,
    -- CONSTRUCTORS
    ) NOT INSTANTIABLE NOT FINAL;
    This type is extended by the type funding_certificates_ot
    create or replace
    TYPE funding_certificate_ot UNDER document_ot (
    -- ATTRIBUTES
    fc_prefix VARCHAR2( 2 ),
    fc_sequence NUMBER,
    fc_suffix VARCHAR2( 1 ),
    fc_pr_id NUMBER,
    -- CONSTRUCTORS
    -- METHODS
    ) NOT FINAL;
    I want to add a constraint to the to documents table that says that the funding_certificate_ot column fc_pr_id references pr_id in the table payruns.
    I've managed to create an index on the fc_pr_id column using:
    CREATE INDEX fc_pr_idx
    ON documents d (treat (value(d) as funding_certificate_ot).fc_pr_id);
    The code I thought I'd use for the foreign key constraint would be:
    ALTER TABLE documents d
    ADD CONSTRAINT doc_pr_fk FOREIGN KEY
    treat (value(d) as funding_certificate_ot).fc_pr_id
    REFERENCES payruns
    (pr_id)
    ENABLE;
    But that doesn't work - would someone be able to give me the correct syntax please?
    Many thanks

    Hi,
    I'm trying to set up a new table of an object type in our DB at work and on it I want to create a foreign key constraint on one of the attributes of one of the sub types
    The table is called documents and is a table of document_ot
    Definition:
    create or replace
    TYPE document_ot AS OBJECT (
    -- ATTRIBUTES
    created_date DATE,
    created_by VARCHAR2( 32 ),
    doc_id NUMBER,
    -- CONSTRUCTORS
    ) NOT INSTANTIABLE NOT FINAL;
    This type is extended by the type funding_certificates_ot
    create or replace
    TYPE funding_certificate_ot UNDER document_ot (
    -- ATTRIBUTES
    fc_prefix VARCHAR2( 2 ),
    fc_sequence NUMBER,
    fc_suffix VARCHAR2( 1 ),
    fc_pr_id NUMBER,
    -- CONSTRUCTORS
    -- METHODS
    ) NOT FINAL;
    I want to add a constraint to the to documents table that says that the funding_certificate_ot column fc_pr_id references pr_id in the table payruns.
    I've managed to create an index on the fc_pr_id column using:
    CREATE INDEX fc_pr_idx
    ON documents d (treat (value(d) as funding_certificate_ot).fc_pr_id);
    The code I thought I'd use for the foreign key constraint would be:
    ALTER TABLE documents d
    ADD CONSTRAINT doc_pr_fk FOREIGN KEY
    treat (value(d) as funding_certificate_ot).fc_pr_id
    REFERENCES payruns
    (pr_id)
    ENABLE;
    But that doesn't work - would someone be able to give me the correct syntax please?
    Many thanks

  • Data types and Data object

    Can Any one give me Clear definition of Data type and Data objects.
    Concept i know clearly.. but unable to explain it..
    Regards,
    Prasanna

    Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
             In the ABAP type concept, fields are called data objects. Each data object is an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data   object as well as the name of a data type.
    <b>Data Types:</b>
                     As well as occurring as attributes of a data object, data types can also be defined independently. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program (using the TYPES statement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
             Data types can be divided into elementary, reference, and complex types
    <b>Data objects:</b>
                      Data objects are the physical units with which ABAP statements work at runtime. Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running. The technical attributes of a data object are its length, number of decimal places, and data type. ABAP statements work with the contents of data objects and interpret them according to their data type. You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
    ABAP contains the following kinds of data objects
      Literals
       Named Data Objects
      Predefined Data Objects
      Dynamic Data Objects

  • Data type and Data object

    Hi Friends,
            What is the difference between Data type and Data object?
    Best Regards,
    VRV Singh

    hi
    good
    Each ABAP program define its own data types using the statement.
    TYPES dtype TYPE type ...
    and declare its own variables or instance attributes of classes using the statement
    DATA var {TYPE type} ...
    Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
    When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    Constructing New Data Types
    The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
    To construct new data types, the addition TYPE can be used with the following type constructors:
    ·        Construction of reference types
    REF TO type|dobj
    ·        Construction of structured data types
    BEGIN OF struc_type.
    END OF struc_type.
    ·        Construction of table types
    tabkind OF linetype
    These data types only exist during the runtime of the ABAP program.
    Referring to Known Data Types or Data Objects
    Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
    The known types or data that are referred to must be visible at the point where the data type or variable is declared.
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm
    thanks
    mrutyun^

  • Data types and data objects

    diff b/w data types and data objects

    hi prasanth,
    Data Types and Data Objects
    Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.
    In the ABAP type concept, fields are called data objects. Each data object is thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.
    Data Types
    Data types are templates for creating data objects. Data types can be defined independently in the ABAP program or in the ABAP Dictionary. As attributes of a data object, data types can also exist in a non-independent state. Data types do not use any memory space for work data, but may require memory for administration information.
    As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program using the TYPESstatement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.
    All programming languages distinguish between various types of data with various uses, such as ….. type data for storing or displaying values and numerical data for calculations. The attributes in question are described using data types. You can define, for example, how data is stored in the repository, and how the ABAP statements work with the data.
    Data types can be divided into elementary, reference, and complex types.
    a. Elementary Types
    These are data types of fixed or variable length that are not made up of other types.
    The difference between variable length data types and fixed length data types is that the length and the memory space required by data objects of variable length data types can change dynamically during runtime, and that these data types cannot be defined irreversibly while the data object is being declared.
    Predefined and User-Defined Elementary Data Types
    You can also define your own elementary data types in ABAP using the TYPES statement. You base these on the predefined data types. This determines all of the technical attributes of the new data type. For example, you could define a data type P_2 with two decimal places, based on the predefined data type P. You could then use this new type in your data declarations.
    b. Reference Types
    Reference types are deep data types that describe reference variables, that is, data objects that contain references. A reference variable can be defined as a component of a complex data object such as a structure or internal table as well as a single field.
    c. Complex Data Types
    Complex data types are made up of other data types. A distinction is made here between structured types and table types.
    Data Objects
    A data object is an instance of a data type and occupies as much memory space as its type specifies. An ABAP program only works with data that is available as content of data objects. Data objects are either created implicitly as named data objects, or exanonymous data objects using CREATEDATA.
    Data objects are the physical units with which ABAP statements work at runtime. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
    Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type). You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.
    A data object is a part of the repository whose content can be addressed and interpreted by the program. All data objects must be declared in the ABAP program and are not persistent, meaning that they only exist while the program is being executed. Before you can process persistent data (such as data from a database table or from a sequential file), you must read it into data objects first. Conversely, if you want to retain the contents of a data object beyond the end of the program, you must save it in a persistent form.
    Declaring Data Objects
    Apart from the interface parameters of procedures, you declare all of the data objects in an ABAP program or procedure in its declaration part. These declarative statements establish the data type of the object, along with any missing technical attributes. This takes place before the program is actually executed. The technical attributes can then be queried while the program is running.
    The interface parameters of procedures are generated as local data objects, but only when the procedure is actually called. You can define the technical attributes of the interface parameters in the procedure itself. If you do not, they adopt the attributes of the parameters from which they receive their values.
    ABAP contains the following kinds of data objects:
    a. Literals
    Literals are not created by declarative statements. Instead, they exist in the program source code. Like all data objects, they have fixed technical attributes (field length, number of decimal places, data type), but no name. They are therefore referred to as unnamed data objects.
    b. Named Data Objects
    Data objects that have a name that you can use to address the ABAP program are known as named objects. These can be objects of various types, including text symbols, variables and constants.
    Text symbols are pointers to texts in the text pool of the ABAP program. When the program starts, the corresponding data objects are generated from the texts stored in the text pool. They can be addressed using the name of the text symbol.
    Variables are data objects whose contents can be changed using ABAP statements. You declare variables using the DATA, CLASS-DATA, STATICS, PARAMETERS, SELECT-OPTIONS, and RANGESstatements.
    Constants are data objects whose contents cannot be changed. You declare constants using the CONSTANTSstatement.
    c. Anonymous Data Objects
    Data objects that cannot be addressed using a name are known as anonymous data objects. They are created using the CREATE DATAstatement and can be addressed using reference variables.
    d. System-Defined Data Objects
    System-defined data objects do not have to be declared explicitly - they are always available at runtime.
    e. Interface Work Areas
    Interface work areas are special variables that serve as interfaces between programs, screens, and logical databases. You declare interface work areas using the TABLES and NODESstatements.
    regards,
    sravanthi

  • Type attribute with Object type or Nested table?

    I have been creating lot many threads around the same problem, however i thought i knew but realized I do not know or else do not know how to..
    I have created object type with an attribute READINGVALUE NUMBER(21,6)...How can i use type attribute on this object while declaring variable.....can we use type attribute on NESTED TABLES, similar to the db tables?
    example
    CREATE TYPE READING AS OBJECT(READINGVALUE NUMBER(21,6));
    CREATE TABLE INTERVALREADINGS OF TYPE READING;

    meghavee wrote:
    Thanks Solomon, however this approach does not preserve precision/scale of number data type.....What you can do is create placeholder tables:
    SQL> create table reading_type_placeholder of reading
      2  /
    Table created.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(21,6)
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 123456789012345;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 1234567890123456;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    SQL>And if you modify type attribute:
    SQL> alter type reading modify attribute readingvalue number(26,6) cascade;
    Type altered.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(26,6)
    SQL>SY.

  • Reference data types in interface objects?

    How do you create reference data type based on data type in interface object??

    First create the reference DT1 in IR then create a new data type DT2 and if you want to create a reference to DT1 then in  the editor select Type (3rd coloum) as the DT1 which you can get by double click on Type and then you select "search help" and select DT1 from the list.
    Cheer's

Maybe you are looking for

  • Volume level method

    i can't figure out what's wrong with my volumeLevel() method in this code, can anyone please show me what's wrong with it? thanks! class volumes      int currentVolume;      void volumeUp()           if(currentVolume == 5)           System.out.printl

  • Syncing problem

    Okay I don't know if this is an Apple problem or a Windows problem, so I hope this is the right place to post this. I recently (i.e. yesterday) purchased a 32GB 5th generation iPod Touch. When I try syncing music to it (I sync music manually), it syn

  • How to get Project in Projectcenter

    Hello everyone. I want to override a projectcenter page, but do not know to get the project what I see in Projects.aspx  based on psi.

  • LogIn object error

    Hello, I am trying to call a method inside an web application but I have an error. I try/catch this error and the response for StateTrace is at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse r

  • Pointing existing RAC nodes to a fresh Shared Storage discarding old one

    Hi, I have a RAC Setup with the Primary Database on Oracle 10gR2. For this setup, there is a Physical Standby Database Setup (using DataGuard configuration) also with 30min delay. Assume that the "Shared Storage" of the Primary DB fails completely. I