Hoe to creat own logical database inhr
hi all,
can anyone send the codefor creating the own logical databse like pnp in HR.
<b>Creating a Logical Database</b>
Open the Logical Database Builder (<b>SE36</b>)
1. Enter a name on the initial screen of the Logical Database Builder and choose Create.
2. A dialog box appears. Enter a short text. You can change this later by choosing Extras -> Short text or Administration info.
3. Once you have entered the short text, you must define the root node of the logical database. Enter the node name and its attributes. There are three different types of nodes:
The logical DB gets created.
Then to edit the logical DB, use the following steps.
The structure editor of the Logical Database Builder appears. On the left is the name of the root node, followed by a code for the node type: T for a database table, S for a ABAP Dictionary type, and C for a type from a type group. The new logical database now has a structure with a single node.
You can now extend the structure as described in Editing the Structure.
If you choose Next screen (right arrow in the application toolbar), a screen appears on which you can enter a search help for the logical database as described under Editing Search Helps.
If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the selections for the logical database. When you have confirmed the dialog box, a list appears, on which you can select all of the nodes that you want to use for field selections or dynamic selections. The fields that you select are included in the source code generated by the system for the selection include.
The generated selection include is displayed in the ABAP Editor. You can change it as described in Editing Selections.
If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the database program for the logical database. The database program is generated from the structure and the selection include. It has a modular structure, consisting of several include programs and all of the necessary subroutines, with proposals for the statements that will read the data.
The generated database program is displayed in the ABAP Editor. You can change it as described in Editing the Database Program.
If you repeatedly choose Previous screen (left arrow in the application toolbar), you can display and change the general attributes of the logical database.
Finally, you can maintain optional selection texts and documentation.
<b>Reward if helpful</b>
Similar Messages
-
Transporting Views created for Logical Database in QAS
Hello all,
Can anybody let me know teh steps...
How to transport views created for logical database from dev to QAS...
kindly give the steps...
thanks
saurabhI don't think PNPCE does anything with HRP infotypes. PNPCE is all about PA data since PERNR is the main key. Logical DB PCH is the one that deals with HRP Infotypes.
-
How to create a logical database?
Hi,
Can anyone tell me how to create a logical database? I am curious about it.
Thanks.
Awards will be provided.
Best regards,
Chris GuTransaction code for creating Logical db is se36.
Give the name as <ldbname>..
Specify the table names and the sub nodes according to your heirarchy.The root node used is zxxx_product and child node is zxxx_orders
The heirarchy used is ZXXX_PRODUCT---->ZXXX_ORDERS
write the below code under selections ...
Enable DYNAMIC SELECTIONS for selected nodes :
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_product.
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE zxxx_orders.
Enable FIELD SELECTION for selected nodes :
SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_product.
SELECTION-SCREEN FIELD SELECTION FOR TABLE zxxx_orders.
***User defined blocks :
****Root node
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
SELECT-OPTIONS :
so_pname FOR zxxx_product-prname ,
so_pdelv FOR zxxx_product-prdeldate .
SELECTION-SCREEN END OF BLOCK b1 .
****Child node
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 .
SELECT-OPTIONS :
so_odate FOR zxxx_orders-orddate ,
so_oqty FOR zxxx_orders-ordqty .
SELECTION-SCREEN END OF BLOCK b2 .
write the below code under include include DBZXX_PRODUCTTOP
TABLES : ZXXX_product, ZXXX_orders.
DATA : gt_root TYPE table of ZXXX_product ,
gt_chld TYPE table of ZXXX_orders .
write the below code under source code...
Call event GET Zxxx_PRODUCT
FORM put_zxxx_product.
TYPES : BEGIN OF ls_pid ,
prodid TYPE zxxx_product-prodid,
END OF ls_pid .
DATA : lt_pid TYPE ls_pid OCCURS 0 ,
lt_pid_tmp TYPE ls_pid OCCURS 0 .
STATICS lv_first_time VALUE 'X'.
STATICS ls_isroot_fields TYPE rsfs_tab_fields.
STATICS ls_isroot_where TYPE rsds_where.
STATICS ls_ischld_fields TYPE rsfs_tab_fields.
STATICS ls_ischld_where TYPE rsds_where.
IF lv_first_time EQ 'X'.
CLEAR lv_first_time.
o
+ Declarations for field selection for node Zxxx_PRODUCT ***
" move table name to the corresponding field
MOVE 'Zxxx_PRODUCT' TO ls_isroot_fields-tablename.
" Read values from selection screen
READ TABLE select_fields WITH KEY ls_isroot_fields-tablename
INTO ls_isroot_fields.
" move table name to the corresponding field
MOVE 'Zxxx_PRODUCT' TO ls_isroot_where-tablename.
" Read values from dynamic selection screen
READ TABLE dyn_sel-clauses WITH KEY ls_isroot_where-tablename
INTO ls_isroot_where.
o
+ Declarations for field selection for child node Zxxx_ORDERS ***
MOVE 'Zxxx_ORDERS' TO ls_ischld_fields-tablename.
READ TABLE select_fields WITH KEY ls_ischld_fields-tablename
INTO ls_ischld_fields.
MOVE 'Zxxx_ORDERS' TO ls_ischld_where-tablename.
READ TABLE dyn_sel-clauses WITH KEY ls_ischld_where-tablename
INTO ls_ischld_where.
"...Check whether entry is made in atleast one selection field:
IF NOT so_pname IS INITIAL OR
NOT so_pdelv IS INITIAL OR
NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_isroot_where-where_tab IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL .
"...Check whether entry is made in atleast one field in root node :
IF NOT so_pname IS INITIAL OR
NOT so_pdelv IS INITIAL OR
NOT ls_isroot_where-where_tab IS INITIAL .
SELECT prodid FROM Zxxx__product
INTO CORRESPONDING FIELDS OF TABLE lt_pid
WHERE prname IN so_pname AND
prdeldate IN so_pdelv AND
(ls_isroot_where-where_tab).
"...Check whether entry is made in atleast one field in child node:
IF NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL AND
NOT lt_pid IS INITIAL.
SELECT prodid FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE lt_pid_tmp
FOR ALL ENTRIES IN lt_pid
WHERE prodid = lt_pid-prodid AND
orddate IN so_odate AND
ordqty IN so_oqty AND
(ls_ischld_where-where_tab).
lt_pid = lt_pid_tmp.
ENDIF.
ELSEIF NOT so_odate IS INITIAL OR
NOT so_oqty IS INITIAL OR
NOT ls_ischld_where-where_tab IS INITIAL.
SELECT prodid FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE lt_pid
WHERE orddate IN so_odate AND
ordqty IN so_oqty AND
(ls_ischld_where-where_tab).
ENDIF.
******lt_pid contains all the selections based product ids
******Now retrieve all the records with the corresponding product ids
CHECK NOT lt_pid IS INITIAL.
IF NOT ls_isroot_fields IS INITIAL.
SELECT (ls_isroot_fields-fields) FROM Zxxx_product
INTO CORRESPONDING FIELDS OF TABLE gt_root
FOR ALL ENTRIES IN lt_pid WHERE prodid = lt_pid-prodid.
ENDIF.
IF NOT ls_ischld_fields IS INITIAL AND
NOT gt_root IS INITIAL.
SELECT (ls_ischld_fields-fields) FROM Zxxx_orders
INTO CORRESPONDING FIELDS OF TABLE gt_chld
FOR ALL ENTRIES IN gt_root WHERE prodid = gt_root-prodid.
ENDIF.
LOOP AT gt_root INTO Zxxx_product.
PUT Zxxx_product.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
write the below code under
include DBZXXX_PRODUCTNXXX -->
include DBZXXX_PRODUCTN002 .
form put_zxxx_orders
LOOP AT gt_chld INTO zxxx_orders WHERE prodid = zxxx_product-prodid.
PUT ZXXX_ORDERS.
ENDLOOP.
endform.
now write a report program and call the ldb by its name using get
get <ldbname>.
Reward if this is useful.
Regards,
devi.
Edited by: Devi Raju on Jul 15, 2008 9:13 AM -
Create a Logical Database Based on Mseg and Bseg
Hi,
how can i create a Logical database using bkpf,bseg,mkpf,mseg. i need to know , which table is a root node ?
could any one help me?
ThanksHi Amit,
While I am Creating the Logical Database by selection MKPF as root node, i have one problem.
my selection-screen is,
Plant Bseg-werks,
G/Laccount Bseg-Hkont,
Fin year bseg-gjahr,
Grn Date Bkpf-Budat,
Vendor No Bseg-lifnr,
Po Bseg-ebeln,
MatNr Bseg-matnr.
My LDB structure is
MKPF
Mseg
BKPF
Bseg.
My Doubt is, how can I access the glaccount details from bseg and How can i fetch the data from Mseg and Mkpf
(Grn details) .
If you give the Source code it is very useful to me.
Thanks,
Neptune.M -
How to use OWN logical database
Hi all,
hope somebody can help me.
I copied a standard logical database (FPMF). The program which I use and have modified is also copied from standard.
How can I assure that the program use MY logical database instead of the SAP-One?
In my case I have some get statements. And these get statements all refer to FPMF and not to my copied database.
Do anybody what's the probelm?
Cheers
PhilipYes, I know. And I am not happy with this solution.
But I didn't see another way for my issue.
Thank you very much.
Philip -
Steps to create LOGICAL DATABASE in sap
hi guys,
i have gone through many documents about LDB. But, i didnt get the steps to create a LDB.
plz provide me with the steps to be followed to create a LDB.
thnx,
shivaa.Hi Shiva,
This might help you!
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 youu2019ve 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 database
ABAP/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. Hereu2019s a step-by-step guide:
1. 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.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. 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 youu2019ve 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 donu2019t have to write a single line of code.
Watch out!
The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
Declaring a logical database
Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
Logical databases for increasing efficiency
Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
Reward if useful.
Thankyou,
Regards. -
hi,
i need to display Outstanding Liability GRNs in my report. for that report, i have created a Logical Database.
The structure of ldb is,
BSIS>Bkpf->Bseg--->Rseg
My Input fields
GL Account
Plant
Fiscal Year
Grn Date
Now my problem is,
Time taken to give the output is very high(Nearly 450 seconds for 1 month duration)
Is there any alter way to create the Logical database using some other tables?
In logical Database can i create Internal tables?
Thanks,
Neptune.MHi,
you can create the view or index to make it faster
regards
vijay
Message was edited by: Vijay Babu Dudla -
Syntax error in Logical database created by copying standard PGQ
Hi guys.
I created a logical database ZMPQ_PGQ using the copy option from SE36 with the input PGQ (logical database used by QA33).
But it showing some syntax error Field "PGQ_SP" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
How to resolve this?
Thanks in advance.When checking the syntax of the LDB source code, go to the location of the syntax error (in include DBZMPQ_PGQSXXX), and change all internal table references of PGQ_SP to ZMPQ_PGQ_SP.
-
Change selection screen in LDB (KDF logical database - NOT HR)
Hi All,
Iu2019d like to use KDF logical database to keep the dynamic selections since user wants to use it but I need to change the selection screen itself. The existing variants for KDF donu2019t meet the user requirements. Some fields I need to hide some add. Like I want to u201Cremoveu201D the field u2018Posting periodu2019 (MONAT) (which is available in dynamic selection screen) and put it on the u201Cmainu201D selection screen.
Do I need to create my own logical database or there is a way around?
Could someone give me a practical advice or sample of solution?
Thanks a lot.Thanks Himanshu,
I did as you suggested but problem is that it does not allow me to hide the whole block.
I have 3 filelds actually on block KD_0 I need to hide (its from selection screen of KDF logical database.)
SELECT-OPTIONS: KD_LIFNR FOR LFA1-LIFNR MATCHCODE OBJECT KRED.
SELECT-OPTIONS: KD_BUKRS FOR LFB1-BUKRS.
SELECTION-SCREEN END OF BLOCK KD_0.
PARAMETERS KD_INDEX AS SEARCH PATTERN FOR TABLE LFA1.
What I did is below. I used sp instead of u201C=u201D since it has many screen for field KD_LIFNR(for frame, text etc).
And when I did just for KD_LIFNR it was hidden but when I did the same for KD_BUKRS it was not hidden . The field has stars u201C*********u201D in it.
Same happen with KD_INDEX. The name of the field is hidden but field not and it filled with ********. Do you have any ideas what it can be?
I debugged it to catch all screen names but no luck
loop at screen.
if screen-name cp 'KD_LIFNR' or
screen-name cp 'KD_BUKRS' or
screen-name cp 'KD_INDEX' or
screen-name = '%B000003_BLOCK_1000' or
screen-name = 'SSCRTEXTS-FRAME_TEXT' or
screen-name = 'SSCRTEXTS-MCID_TEXT' or
screen-name = 'SSCRTEXTS-STRNG_TEXT' or
screen-name = 'SSCRFIELDS-SEARCH_BTN' or
screen-name = '%B025008_BLOCK_1000' or
screen-name = '%F021010_1000' or
screen-name = 'ALCUR' or
screen-name = '%F022012_1000' or
screen-name = 'EXCDT' or
screen-name = 'SSCRFIELDS-UCOMM'.
screen-invisible = '1'.
modify screen.
endif.
endloop. -
Hi All, I am quite familiar with Logical Databases but I need to understand the following.
1) I am using LDB ADA, but I want to use my own Selection Screen and not the default one that the LDB provides. I know I must put something in AT SELECTION-SCREEN but am unsure what.
2) Once I get the data, I want to store the data in an internal table - how do I go about doing this? If you can provide a code example that would be great.
Points for any relevant help.Hi,
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.
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 database
Heres a step-by-step guide:
1) 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.
2) Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3) Youll be prompted for a short text description of your new logical database. Enter one. Youll then be prompted to specify a development class.
4) 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.
Noted point is we cant add any selection criteria thru our se38 program if you are attaching any LDB to program.Ist of no use.
If you want to change selection criteria to the existing LDB, you have to goto SE36 tcode and provide LDB name and choose "Change" mode by selecting "Selections" Radio button.
declaration of params is different compared to normal se38 program in some aspects.
PARAMETERS :p_curr LIKE bkpf-waers FOR TABLE bkpf OBLIGATORY.
this BKPF table should be one of the node in the "Structure" Radio button.
Thanks
Sivaparvathi
Please reward points if helpful. -
Regarding Logical database and select statement..
Hi
Experts.
i would like to know the diff b/w logical data base & select statement while using report.
wt is the use of logical databases in R/3. is there any advantage used in the reports.
Thanks & Regards..
Spandana.Dear Spandana,
Go through the below description of LDB. I hope you wil get a fair amount of idea.
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. Itu2019s 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. Letu2019s 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 SAPu2019s 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.
u2022 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.
u2022 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.
u2022 Database access programming: Once youu2019ve 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 database
ABAP/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. Hereu2019s a step-by-step guide:
1. 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.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. 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 youu2019ve 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 donu2019t have to write a single line of code.
Watch out!
The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
Declaring a logical database
Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
Logical databases for increasing efficiency
Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
Regards
Arindam -
Why and how we use Logical Database?
Can anybody explain with example why and how we use logical database?
Regards,
RajanHello,
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. Itu2019s 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. Letu2019s 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 SAPu2019s 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.
u2022 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.
u2022 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.
u2022 Database access programming: Once youu2019ve 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 database
ABAP/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. Hereu2019s a step-by-step guide:
1. 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.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. 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 youu2019ve 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 donu2019t have to write a single line of code.
Regards
Arindam -
Select statement in Logical Database
hi,
i need to select particular fields(not select * )
from bsis table in my Logical database. how can i write code for this?
for eg,
In Ordinary report , we can write (select belnnr into
itab_bsis-belnr) like this.
but in Logical Database how can i write the code ?
Neptune.MHi,
I am new to ABAP.Currently I'm practicing logical database. I am facing a similar problem like what Neptune is having.
I have created a logical database 'Z03_SAMPLEDB5' using tables KNA1, KNB1,KNB4,KNB5 and KNKK.
I have defined the Database program and selections.Now I would like to use this logical database in one of my programs.
Please find the code of the program in which I'm using this logical datbase :
REPORT Z03_SAMPLELDB5.
tables : kna1.
data: begin of t occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
bukrs like knb1-bukrs,
end of t.
start-of-selection.
get kna1.
clear t.
move-corresponding kna1 to t.
append t.
end-of-selection.
write: /20 'Customer No.', 40 'Country code', 55 'Company Code'.
ULINE.
loop at t.
write: /20 t-kunnr, 40 t-land1, 55 t-bukrs.
endloop.
In the output screen I could get data for only 'Customer No' and 'Country code' .'Company Code' is blank.
Please let me know what I need to do to get data for 'Company Code' as well.
Thanks,
Prasuna -
hi all.....
i was created LDB and i created KNA1 as node and in that VBAK as child node and VBAP as child node for VBAK.
in the selection option i choosed all fields ,
in the selection i written as
selection-option: cust no for kna1-kunnr,
selection-option: ordno for vbak-vbeln.
and in the source code
in KNA1 include..
select * from kna1 where kunnr in custno .
endselect.
in VBAK include...
select * from vbak where vbeln in ordno and kunnr = kna1-kunnr.
endselect.
in VBAP include...
select * from vbap where vbeln = vbak-vbeln.
end select.
when i checked there is no syntax mistakes but i test that program im gettign runtime error i.e convertion is not possible..........
please solve my problem...Hi Ramprasad,
your efforts to create a logical database are highly admirable.
But if you want to stay up-to-date, you might consider using something else. Starting with ABAP 600 release, SAP lists this in the Obsolete Techniques section of ABAP that may appear in older programs but should no longer be used..
look here: <a href="http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb2d4d358411d1829f0000e829fbfe/frameset.htm</a>
Regards,
Clemens -
Problem in logical database.
Hi experts,
I'm creating a logical database. It is populating only at the end and its not updating for the earlier records at all. Only the last record gets printed and not the previous records at all. WHAT MIGHT BE THE REASON. help me pl.Hi Vishwa,
Check whether you have called your last secondary node with LATE command in your driver program.
Regards
Vinodh
Maybe you are looking for
-
I cannot open iWeb where I need to update my website.
My website is hosted by GoDaddy. But I developed it and keep it updated on the iWeb application. I have been having startup problems with my laptop and cannot even backup my files because Time Machine is not working and whenever I try to backup my
-
HELP! I must go back to iWeb 1.2 from iWeb 2.0.1
The latest version of iWeb doesn't work for me and I must go back. I know how to uninstall and reinstall my previous iWeb (I guess that means I have to go back to iLife 6.0 totally) but I do not know if there is a way to get my website back to the iW
-
When is the iPad with Retina display will arrive to Malaysia?
When is the iPad with Retina display will arrive to Malaysia? If I purchase the iPad with Retina display from Singapore, can it be use in Malaysia telcos?
-
How to adjust broadcast safe filters correctly (Filter currently compromises picture)
Hi guys, Can anyone explain to me how to use the Broadcast Color filter properly? Before, when I was using FCP7, I just slapped on the Broadcast Safe filter and the edits passes the QC every time. Now we've moved to Premiere Pro CC and I added the
-
Why does my mac have issues with flash player videos
I was trying to watch a couple different videos last night for work and they wanted to use flash player.. however every time i tried to click on them to open them my macbook pro popped a message up saying that the flash player crashed that it would s