DAO pattern Value Objects and Data Streams

Suppose we have a PersonVO (java bean) with simple attributes i.e. first and last name then the DAO is quite simple and clients of the DAO layer pass VO back and forth (really cleanly).
But it is a different story if a person has a picture. If the picture is small then we
could define a field that is simple an array of bytes i.e. byte pic[], and would work ,
but will not scale if our pic becomes too large or there are lots of persons.
How can streams be used in this case ? (without dao code leaking into the client layer) and does this break the DAO pattern ?

I can picture not saving the image bytes themselves
but a link to a JPG or GIF on the file system.And how would that be guarenteed on a cluster? Or even per OS?
Putting streams into a database like that can choke
performance. Can't do WHERE clauses on byte
streams.For example in PostgreSQL:
CREATE TABLE images (
  name VARCHAR(32) NOT NULL,
  image bytea NOT NULL,
  imagetype VARCHAR(4),
  CONSTRAINT image_pk PRIMARY KEY (name)
);After retrieving the image into a byte[] you can either
- directly serve it to the client (browser) over HTTP through a servlet
(don't forget to set your content type through HttpServletResponse.setContentType())
- convert the byte[] to a java.awt.image.BufferedImage using javax.imageio.ImageIO.read(byte[]), and ofcourse do everything you want (including transformations) from there.
- What ever you can think off.
Now if you're passing that VO to a JSP, the link to
the image on the server file system fits nicely into
the <img> tag and Bob's your uncle.But this will still not be guarenteed to work on a cluster, across platforms, etc.
10 % 0
java.lang.ArithmeticException: / by zero;-)

Similar Messages

  • Passing serialized object and data as byte stream over same stream

    I am writing a chat program, I am keeping online user List as Vector A would like to pass online user List to client as Vector object also the client message is sended as byte stream. Is it possible to pass object and data as byte stream over the same stream.

    I am writing a chat program, I am keeping online user
    List as Vector A would like to pass online user List
    to client as Vector object also the client message is
    sended as byte stream. Is it possible to pass object
    and data as byte stream over the same stream.Why are you sending the client message as a byte stream?
    String seems a much more logical type. I would assume that you're reading strings from one client, and printing them on the others. If you translate to bytes in the middle, you're going to have to ensure that you decode those streams correctly on the other side.
    And if I were implementing this, I probably wouldn't send the raw Vector or List ... instead, I'd create a Message object, which wraps the Vector/String, and a MessageDispatcher interface, which the client implements to handle incoming messages.

  • Clone schema with current db objects and data.

    Hi Cloud expert,
    I need feature to clone existing schema and create new schema with schema as a service. I created profile that export schema with database objects and data. I created template that use the profile created. While provisioning the template I found all the database objects with template. Now I need a solution to clone the current schema with all the objects at current time. The way I tried contains all the objects that were exists while exporting the schema. I need the solution to clone schema so that it will contains all the objects and data right now.
    While reading document I found snapclone but that is not the exactly the solution I need. I simply need to clone schema with latest db object and data with Self Service portal.
    Thank You in advance.
    Dilli R. Maharjan

    One option is to run BACKUP/RESTORE, once you have restored you run:
    SELECT 'ALTER TABLE ' + quotename(s.name) + '.' + quotename(o.name) +
           ' DISABLE TRIGGER ALL '
    FROM   sys.schemas s
    JOIN   sys.objects o ON o.schema_id = s.schema_id
    WHERE  o.type = 'U'
      AND  EXISTS (SELECT *
                   FROM   sys.triggers tr
                   WHERE  tr.parent_id = o.object_id)
    Copy result and paste into a query window do to run. Next:
    SELECT 'DELETE ' + quotename(s.name) + '.' + quotename(o.name)
    FROM   sys.schemas s
    JOIN   sys.objects o ON o.schema_id = s.schema_id
    WHERE  o.type = 'U'
    Run this result until you don't get any more errors.
    Run the first query again, but change DISABLE to ENABLE.
    This is more long-winding than scripting, particularly if you have lots of data. But you know that you will not make any changes whatsoever to the schema.
    The scripting in SSMS generally does it right, I believe, but some items are not scripted by default. If you run BACKUP/RESTORE, you know that you get a faithful copy.
    Of course, the best way is to keep your code under version control and take the version control system as your ultimate truth.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Business Objects, Value Objects and more

    Hey,
    I've got a general question about business objects (aka entity objects or data transfer objects). The scenario I am using is not one of my own, but it might be a future one. Thus, I'd really appreciate all feedback.
    Let's say that i've got a desktop application which purpose is to manage personal DVD collections. Shortly explained, what i would do here is to create a class Dvd to represent a physical DVD. Then i would create the classes DvdServices and DvdDao. The DvdServices class is what my application will use to retrive and store Dvd instances, and takes care of all session and transaction handling. The DvdDao class is where all database communication takes place. This class will only be used by the DvdServices class.
    Now, say that i would want to keep things simple and use the same business object both in the front end and the back end (yes, i'm using Hibernate). That is, the Dvd instances returned by the DvdServices class is the ones i also would like to use in my GUI. This is where i start to get a little uncertain about best practice.
    Let us say that i use an instance of a Dvd to present some information about a dvd to the user. However, the user would not only like to see what's already stored about that dvd - but also edit some details related to it (such as the title, description or the like). What i would do here (to support editing), is to modify the Dvd class so that it holds a DvdAttributes object which contains all its editable values like title and description (in other words, the state - except for the id and a timestamp value). Thus, i also modify the DvdServices class and create a method called updateDvd(Dvd dvd, DvdAttributes attributes). The method updateDvd() in the DvdServices class, internally, makes a reference to the existing DvdAttributes, applies the new DvdAttributes to the Dvd instance, and tries to save it. If something goes wrong, transaction is rolled back, and the old DvdAttributes are applied to the Dvd class in order to reflect the state of the Dvd instance.I like to think of the Dvd instance as the business object, and the DvdAttributes instance as a related value object (the terminology is probably all wrong here?).
    My question regarding all this is wether it "adheres" to what one might consider as "best practices" (if something like that exists in relation to this)? Could i do things smarter in this case? Is there something which does not make sense (always good to hear a second opinion!).
    All feedback appreciated!

    sbrattla wrote:
    Hey,
    I've got a general question about business objects (aka entity objects or data transfer objects). The scenario I am using is not one of my own, but it might be a future one. Thus, I'd really appreciate all feedback.
    I don't believe a DTO would ever be considered a business object.
    Let's say that i've got a desktop application which purpose is to manage personal DVD collections. Shortly explained, what i would do here is to create a class Dvd to represent a physical DVD. Then i would create the classes DvdServices and DvdDao. The DvdServices class is what my application will use to retrive and store Dvd instances, and takes care of all session and transaction handling. The DvdDao class is where all database communication takes place. This class will only be used by the DvdServices class.
    Now, say that i would want to keep things simple and use the same business object both in the front end and the back end (yes, i'm using Hibernate). That is, the Dvd instances returned by the DvdServices class is the ones i also would like to use in my GUI. This is where i start to get a little uncertain about best practice.
    It appears that 'Dvd' is in fact a DTO. Probably best to name it as such - DvdDto.
    Let us say that i use an instance of a Dvd to present some information about a dvd to the user. However, the user would not only like to see what's already stored about that dvd - but also edit some details related to it (such as the title, description or the like). What i would do here (to support editing), is to modify the Dvd class so that it holds a DvdAttributes object which contains all its editable values like title and description (in other words, the state - except for the id and a timestamp value). Thus, i also modify the DvdServices class and create a method called updateDvd(Dvd dvd, DvdAttributes attributes). The method updateDvd() in the DvdServices class, internally, makes a reference to the existing DvdAttributes, applies the new DvdAttributes to the Dvd instance, and tries to save it. If something goes wrong, transaction is rolled back, and the old DvdAttributes are applied to the Dvd class in order to reflect the state of the Dvd instance.I like to think of the Dvd instance as the business object, and the DvdAttributes instance as a related value object (the terminology is probably all wrong here?).
    As stated no.
    Process flow would normally be like this.
    Happy path (it worked)
    1. Query - returns DvdDto
    2. GUI - display DvdDto
    3. Modify DvdDto
    4. Update (send to server/backend) DvdDto
    5. (Return - It worked.)
    Sad path (it failed)
    1. Query - returns DvdDto
    2. GUI - display DvdDto
    3. Modify DvdDto
    4. Update (send to server/backend) DvdDto
    5. Exception is thrown
    6. (Return - It failed)
    Step 6 is a bit ambigous because it depends on the user and the actual client/server relationship. It could be an exception, a message or just true/false (false is failed.)
    In the above there is no step that corrects or alters the DvdDto instance that was thrown. One reason for this is that it might be a minot mistake on the users part and if you destroy everything they alread typed in they are not going to be happy.

  • Copying database objects and data from one server database to another server database in AG group

    Hi,
    I am still trying to wrap my head around sql clusters and AGs and I have a project that requires I take a vendor's database and restore it weekly so its available on the production server which is clustered.
    The vendor's database on the cluster is in an AG group and encrypted.
    Right now, I plan to restore the database on a sql staging server and use the SSIS Transfer SQL Server Objects Task to copy the table structure and data from Stage to the Production database of same name and I would first drop the objects in production
    database using the same task.
    I am concerned that this might cause issues with the passive cluster due to "logging" from active to passive. The database is about 260 MBs and I am not sure how many tables.
    Has anyone run into this type of scenario before or have a better solution?
    Thanks
    Sue

    IF I understand anything about clustered sql and logging, the sql server should take the log file and recreate the same scenario on the passive side of the cluster.
    Is that correct?
    Hi Sue,
    Yes, for AlwaysOn Availability Group, the transaction log is basically replayed from the primary to all of the secondary's.
    Besides, from my point of view, as we cannot directly restore a database that is part of an Availability Group, it is a good way using SSIS task to drop and recreate all tables then transfer data from the restored database to the primary replica. Schema changes
    and data changes will also happen on the secondary  replica.
    There are some similar links for your reference.
    http://dba.stackexchange.com/questions/21404/do-schema-changes-break-sql-server-2012-alwayson-or-are-they-handled-transpare
    http://blogs.msdn.com/b/sqlgardner/archive/2012/08/28/sql-2012-alwayson-and-backups-part-3-restore.aspx
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Authorization Issue with Custom Pending Value Object and Anonymous Users

    Hi,
    I am just converting my demo from version 7.1 to 7.2. I am not doing upgrade. The demo uses a custom pending value object USER_REQUEST. The idea is that new employee goes to Java AS as anonymous user and enters her details and store where she will work. After submitting request there is an approval process using custom entry type USER_REQUEST. If the request is approved then IdM converts USER_REQUEST into MX_PERSON entry. This works nice in 7.1 but I am having problems with replicating this in 7.2. I created new UI task accessible by anonymous that creates new USER_REQUEST entry. I also assigned role idm.anonymous with UME action idm_anonymous to UME built in group Anonymous users.
    My problem is with the field STORE. This field is a reference field to another custom entry type STORE (this entry type will be used in context based assignment). Every new employee must selects a store where she will work. The problem is when user clicks on button "Select". Web dynpro terminates and returns authorization error. I also tested this with entry type MX_ROLE. I added attribute MXREF_MX_ROLE and same issue. So it seems that just assigning UME action idm_anonymous is not enough to list objects from identity store. I found a workaround for this issue. When I assign also UME action idm_authenticated to Anonymous users then it does not dump and I get a pop up window where I can search for store. It does not seem right to assign idm_authenticated to anonymous users.
    Another issue is with display task for entry type USER_REQUEST. I assigned a display task to entry STORE and I set that Anonymous have access to this task in Access control tab. I assigned default value to the field store. So when a user opens page she can see a hyper link to display already assigned store. When user clicks on this hyper link it opens a new pop up window and user must authenticate against Java AS. After successful authentication the display task for entry STORE is displayed. I would assume that anonymous user can display it without authentication.
    So to me it seems like authorization checks have been changed in 7.2 versions and are more strict for anonymous tasks. Hence my question is how can I implement my scenario. Am I missing some configuration or what's the proper solution to my two issues? I don't count assigning idm_authenticated to Anonymous users as a solution. This workaround does not solve my second issue.
    Thanks

    Some of the folks from Trondheim labs check, but rather infrequently.  There's another person who I guess is in consulting that also checks from time to time.
    Sorry I can't help you with your main question...
    Matt

  • Search script generator for all objects and data (!) from a user/schema ?

    Is there a way to create a script which (when run) creates all the existing
    TABLES; INDEXES, KEYS and DATA for a specified user/schema ?
    This (PL-)SQL script should contain all INSERTS for the currently existing rows of
    all the TABLEs.
    When I use e.g. export to Dumpfile I have at first find all TABLEs and components
    which I want to dump. This is rather uncomfortable.
    I just want to specify the user name similar to
    createscript user=karl@XE outfile=D:\mydata\myscript.sql
    Is this somehow possible ?

    So that I understand your requirements exactly, are you asking for your script to ...
    1/ export from database A the entire schema of a specified user
    2/ drop all objects owned by that user in database B
    3/ import the objects from database A into database B
    If so, it sounds to me that a shell script that does a schema level export as Nicholas suggested, and then drops the user from database B using the cascade keyword (e.g. drop user username cascade), recreates the user and then imports the export file into B should do the trick.
    I don't think searching for individual tables and creating the statements to recreate them is the best idea.
    Hope that helps
    Graham

  • Business Objects and Data Services on VMWare

    My company has a requirement to deploy Business Objects 4.0 as well as Data Services.
    We are going to be deploying them on Windows Server 2008 R2, hosted on a VMWare cluster.  I have reviewed the PAM, but my question is:
    Will these run using SQL Server 2008 R2 as a database? I see "SQL Server 2008" and I am just curious whether R2 is also supported?
    Thanks.

    Hi,
    SQL Server 2008 R2 is listed in the PAM for DS as Repo DB. For BI4 it is also working and supported. I installed it already on it.
    Regards
    -Seb.

  • MSS Object and data provider Important

    Dear All,
             I have a requirement of changing the list of data that is displaying on the general information of the Manager iview.
    The manager should look the Org unit till depth 3. But we have a standard rule for setting it till org unit 2(MSS_TMV_RULE3).
    So i copied the standard and changed the rule with the depth till 3.  and attached that to the object selection MSS_TMV_EE_ORG1. But it is not working do i need to do some other customizing change in that.
    Please help me to solve this issue.....
    Thanks
    Yogesh

    hi
    if you have made a new view , the new view should be mentioned in the ivew property  in the eportal .
    This should help.
    Regards
    sameer.

  • MSS - Object and data provider

    Hi,
    had questions regarding the view groups in the OADP. first, the employee selection for Personnel change request is based on view group MSS_PCR_SELECT. This view group has views which in turn have root , navigation and target selections. due to which the manager logging in can see/navigate through the employees based on their org units etc.
       Now for approving time ( direct link "approve timesheet data") , we used the standard view group MSS_LCA_EE. The views assigned here do not have a naviagtion object , due to which the manager is able to see all the employees listed at once, we created a custom view group based on the std one , added a navation object so that the manager can click on the org units (just like for selecting employees for PCR) and based on that the employees are displayed and then their time can be approved. Somehow this does not seem to work. It displays the whole list of employees. IT seems its just not taking that navigation object. Anyone tried achieving the same functionality ??
    We are on ERP 2005 , MSS BP 1.0.

    Hi Mark -
    I am trying to do something similar and not having much luck..  I am trying to change the main Team Viewer on the employee General Information change.  My client has a requirement where they do not want to use the manager (012) as the MSS user.  The have lower level supervisors identified that link S to S (using 002).  I created new eval paths for the root and navigation/target objects.  I test them via transaction PPST and they return expected results.  I created new rules and associated the eval paths, created new view, org view, etc.  Then I went to the Employee Search (Team Viewer) iVew and changed the parameter to switch out my new org grp view.   It does not work.  In MSS, I get the message "no employees found."
    The parameters (OADP) objects I switched out were:
    View Grp = MSS_TMV_EE
    View = MSS_TMV_EE_ORG1
    I am also on ERP 2005 , MSS BP 1.0
    If you got your issue fixed and can share anything that will help my issue I would greatly appreciate it.
    Regards,
    Karen

  • Bindable objects killing data stream

    hi all,
    I was building a test application and came across seom very
    weird behaviour. In a nutshell, it's a simple MXML application with
    two TextAreas. It invokes an ActionScript class which starts an
    XMLSocket and connects to a server and processes data (non-XML
    data, but that's not the issue, it's coming down fine). The
    TextAreas are used to display stuff sent to the socket, and stuff
    received from the socket. The code for the ActionScript class is
    not much more complex than the XMLSocketExample class in the
    documentation.
    There is an intermediate class, the "handler" class, which
    the MXML calls with:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:feedHandler="feedHandler.*">
    <feedHandler:FeedTestHandler id="myFeed"/>
    the handler invokes the Feed class which creates the
    XMLSocket as mentioned above, and has hooks in its onData() and
    send() functions back to the handler. The handler functions simply
    append the new messages to two variables, and these variables are
    bound to the text values of the TextArea fields as so:
    <mx:TextArea y="170" left="10" right="10" height="100"
    id="ReceivedFromFeed" text="{myFeed.receiveFromFeedBind}"/>
    Now, everything works okay at first, the connection is made,
    the textAreas are populated, however, after receiving about 20
    messages, it then stops processing - onData claims no more messages
    are coming in. No disconnection, no error, it just stops. However,
    if i comment out the one bit of this method in the handler:
    public function receiveFromFeed(s:String):void
    receiveFromFeedBind += s;
    which obviously changes the contents bound variable, which
    should trigger the TextArea above to update, the the data comes in
    down the socket indefinitely. So when it's updating the bound
    variable, the thing eventually stops processing, but when it
    doesn't update the bound variable, it doesn't get interrupted!
    Help? This is really weird and making me think I'm missing
    something about how to treat binding variables, I hope someone has
    some suggestions!
    Thanks in advance,
    David

    hi peterent,
    it's a bindable public string. the funny thing is like i
    said, if i bind it in the function, it works for about the first 20
    messages received then stops receiving (or at least processing)
    messages, it's not like it fails completely. whereas if i don't
    bind it, it keeps processing messages indefinitely (though of
    course doesn't display anything, i just see it in trace)
    david

  • Customizing Settings for the Object and Data Provider

    Dear All,
    I am trying to create a view for my manager to view ONLY their direct report employees (relationship A002).
    Anyone knows what is the organization view that i need to use or which evaluation path that i an use?
    Thanks.
    Regards,
    Bryan

    Hi Bryan,
    Please use this function module to given the list of direct reporting employee for the org level HRWPC_GET_DIREPS_OF_LEVEL_1 the format is O-S-P.
    This will list the employees who are direct reporting to the manager.
    Thanks & Regards,
    Ganesh R K

  • 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

  • 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

  • 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

Maybe you are looking for

  • Using BAPI_DOCOUMENT_CREATE2 func. in Business Connector without SAPGUI.

    We're using "BAPI_DOCUMENT_CREATE2" function to upload XML data to SAP system in Business Connector 4.7 We use SAPGUI in Business Connector to call the BAPI function. But we found that there's a performance problem when using SAPGUI. So, we want to u

  • ADOBE Reader, Digital Editions, and nook

    Hi, I do not know if I even am at the right place or not, so if not, then I apologize. Maybe you could direct me to the right place? I just purchased an ebook that will open on my computer with adobe reader but not digital editions. I want to transfe

  • Charge/Power on loop

    My iPod won't charge. I plug it into my Mac and it shows the battery-charging icon and then it tries to turn on and shows the main Power-On screen and then "turns off" and goes back to the battery-charging icon. It loops like this forever. I left it

  • Export song library to PDF document Mac vs Windows

    I have used iTunes under OSX and Windows and a feature that I cannot find under OSX is the ability to export my whole song library to a PDF document. In Windows I did this and it automatically created a PDF document nicely formatted with the album co

  • Mplayer and multiptle simultaneous video streams through xv

    While I was using nvidia drivers a while back, I could playback multiple simultaneous video streams through xv in mplayer without any problem. After recent change of video card and consequential move to open source radeon drivers, I've observed that