Dealing with DB table-entries in ABAP OO

Hi everybody,
in ABAP-Reports (normally) we have deal a lot with DB table entries.
Is there a "state of the art" for doing this with ABAP OO?
An easy example:
Asuming I want to select table  entries into an
internal table from BUT000.And than I want to write: the entries.
How would this look like in ABAP OO?
show the internal ZTable be my object?
or should every BUT000-Table-record be my object?
Regards Mario
null
Message was edited by:
        Mario Müller

Hello Mario,
A very good question. This is what is called as modeling.
I shall give you an approach into this. There is no right and wrong way of doing it. Probably, only a more desriable or better way !!
How you model it depends on what your object is.
If you have an internal table of sales orders, still in real world the services or methods are on a single sales order. So the object here is a single sales order.
=> I would model the class to deal with one sales order. (this more or less answers your question)
2. Just to take this a little further.
What I would do is have 3 different layers of abstraction.
A UI class, a business layer class and a DB class.
UI class can only talk to business class, business can talk to DB class. And the DB class is a static class.
The UI class is only responsbile to do the display job.
The UI will display multiple sales orders for eg, so u have an internal table of instances to the business layer.
The business layer itself does validation, processing for each sales order.
The business layer can also have soem static methods (or class methods) to select multiple records from Database. This is static, as it is not acting on one sales order, but you are returning multiple. This method should simply call a method of the DB layer.
The DB layer is meant only to read from DB and write to DB.
Hope this helps. Remember to reward points, if it does.
For more highlights into this, refer to some material on design approach or design pattern.
Best Rgds,
Prashanth.
SAP.

Similar Messages

  • Best way to deal with Mutating table exception with Row Level Triggers

    Hello,
    It seems to be that the best way to deal with Mutating Table exception(s) is to have to put all the trigger code in a package & use it in conjunction with a Statement level trigger .
    This sounds quite cumbersome to me . I wonder is there any alternative to dealing with Mutating table exceptions ?
    With Regards

    AskTom has a good article about this,
    http://asktom.oracle.com/tkyte/Mutate/index.html

  • Can ui:table deal with large table?

    I have found h:dataTable can do pagination because it's data source is just a DataModel. But ui:table's datasouce is a data provider which looks some complex and confused.
    I have a large table and I want to load the data on-demand . So I try to implement a provider. But soon I found that the ui:table may be load all data from provider always.
    In TableRowGroup.java, there are many code such as:
    provider.getRowKeys(rowCount, null);
    null will let provider load all data.
    So ui:table can NOT deal with large table!?
    thx.
    fan

    But ui:table just uses TableDataProvider interface.TableData provider is a wrapper for the CachedRowSet
    There are two layers between the UI:Table comonent and the database table: the RowSet layer and the Data Provider layer. The RowSet layer makes the connection to the database, executes the queries, and manages the result set. The Data Provider layer provides a common interface for accessing many types of data, from rowsets, to Array objects, to Enterprise JavaBeans objects.
    Typically, the only time that you work with the RowSet object is when you need to set query parameters. In most other cases, you should use the Data Provider to access and manipulate the data.
    What can a CachedRowSet (or CachedRowSetprovider?)
    do?Check out the API that I pointed you to to see what you can do with a CachedRowSet
    Does the Table cache the data itself?
    Maybe this way is convenient for filter and order?
    Thx.I do not know the answers to these questions.

  • Finding duplicates:Minus set operator in dealing with internal tables

    Dear experts,
    I am newbie to ABAP developement,i have been given an assignment to find the duplicate list of vendors in lfa table.
    Now duplicate list doesnot means that text tokens will be just exact to conclude them as duplicate ,it could also be like
    1111 Vendor ABC
    1222 ABC Vendor
    If anybody has clue ,how to work on such a problem ,plz come forward.
    Right now i just tried initially how to find exact duplicates,i found  on change command,it do works.
    Then i am trying a new way which should just do the same thing.
    I did as per this algorithm
    1.Compute wholesome list in one internal table itab1
    2.Used delete adjacent duplicates in itab2.
    3.I feel itab3=itab1-itab2 will contain all duplicates in itab3.
    Can anyone give me a hint.How can i do A-B ?.

    Hi Arul,
    There is no special aided SET operations upon internal tables in ABAP. Concerning your particular task I would say that you can try INSERT statement for each record in your internal table without preliminary comparing them with DB table. If there is a record in DB table with the same key then sy-subrc after INSERT will be non zero (actually 4) and no real insert would occur. So, only those records would be inserted which have no counterpart in DB table.
    Best regards, Sergei

  • Dealing with Denormalized Tables - jdev 11.1.2.3 redhat 5.8

    Hello:
    In a Legacy oracle system, we have many tables that are not in 3rd normal form. i.e. they are denormalized.
    Example: A student has many teachers and a teacher has many students... a classic many-to-many. The normal solution would be to create an association table to hold the intersection.
    However in a legacy system, we have the student table that has columns of teacher1, teacher2, teacher 3, teacher4, teacher5, teacher6, teacher7 and no association table.
    Without modifying the table structures, what is the best way to deal with this in a ADF application. My guess would be to create 7 view links and write code to implement
    any logical rules.
    Does anyone have other ways around this problem?
    Thanks for the help.

    Hi,
    how about using a database view
    e.g.
    select student_id, teacher1 from your_table
    UNION
    select student_id, teacher2 from your_table
    UNION
    select student_id, teacher3 from your_table
    Create an entity and view object based on the database view. If you need teachers to be updateable, create stored procedures and override the entity object doDML method for insert/update/delete
    Frank

  • F4 Help with text table in WD abap

    Hi,
    i am using country related input help with check table T005 in one of table and i want to display the country text along with country id in my table, f4 for country is coming however if i select country from f4 it showing country id in the input field of table.
    i want to have country text also in one of my input fields in the table, i have seen f4 help works if we have explicit search help and using parameter assignment we can have id and text defaulted if we use same context for id and text fields,  however in this case country table t005 has check table t005 where texts are stored in text table t005t so web dynpro abap is't picking up the texts??
    please suggest how can i get the texts as soon as i select country in the f4??

    Hi Kranthi,
    You merely have to have an internal table storing list of countries, which you only need to do once, e.g. on load of application (method WDDOINIT of COMPONENTCONTROLLER). In your view, you have to declare a method for event onEnter of the input field, but this method doesn't have to have any code. Your code will be in method WDDOBEFOREACTION, where you read get country name from country key. Once you've got country name, transfer value to a context attribute to which you've already mapped as a source for attribute value of the UI element.
    Check out SAP Webdynpro component FITV_IMG_DEFHTLCATA -> view V_ITEM.

  • XSU: Dealing with large tables / large XML files

    Hi,
    I'm trying to generate a XML file from a "large" table (about 7 million lines, 512Mbytes of storage) by means of XSU. I get into "java.lang.OutOfMemoryError" even after raising the heap size up to 1 Gbyte (option -Xmx1024m of the java cmd line).
    For the moment, I'm involved in an evaluation process. But in a near future, our applications are likely to deal with large amount of XML data, (typically hundreds of Mbytes of storage, which means possibly Gbytes of XML code), both in updating/inserting data and producing XML streams from existing data in relationnal DB.
    Any ideas about memory issues regarding XSU? Should we consider to use XMLType instead of "classical" relational tables loaded/unloaded by means of XSU?
    Any hint appreciated.
    Regards,
    /Hervi QUENIVET
    P.S. our environment is Linux red hat 7.3 and Oracle 9.2.0.1 server

    Hi,
    I'm trying to generate a XML file from a "large" table (about 7 million lines, 512Mbytes of storage) by means of XSU. I get into "java.lang.OutOfMemoryError" even after raising the heap size up to 1 Gbyte (option -Xmx1024m of the java cmd line).
    For the moment, I'm involved in an evaluation process. But in a near future, our applications are likely to deal with large amount of XML data, (typically hundreds of Mbytes of storage, which means possibly Gbytes of XML code), both in updating/inserting data and producing XML streams from existing data in relationnal DB.
    Any ideas about memory issues regarding XSU? Should we consider to use XMLType instead of "classical" relational tables loaded/unloaded by means of XSU?
    Any hint appreciated.
    Regards,
    /Hervi QUENIVET
    P.S. our environment is Linux red hat 7.3 and Oracle 9.2.0.1 server Try to split the XML before you process it. You can take look into XMLDocumentSplitter explained in Building Oracle XML Applications Book By Steven Meunch.
    The other alternative is write your own SAX handler and send the chuncks of XML for insert

  • How to deal with Join Table in SAP Query

    Hi buddy,
    I create a Infoset ZTest by some infotype, one of them is 0185, and 3208.
    In 0185 there is a ICTYP and 3208 also SUBTY, and they are Join by that fields.
    It means, add a new record in P0185 with ICTYP = 'RS', there is a new record add in P3208 automaticly.
    Now, in my SAPQuery, I just need to input a ICTYP, and select the result. It always have unnessary records in output.
    Fg.  in P0185 have two records, ICTYP are 'RS', 'FR', so, in P3208 also have.
    And input 'RS' as input selction paramters, it check the records which ICYTP is RS in P0185, but it won't do the check in P3208, because, in selction screen, it just have P0185-ICTYP.
    So, the output will have problem.
    I want to know how to fix this issue, or add some extra code in the SAPQuery....
    Really thanks .

    hi,
    The pdf below gives the steps to create drill down report.
    http://www.sappoint.com/abap/eis.pdf
    also check.
    <a href="http://72.14.203.104/search?q=cache:k-SFYy_rjPIJ:www.hrexpertonline.com/archive/Volume%252003%2520(2">http://72.14.203.104/search?q=cache:k-SFYy_rjPIJ:www.hrexpertonline.com/archive/Volume%252003%2520(2</a>
    regs,
    jaga

  • How to deal with two tables in the Data Base

    Hi Experts,
    IF WE WANT TO GET THE DATA FROM THE TWO TABLES, WHAT QUERY SQL STATEMNET SHOULD HAVE TO WRITE AND ANY CONFIGURATION CHANGES NEED TO BE DONE AND WHAT SETTINGS NEED TO BE DONE IN THE ESR .
    PLEASE EXPLAIN ME ON THIS .
    THANKS IN ADVANCE.
    RAM

    If you are using the same database and referencing two tables then you dont need special configuration for it. You use single jdbc adapter. In ESR you create two statment structure one for each table. This is one option. The second option is use join statment and write query and in this case one statment data structure.
    Please go through the help sap link for the jdbc document structure.
    http://help.sap.com/SAPHELP_NW04s/helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm
    The second option can be done using the below structure.
    <StatementName>
    <anyName action=u201D SQL_QUERYu201D >
    <access>SQL-String with optional placeholder(s)</access>
    <key>
      <placeholder1>value1</placeholder1>
      <placeholder2>value2<placeholder2>
    </key>
    </anyName > 
    </StatementName>

  • JComboBox can't deal with multiple identical entries??

    Hi,
    I set up a swing application that displays data from an Oracle source in some Swing components like JComboBox, JList, ..
    One row from the data of my CachedRowSet is displayed using the model and selectedmodel properties in a JComboBox. It is displayed correctly, but look at this data:
    myValue_1
    myValue_1
    myValue_2
    The SelectedIndex property is set to the same value for the first entries!! This way I can't find out what entry the user selected. (additionally: since the RowSet and JComboBox are connected via a model, the 'cursor' of the RowSet moves when a different entry is selected in the swing component. But the RowSet method getRow also returns the same value when selecting one of the two first lines above...).
    If I'm not using the model interface to populate the ComboBox, it fails (**not sure whether this is the same problem here!!**).
    Any ideas?
    Buck M.

    DrClap> pretty strange design
    The idea was to split up information from an object (in this case my resultset or RowSet from a database) and display the information in different display/input fields of my form. There would be a unique field 'id', but the 'name' field is user defined and could be identical if the user wishes to.
    I just tested filling the ComboBox with .add("Test") statements (no RowSet) or with String-objects. Same thing happens!
    I thought the ComboBox would store and use (e.g. in SelectedIndex() ) the position of the selected item in the list, but obviously it seems to be the value?!?
    I will use a combined 'name'+'id' entry in the ComboBox now. Still interesting....

  • Best data component to deal with mysql table

    Hi.
    I have an LMS (learning management system) with a lot of info in a mysql dbb with a few tables.I also use a lot of php.
    I was told flash data components aren't the best in the world so what should I do?
    Somebosy mentioned that I should use Flex data components as they were built for this sort of thing and are a lot more powerful. So where do I get one of those for ie: do I have to download anything as I only have Flash Cs5.5. Then how do I get that component into flash?
    Or would it be better to use a third party plugin for displaying tables. Somebody mentioned that excel and its pivot tables are amazing and simple.
    At the end of the day I also want clients to be able to see a dashboard.

    I am looking into various methods.
    Excel has a powerful pivot table which is amazing for tables, graphs etc... in a few drags with no programming.
    My brother uses it in Lloyds bank for number crunching millions of rows so it's even more than I need.
    I don't know of anybody mentioning excel if they use flex ie: maybe I am mixing both worlds. I will look into flex data components as there are tuts on lynda.com and using mxml. Basically a knowledgeable prgm told me I have to know at least as much as the programmer that I subcontract to. Therefore I have been reading my butt off. I am very weak on databases so that's my next field of research.
    THANKS.

  • ASA 5505 Logging Issue - Warning: Configured logging host interface conflicts with route table entry

    I am getting this warning on my ASA 5505 when I try to set up logging from my off site FW to the central FW, which is a 5510. What I am trying to do is send the FW logs through the VPN Tunnel into the central 5510 to our logging server at 192.168.22.99, but allow all other traffic out the outside interface so customers can hit our web servers down there. Here is an example of my config with fake IP's. I get this error when trying to do "logging inside host 192.168.22.99". If I try to put in "logging Tunnel host 192.168.22.99" I get the "Warning:Security Level is 1" message
    5505
    ethe0/0
    desc To LA ISP (217.34.122.1)
    switchport access vlan2
    ethe0/1
    desc To Redwood City HQ via VPN Tunnel
    switchport access vlan1
    ethe0/2
    desc To Internal Web Server
    switchport access vlan3
    VLAN1
    desc Tunnel to HQ
    ifinterface Tunnel
    security level 1
    217.34.122.3 255.255.255.248
    VLAN3
    desc Internal Web Server
    ifinterface inside
    security level 100
    192.168.0.1 255.255.255.0
    access-list LosAngeles extended permit ip 192.168.0.0 255.255.255.0 192.168.22.0 255.255.255.0
    (No access-group is performed, as I match from the crypto map instead since I have multiple sites going out of HQ - see HQ configs)
    route Tunnel 192.168.22.0 255.255.255.0 65.29.211.198
    crypto map TO-HQ 10 match address LosAngeles
    crypto map TO-HQ set peer ip 65.29.211.198
    5510 at HQ
    access-list LA extended permit ip 192.168.22.0 255.255.255.0 192.168.0.0 255.255.255.0
    (again no access-group, since I have a couple other off sites)
    crypto map TO-LA 20 match address LA
    crypto map TO-LA 20 set peer ip 217.34.122.3

    Hi Jouni,
    I have the following configs in place with fake IPs
    5505
    1 outside interface with security level 0 (vlan1 direct connect to isp 217.33.122.2/30) - goes to ISP
    1 Tunnel interface with security level 1 (vlan 2 direct connect to isp 217.33.122.6/30) - goes to Tunnel to our 5510
    1 inside interface with security level 100 (servers connected to hub, with vlan3 ip of 192.168.0.1)
    access-list LosAngeles extended permit ip 192.168.0.0 255.255.255.0 192.168.22.0 255.255.255.0 - acl to 5510 inside network
    route outside 0.0.0.0 0.0.0.0 217.33.122.1 - route for all traffic (except for 192.168.22.0/24) to take the outside connection
    route Tunnel 192.168.22.0 255.255.255.0 65.29.211.198 - route for 192.168.22.0 destined traffic to take the Tunnel connection
    crypto map  TO-HQ 10 match address LosAngeles
    crypto map TO-HQ 10 set peer ip 65.29.211.198
    tunnel-group 65.29.211.198 type ipsec-l2l
    5510
    1 outside interface with security level 0 (vlan1 direct connect to isp 65.29.211.198) - goes to isp
    1 inside interface with security level 100 (vlan2 connection to corporate servers and SIP 192.168.22.0/24)
    access-list LA extended permit ip 192.168.22.0 255.255.255.0 192.168.0.0 255.255.255.0
    access-list OUTBOUND extended permit icmp host 217.33.122.6 host 192.168.22.99 (allows Nagios monitor to ping the DE interface
    access-group OUTBOUND in interface outside
    nat (inside,outside) static 192.168.22.99 interface destination static 217.33.122.6
    route outside 192.168.0.0 255.255.255.0 217.33.122.6
    crypto map TO-LA 20 match address LA
    crypto map TO-LA 20 set peer ip 217.33.122.6
    tunnel-group 217.33.122.6 type ipsec-l2l
    I am mistaken on the 5510 interfaces. They do not have vlans, and the IP address is directly applied to the interfaces for outside and inside.

  • Function module to find table entries associated with transport request

    Hi all,
       I have requirement, like we have created a table and maintenance view for that table - and made entries in that table.
       now we want to know all the entries made in the table are associated with transport request or not.
      how to do it programmatically?? is there any function module which gives the result for transport object associated with the table entries ?????
    Thanks
    Sathish

    Hi,
    Use the table <b>E071K</b>
    in se16 give :
    request number in TRKORR
    Table name in OBJNAME
    in the filed TABKEY u will get the <b>values of the key fields</b> in the table
    by comparing the key fields u can find out the enrties related to the request number
    Please let me know if i am not clear
    ---Patil
    Message was edited by:
            Santhosh Patil
    null

  • WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???

    At Rich H's suggestion, I'm posting this here as well as in the blogs.
    Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) Call this node "NODE_WITH_TABLE."
    You now define a recursion node underneath "NODE_WITH_TABLE" and specify "NODE_WITH_TABLE" as the repeated node for this recursion node. Call this recurion node "RECURSION_NODE".
    Lo and behold - the table fills properly when you're on any instance of "NODE_WITH_TABLE", but not when you're on an instance of "RECURSION_NODE".
    I'm hoping that:
    a) I'm doing something wrong;
    OR
    b) There's an easy work-around/alternative I'm not seeing
    OR
    c) SAP will give recursion nodes enough memory to carry any table(s) embedded in the nodes they're repeating.
    'Cause I sure don't want to have to define "n" levels of tree-nodes that have different copies of the same table(s) embedded in them.
    Message was edited by: Armin Reichert

    /people/david.halitsky/blog/2006/08/16/recursion-nodes-that-repeat-tree-nodes-with-embedded-tables-in-wd-abap-not
    Maybe you might want to back out your weblog as it is not really a place to ask these types of questions.  Think of it this way,  if you are allowed to do this type of weblog,  what is stopping any other weblogger.  Hence the weblogs would just be another forum, which I don't think anyone wants. 
    Regards,
    Rich Heilman

  • How to transport a Deleted Table entry

    is there a way of transporting deletions of table entries.
    For example. I'm dealing with a table say such as T529U. So we already have value there for active, inactive, retiree, withdrawn. Say I wanted to delete retiree from the selection list.
    I go to our DEV and make the deletion. I manually create a transport of the entire table and transport it to our QA system. When I do so, the table still remains the same. The only way the record would be changed would be if it was new or had the same key (thus overwriting). How do you remove and transport (so you don't have to do it in all instances).
    any help would be much appreciated.
    Thanks

    Hello
    A delete should be a change just like any other change and should be recorded on a change request.  After releasing the change request you should be able to transport that delete to your QA and PRD systems as needed.
    As a general rule I would not transport the complete table.  There is too much risk that unintended changes get transported. 
    Are other changes to your table being recorded on a transport request?
    If you have another environment(sandbox or project?)  try the delete in that environment to convince yourself that it does(or does not )work.
    Regards
    Greg Kern

Maybe you are looking for

  • Adding font to use in Acrobat X Pro forms

    In Acrobat X Pro (on Mac OS) I have created a form text box. I have the font I want to use in the text box on my system, but it is not listed in the drop down list in the appearance tab of the box properties. How can I get  to use this font? Thanks!

  • EJB environment question (static helper classes)

    We're using JBoss as AS containing several stateless session beans. Now, we have certain helper classes that are abstract and contain static methods. Is this a problem for the EJBs? All of them use these helper classes all over their methods. Are the

  • Need to reinstall carbon copy in new disk format...

    I want to reinstall Tiger on my eMac and keep all my settings and files. The only thing I need to change is that I formatted the drive in the Unix format because I thought it was the preferred standard. Oops. I have .mac but no other back up software

  • Pls help me.......pls... Cannot able to open the f...

    Dear friends I've Nokia 500 mobile and I want to open the following site in the Nokia default browser but I cannot able to open, means after loading period it displays a blank page the site addressis "https://inet.idbibank.co.in". Thanking you in adv

  • IPhone 3G OS 3.1.2 New Network Problems

    Ever since I upgraded my iPhone 3G to OS 3.1.2, the phone has network and reception issues. The phone goes into "searching" mode at random times and won't come out of it unless I either reboot, or turn on airplane mode and off to connect back to my c