‎2008 May 03 7:35 AM
Hi,
I don't know about logical database...Please explain abt logical data base...and for what purpose its created?...how to create that and tcode for that.....
‎2008 May 03 7:37 AM
hi,
just type it in the search coloumn and u will get all the doubts clear.
‎2008 May 03 7:37 AM
hi,
just type it in the search coloumn and u will get all the doubts clear.
‎2008 May 03 7:39 AM
Hi,
SAP comes loaded with all the extras. Among the extras that are most helpful to IT managers are all the access routines needed to pull any business object that managers can think of out of SAP databases. However, SAP has not thought of everything where your particular applications are concerned. SAP organizes its standard database tables to service business units based on conventional business applications. Its likely your business requires something new, perhaps even something exotic. In that case, you will need to create a new database, using information from different places. Basically, you need a logical database. You need to create a virtual business data object repository consisting of a new kind of record or table that suits your purposes. In addition, the repository should be composed of information that is actually stored in a number of different locations, none of them necessarily logically associated with one another. Lets take a closer look at creating logical databases.
A case for a logical database
Suppose my company manufactures widgets of the most obscure variety, and they are components of other widgets. I sell my widgets as raw material for the more sophisticated widgets built by others, but in some cases I actually partner with other manufacturers in creating yet another class of widget. Now, in my world, I consequently have customers who are also partners. I sell to them and I partner with them in manufacturing and distribution. Also, I need an application that uses both of these dual-use relationships.
Essentially, I have a customer database and a partner database. Neither contains records that are structured to contain the identifying particulars of the other. Thus, I need a hybrid database that gives me tables detailing these hybrid relationships. What can I do? I can go the long way around and write a new database, pulling information from both and creating new objects with a customized program that I write by hand. However, this process is cumbersome and contains maintenance issues. On the other hand, I can use SAPs logical database facility, create my logical database in a couple of minutes, and have no maintenance issues at all.
Logical database structures
There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
Database access programming: Once youve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
Creating your own logical databaseABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Heres a step-by-step guide:
Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
Youll be prompted for a short text description of your new logical database. Enter one. Youll then be prompted to specify a development class.
Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you dont have to write a single line of code.
Regards
S.Nehru
‎2008 May 03 7:40 AM
A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
check these links
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
‎2008 May 03 10:49 AM
hi create the logical data base...
A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.
Less coding s required to retrieve data compared to normal internel tables.
Tables used LDB are in hierarchial structure.
Mainly we used LDBs in HR Abap Programming.
Where all tables are highly inter related so LDBs can optimize the performance there.
Check this Document. All abt LDB's
GO THROUGH LINKS -
http://www.sap-basis-abap.com/saptab.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html
www.sap-img.com/abap/abap-interview-question.htm
www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm
Gothru the blog which provides info on LDB's:
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
Sample code
TABLES: SPFLI,
SFLIGHT,
SBOOK,
SCARR.
START-OF-SELECTION.
GET SPFLI.
WRITE:/ SPFLI: , SPFLI-CARRID, SPFLI-CONNID,
SPFLI-AIRPFROM, SPFLI-AIRPTO.
GET SFLIGHT.
WRITE:/ SFLIGHT: , SFLIGHT-CARRID, SFLIGHT-CONNID, SFLIGHT-FLDATE.
GET SBOOK.
WRITE:/ SBOOK: , SBOOK-CARRID, SBOOK-CONNID,
SBOOK-FLDATE, SBOOK-BOOKID.
GET SFLIGHT LATE.
WRITE:/ GET SFLIGHT LATE: , SFLIGHT-FLDATE.
hi check this also..
Navigations to Create Logical Database:
-
SLDB -> Specify LDB name starting with Z or Y -> Click on Create -> Opens an interface -> Enter short description
-> Create -> Save under a package and assign request number -> Opens an interface
-> Specify Root Node name (MARA) -> Enter short description for the Root node
-> Specify Database Table name (MARA) -> Create -> Opens an interface
-> Select the Root Node (KNA1) -> Click on SELECTIONS pushbutton from Appn.
Toolbar -> Click on Yes to generate Selection Screens from the Structure
-> Click on No to Search Help -> Opens an Interface
-> Select the checkboxes to create Field Selections and Free Selections
-> TRansfer -> Opens an Include Program -> Decomment Select-Options statement and specify range variable as follows:
SELECT-OPTIONS : MATNUM FOR MARA-MATNR.
-> Save -> Activate -> Come back.
Select the Node -> Click on SOURCE CODE pushbutton
-> Click on Yes to generate source code from Structure and Selections -> Opens a report with two Include Files :
include DBZLOGICAL_DATABASE1TOP . " header
include DBZLOGICAL_DATABASE1NXXX . " all system routines
-> Double click on Header File to declare global variables -> Specify Following code:
TABLES : MARA * Autogenerated
DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
-> Save -> Activate -> Come back -> Double click on System Routine file, where the fetching operations are done
-> Opens an Include File with three subfiles as follows:
include DBZLOGICAL_DATABASE1N001 . " Node MARA
include DBZLOGICAL_DATABASE1FXXX . " init, PBO, PAI
include DBZLOGICAL_DATABASE1SXXX . " search help
-> Double click on the first file -> Specify SELECT operation statement as follows:
select * from mara into table it_mara where matnr in MATNUM.
PUT MARA. * AUTOGENERATED CODE
loop at it_mara.
write 😕 it_mara-matnr, it_mara-mtart, it_mara-mbrsh, it_mara-meins.
endloop.
-> Save -> Activate.
To Access LDB node, create SE38 PROGRAM, Specify LDB name in ATTRIBUTES section -> Specify following code in SE38:
NODES MARA.
GET MARA.
-> Save -> Activate -> Execute.
regards,
venkat