Logical Database vs Database tables
Hi,
To extract some information in a report program, currently we are making use of a Logical Database . But we see that the performance is very poor and we believe , a direct read from the database tables should improve the performance.
We are looking for some supporting documents which confirms the same. (A direct read from the database tables gives better performance than reading from a Logical database). Any points will be highly appreciated.
Thanks a lot.
Regards,
Suganya
Hi,
As per the recent ABAP Programing Guidelines, the use of the Logical Database is highly discouraged.
You can have a look at the guidelines at the following link :
http://www.sap-press.com/product.cfm?account=&product=H3072&shoppingcart=003
Th official Programing Guide cna be locate at
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/media/streamingmedia/events/sap%20teched%202006/premium%20content/cd/cd356%20state-of-the-art%20abap%20-%20a%20practical%20programming%20guide/cd356.pdf
Hope this helps.
Thanks,
Samantak
Similar Messages
-
How to update the logical database table.Please explain with a code
this is how you can update the database table .
UPDATE it_tab
set MSIZE = MSIZE
LENGTH = LENGTH
COILS = COILS
SPOOLS = SPOOLS
WEIGHT = WEIGHT
where SRNO = SRNO and
DDATE = DDATE AND
SHIFT = SHIFT AND
PLANT = PLANT .
but please post detail description of the problem whn u post in forms
Thanks
-Ankit -
Use logical database to fetch data in FI reports
Hi All,
is it possible to fetch data using logical database for FI module ALV reports.
please provide me details.
Thks
Shaileshlook at the logical database tables for the FI module
BMM Documents for Number
BRF Document Database
BRM Accounting Documents
DDF CUSTOMER DATABASE
KDF Vendor Database
SDF G/L Account Database -
Logical Database for a Resource
Hello,
I'm looking to write a query in Quickview (SQVI) and I need the logical database for a Resource. Can anyone help?
Thanks,
BThere are two ways for this -
1. To create the functional area with a logical database
Tools => ABAP/4 Workbench => Utilities => ABAP/4 query => Functional Areas.
Give the functional area name and click on Create button
In the next screen give a brief description of the functional area
Specify the name of the logical database, for e.g. Database FI, Application S. This will be the definition for the flight database
Click on the button Functional Group present on the application toolbar, in order to create the functional group for the required fields from the logical database tables
In the functional group box mention the number of the functional group and the description for the functional group
The tables from the logical database are shown in Tables Of Logical Database/Joins while the fields are displayed in the Fields Box
Double click on the table name in order to change the list
Every field that has to be selected in the query should be assigned a functional group number against it
Sometimes the list of fields in the Fields box will not be completely visible. To have a wider display of the list place the cursor in the fields box area and click on Settings => Full Screen from the SAP menu bar
To see the fields from different tables select the table and double click on it.
Once the required fields are selected, save the functional Area by clicking on the SAVE icon on the toolbar, and then Generate the Functional Area by clicking the Generate icon on the toolbar
To add user defined fields to the abap query use the menu bar option GOTO => Additional Field
Give the field name and the table name from the logical database to which the field needs to be included. Click the ENTER button.
On the next screen give the Sequence, description, title and the technical attributes for the field (field type, length). Here you can also specify the formula for the field. Click on the SAVE button to register the data to the database.
Remember that the sequence of the field matters if the second field uses the first field in its code then the second field should have a higher sequence than the first. Tables can also be included to do this use the menu option Goto => Additional Tables
You can include your own selection criteria and parameters to control the data to be selected from the database. For these additions to get activated, code needs to be written for taking care of the additional fields.
To display something before the execution of the actual query, go to the start of selection event via the menu path Goto => Code => Start-of-selection.
To display something just before or after the output of the query, go to the end of selection event via the menu path Goto => Code => End-of-selection.
To display something at the beginning of the page, go to the top of page event via the menu path Goto => Code => Top-of-page.
After finishing everything save and generate the functional area and click on the BACK icon to come out.
2. To create a functional area without a logical database
One of the following can be selected
Based on a single table
Using an ABAP/4 program
Using Table Joins
Using Sequential Dataset
The steps to be followed for creating the functional area are as follows
Tools => ABAP/4 Workbench => Utilities => ABAP/4 query => Functional Areas.
Give the functional area name and click on Create button
In the next screen give a brief description of the functional area
In the Without a logical database area give the base table on which to form the ABAP query
To form the query with two or three tables, we need to create a join. For this check the Table Join Check Box and click on the Table Join button.
NOTE: The tables to be used in the join should have at least one field in common i.e. it should have the same name, domain or data element.
Mention the tables that you want to include in the join condition in the Joined Tables area and press ENTER.
A checkbox will appear against the table names on the left side, and three radio buttons will appear against the tables on the right side specifying the join type.
Base table name remains grayed out. Select the two tables to be involved in the join by clicking the check boxes against them. Use menu path Edit => Join => Define condition to create the join. A mapping between the tables will be displayed on the right hand side. Click on the button provided (with + and down arrow symbol) to specify the join.
Click YES on the Proposal Requested message that gets displayed.
If the join tables have a foreign key relationship then the common fields in the tables will be marked with 00 to indicate that the join has been created. User can create the join by specifying 00, 01 etc. against the fields that qualify for the join.
Complete the join condition by adding more tables if necessary.
Remaining concepts for creating the functional area without a logical database are same as the concepts for creating the functional area with a logical database.
After finishing everything save and generate the functional area and click on the BACK icon to come out.
Thanx! -
HR Logical database PNP. OO to fill table dynamic table from PNP ?
Hi all
I want to get some stuff from the HR logical database into a dynamic table
Here's a real simple example that writes info out to a normal list.
(report is based on using Logical DB PNP)
tables: pernr.
INFOTYPES: 0001, "Organizational Assignment
0002. "Personal Data
SELECT-OPTIONS: language FOR p0002-sprsl.
INITIALIZATION.
pnptimed = 'D'.
GET pernr.
PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda.
CHECK language.
WRITE: / p0002-pernr,
sy-vline,
p0001-ename,
sy-vline,
p0002-sprsl,
sy-vline,
p0002-gbdat.
ENDPROVIDE.
endform.
Now what I want to do is replace the write stuff by appending the entries into a dynamic table which I will display as an ALV Grid.
so I add my structure in the data declarations
types: begin of s_elements,
pernr type p0002-pernr,
ename type p0001-ename,
sprsl type p0002-sprsl,
gbdat type p0002-gbdat.
drop_down_handle type int4.
types: end of s_elements.
include zz_jimbo_incl.
build the dynamic table
create data dref type s_elements.
assign dref->* to <fs>.
i_routine = 'POPULATE_DYNAMIC_ITAB'.*
i_names = 'NAME_COLUMNS'.
i_gridtitle = 'HR TEST'.
invoker = sy-repid.
i_zebra = 'X '.
i_edit = ' '.
call function 'ZZ_CALL_SCREEN'
exporting
invoker = invoker
my_line = <fs>
i_gridtitle = i_gridtitle
i_edit = i_edit
i_zebra = i_zebra
i_names = i_names
i_routine = i_routine
importing
z_object = z_object
dy_table = dy_table.
Now to populate the dynamic Itab the routine below is entered.
form populate_dynamic_itab changing dy_table.
assign dy_table->* to <dyn_table>.
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
However I can't use GET / PROVIDE / ENDPROVIDE in a Form.
Anyway round this ---seems HR has an aversion to OO.
Cheers
jimboHi,
well, GET_PERNR is a so called event_statement. It has nothing to do with ABAP 00.
Normally it will be like this:
START-OF-SELECTION.
GET_PERNR.
PROVIDE ....
END-OF-SELECTION.
-> and here the CALL SCREEN NNNN for ALV-Display.
Provide-statements you can use in forms of course, and as many times you want during GET and END-OF-SELECTION.
But as I understood : you just want to save the write-statements?
I always develop a DDIC-Structure, declarate the data objects in the programm, read the data via Provide into the infotypes, and then make a move-corresponding to my structure. and display it.
Normally no problem.
kind regards
maik -
ABAP Objects and table processing (with logical databases)
I have a report that is written right now using procedural abap and a logical database. The report is structured follows (high level):
start-of-selection.
get pernr.
perform get_it0001 using wtab.
perform get_it0002 using wtab.
perform get_it0003 using wtab.
append wtab to itab.
end-of-selection.
call function 'reuse_alv_grid_display'
exporting
i_structure_name = 'itabstructure'
tables
t_outtab = itab.
So basically I'm going through a bunch of personnel numbers, getting a few infotypes and outputting to ALV. I don't see where ABAP Objects is going to help me for this particular program.
Can somebody show me where OO ABAP would make this easier? Does it even make sense to use OO when you're processing with a logical database? (Not just PNP, but any logical database in general).
Thanks in advance.Hello Lee
I assume that the routines GET_ITnnnn are written by yourself. For reading infotypes ABAP Objects provides us with same very helpful classes as shown below:
* define data
DATA:
gif_employee type ref to if_pt_employee,
go_employee type ref to cl_pt_employee,
gt_infotypes TYPE tim_tmw_itlist_tab,
go_control TYPE REF TO if_pt_td_control,
go_data TYPE REF TO if_pt_td_base,
go_pnnnn TYPE REF TO if_pt_td_itnnnn,
gt_p0001 TYPE TIM_P0001_TAB,
gt_p0002 TYPE TIM_P0002_TAB,
gt_p0003 TYPE TIM_P0003_TAB.
start-of-selection.
GET pernr.
<b>* Create employee instance</b>
gif_employee = cl_pt_employee=>get_employee( pernr ).
go_employee ?= gif_employee.
<b>* Get master infotypes (0001, 0002)</b>
CALL METHOD go_employee->get_master_data
EXPORTING
im_begda = id_fromdate
im_endda = id_todate
IMPORTING
* EX_I0000 =
EX_I0001 = gt_p0001
EX_I0002 = gt_p0002
* EX_I0007 =
* EX_I0008 =
<b>* Append all other required infotypes to itab</b>
APPEND '0003' TO gt_infotypes.
CALL METHOD go_employee->get_infotypes
EXPORTING
i_itlist = gt_infotypes
i_fromdate = id_fromdate " start date
i_todate = id_todate " end date
* I_FILTER =
i_noauthcheck = 'X'
IMPORTING
e_result = gt_infty_request
e_retcd = gd_retcd.
* Please see documentation of parameter e_retcd...
LOOP AT gt_infty_request INTO go_control.
go_data = go_control->data. <b>" get data object</b>
* Casting
TRY.
go_pnnnn ?= go_data.
CATCH cx_sy_move_cast_error.
CONTINUE.
ENDTRY.
<b>* Convert infotype (semi-transparent -> transparent)</b>
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = lo_pnnnn->prelp
IMPORTING
pnnnn = gs_p0003.
APPEND gs_p0027 TO gt_p0003.
ENDLOOP.
The class CL_PT_EMPLOYEE provides us already with very easy access to so-called master infotypes (000, 0001, 0002, 0007 and 0008). All other infotypes can be read using method GET_INFOTYPES.
Using these classes we have a very convenient and standardized way of accessing all kinds of infotypes.
Regards
Uwe -
Infoset query logical database and transparent table
Hi!
We have an infoset with the data source logical database=PNP.
We get some fields from the infotype 0768, P0768-PERNR, P0768-BEGDA, etc.
Now we need add another table to make a join within infotype 0768 and table T5F99SE.
For instance, in infotype 0768 I have one record with the fields PERNR and BEGDA and in the T5F99SE I have 3 records related to the unique record of infotype 0768, the fields of the table are PERNR, BEGDA, ACTDT and ADDAT .
The fields values in the example can be:
Infotype 0768: PERNR=00101800, BEGDA=20110401, DICOT=20, BACHE=1200
Table T5F99SE: record 1 PERNR=00101800, BEGDA=20110401, ACTDT=20110401, ADDAT=PB E
record 2 PERNR=00101800, BEGDA=20110101, ACTDT=20110405, ADDAT=PC E01
record 3 PERNR=00101800, BEGDA=20110401, ACTDT=20110409, ADDAT=PA E
The result we want get with infoset query is
PERNR BEGDA DICOT BACHE ADDAT
00101800 20110101 20 1200 PB E
00101800 20110101 20 1200 PC E01
00101800 20110101 20 1200 PA E
I would like to get the fields of the infotype and some fields of the table T5F99SE.
Is possible do this action with ABAP modifying an infoset that already exists adding the fields of the transparent table?
What should I do?
Kind regards,
Julian.My guess is that it would not be possible to include a transparent table into the LDBs PNP and PNPCE. Would need input from a technical expert there.
However, instead of using the LDB, why don't you explore just using a direct table join? You may need to join PA0000, PA0001, PA0002 along with PA0768 and your other tables. An infoset can then be created on this table join.
To go to the mode where you can create the table join, in your infoset transactions, choose 'Table join' instead of 'LDB'. -
How to select a new table in logical database after creating the Infoset
I have created a abap query report ,i have used logical data base ADA in the infoset in SQ02.In the logical database i had selected only two tables then ANALV and ANLB.Now my client wants one more field to be added and thats is from table ANEK.Now i need to select this table in logical database ADA.
Please assist on how to select another table available in the Logicaldata base now which i didnt select when i created the queryMarkus,
I have now selected the additional field Posting date in Document ANEK -BUDAT .Earlier the report had the fields from ANLCV - Current acquisition value ,ordinary dep posted selected for the output.
When i run the query after adding this new field ANEK-BUDAT the below warning is generated by system :
The query specifications cannot be used to generate a list,
i.e. the query will probably not return the list you desire.
If you still want to execute the query, please use the
"Generate" function
-> 'Generate'
Fields from parallel tables within a line*
Line: 01
Field: Posting Date in the Document
(ANEK-BUDAT, table ANEK)
Field: Ordinary depreciation posted
(ANLCV-NAFA GEB, table ANLCV)
Fields from parallel tables within a line*
Line: 01
Field: Posting Date in the Document
(ANEK-BUDAT, table ANEK)
Field: Current asset acquisition value
(ANLCV-LFD KANSW, table ANLCV)
2 warnings for query QUERY ***
Please advice .How get this new field added. -
Logical database vs direct access of database table
Hi
I have created a FI report. I am trying to get data from large FI tables like BSAK, BSEG, BKPF, RSEG. eventhough there are 10 records as per my criteria, system is taking morethan an hour time even in background processing. This may be becaz of lot of conditions that I am applying to filter the data. But still trying to improve the performance
For fetching data which is the better way for getting optimum performance of the report.
a) directly fetching data from database tables
b) using logical database collecting data into an itab
regards,
mallikHi,
If you are accessing the database tables more than once with different criteria then definetly it will take more time. In such case write only one Select statement on the table and get all the required data into an internal table and then process this internal table as per your logic.
Use of LDBs is definetly faster but filter conditions might not match with your filter conditions. In such case direct access of database table is preferable but as i said in above paragraph.
thanks,
sksingh -
Tables or Logical database to create standard report for Equipment BOM?
Dear All
My client has requirement for the report with fields like to see the status of Equipment BOM(input of Equipment number in selection screen) or for Particular set of Materials(input of component number in selection screen) available stock quantity,storage location of stock,description of component,price of component,Pending PR of component(if any),Pending PO of component(if any) etc
I want to develop the report with standard infoset query instead of going for abap development.is there any logical database to map the report or what tables can i use for table joins??
Required sample report with fields as below
BOM Component
Stock available/Not available indicator
Description of Components
BOMQty/ UOM
Price
Part Number
Plnt
Sloc
Stock Qty
Bin
Pending PR
Pending PO
1000001121
YES
BEARING
NO
2000
ERS22
1000
MECH
4
A1
300012431
Regards
M.ManojkumarManoj,
The following is the tested solution.
Table join
Output
This figure shows the case of a Equipment BOM where 3 components are there. Installed Quantity are 4, 1, 1 respectively. Last two columns are showing the Storage Locations and the Stocks available.
Fields taken to output are
From STPO : IDNRK MENGE MEINS
From MARD LGORT LABST
As said before, more than this you can not do in SQVI. With this basic join in SQ02, using codes in Extras you can do much more.
Jogeswara Rao K -
TABLES statement in pnp logical database
I am using PNP logical database in my program.
when i check for obselete errors it is showing the statements
"TABLES: PERNR.
INFOTYPES: 0001,0002." are Obselete
But my program is logically correct and also working.
can u tell me how to resolve this error.tables sflight is exactly the same as data sflight type sflight.
The same for the infotypes statement, but then you have to reference to the pa#### table.
Kind regards, Rob Dielemans -
MRP Area tables for MD06 information access like SQ01, DBM logical database
We currently use SQ01 DBM logical database to access MD06 information (tables MDKP and MDTB). The MRP results from the MRP Area are not showing in this query. This implies that the MRP area, MRP results are stored in other tables.
I have reviewed tables (MDLV, MDMA, MDLG, DVER, MDIP) from a similiar thread. However, they do not contain the MRP data (planned orders, stock, production orders ect) like in the DBM logical database. This data access is very powerfull for exporting planning data for more robust analysis.
Any help is much appreciated.
Thank youHi,
Please try FM: 'AUFBAUEN_MDPSX_ANZEIGEN'.
MD06 dame come many table.
Example:
(Plant level)
icm61w-fabkl = wk_fabkl. :Factory calender
imt61d-matnr = p_matnr. : Materials
imt61d-werks = it_tbl-werks. : Plant
AUFBAUEN_MDPSX_ANZEIGEN 呼出
CALL FUNCTION 'AUFBAUEN_MDPSX_ANZEIGEN'
EXPORTING
ecm61w = icm61w
ecm61x = icm61x
emt61d = imt61d
et399d = it399d
ECM61B =
ESFILT =
IMPORTING
icm61m = wa_e_cm61m
imdkp = wa_e_mdkp
imdsta = wa_e_mdsta
TABLES
mdpsx = it_mdps
regards,
Gaito -
Linking logical database to TABLE in query
Can we link Logical Database to Table during query creation in tcode SQVI
Message was edited by:
rohith modi
Message was edited by:
rohith modigo to sqvi and select "Table Join"in data source and enter title select radio button for "basis mode" and enter u reach a new screen in that new screen press "insert table" and give ur table name and again press "insert table" and give another table in thsi way we can joint table in ABAP query.
reward points if it is helpful -
How to link Infotype Table Data to Logical Database
We have historical data in one of our system brought by using diret insert queries on Infotype tables. Now, we are facing a problem that this data is not visible from PA20/PA30. Also, while using Logical Database in programs, we are not able to extract data from Infotypes using GET events.
Does anybody have any idea/solution to this kind of problem?What made you to take decision to make direct table updates? I am not sure if this was the correct way. Anyway, whether all the module pool programs are in place foe these custom infotypes. You dont have to do anything else to have logical database program to fetch data for custom infotypes. Check if eveything in PM01 is configured correctly.
-
How to Find Logical Database with table name
Shankar
Version 4.6x
If you need to find the logical database for a table name, you can used <b>SE36</b> - Logical Database Bulider.
Steps :-
Go to transaction <b>SE36</b>
Click <b>Extras -> Table usage</b>
Supply the Table name and hit enter.
A Display Logical Database will be shown on a pop-up windows.
Reward points if it is usefull ....
Girish
Maybe you are looking for
-
RAS services goes down when end user trying to print report button on web
Hello, This is Johan, we are facing serious problems with Crystal Reports Server XI, we have 5 pack license, we are using this only for to run the reports using Tomcat webserver, as per below error user are complaining every day when they try to prin
-
Restart....and then grey
I tried installing Leopard today, but after the iMac restarts, all I get is a light grey screen with the Apple logo on it. No installation screen. It stayed on this screen for 4 hours. Called Apple tech help and was put on hold for 56 minutes before
-
Way back in GoLive 5, there was a menu command that allows you to see an estimate of a web page's file size and how long it would take to load with different connection speeds. Does Dreamweaver have anything similar?
-
I am doing a project where I have to put large numbers in a table. It keeps putting the numbers into scientific notation. How do I stop this?
-
Where i can download jmf source code?
i search the web all days, but i can't find it. Anybody can help me and sent jmf's source code to my gmail: [email protected], thanks in advance.