Datasource from a logical database.
Hi all,
I am in need of creating a datasource from a std.. Logical Database IMA in R/3. Is it possible to create a datasource directly from logical database or it is essential to find the base tables fetching data to the logical databse and look for the appropriate business content.
Regards,
Murali
Thank you,
The document helped me to create a Infoset.Can anyone share ur experience of creating a datasource using a INFoset which extracts data from a LDB. The LDB which i am supposed to use has few structures,hence, I am having some performance isssues which i believe a more elaborate better document can help me with.. The LDB I am looking for is IMA.
Thanks in advance.
Similar Messages
-
Getting results from LDB (Logical Database)
Hi All,
I have a requirement where i need to pass LDB results to external application. It can be any LDB. Like in SE36 we put the LDB name and execute and final results are shown in ALV. I dont need it to display in ALV but from my custom program, need that output table which stores these results.
I tried using LDB_PROCESS but that need custom subroutine names to pass in that, i tried passing the same and results also came but thing is every logical database will have different tables in that, it'll be impossible to create those many subroutine to handle each and every table. So i need a generalized solution like se36 processes the data for any LDB.
Is anyone knows how can i achieve this?
Regards
Munish Garg
9041793217Hello
Generally any LDB will have a event which triggers the data to be populated in the tables/memory. Now these data retrieval is written in a sub-routine "Perform PUT_<eventnamt>". So any LDB will have the sub-routine named "PUT_<eventname>" in its main program. May be you can create the sub-routine name dynamically using this method.
Regards
Ranganath -
Retriving Absence data from PNP logical database
hi all,
there is an function where i can get the absence data but my client wants in the following order
But my client wants the report in following format:
YEAR--- week number--
number of absence hourse in that week
2006 -
WEEK -
HOURS
infotype is pa2001.
thx in advance.
SunilSunil,
Table PTQUODED may be better suited than PA2001 because in PA2001 it is <b>very difficult to distinguish between absences that overlap between 2 or more weeks</b>.
Here is sample code that does exactly what you need:
REPORT zggar_abs.
DATA: ta_ptquoded TYPE TABLE OF ptquoded.
DATA: l_week TYPE scal-week.
DATA: BEGIN OF ta_abs OCCURS 0,
pernr TYPE pernr,
year(4) TYPE c,
week(2) TYPE c,
abs TYPE f,
END OF ta_abs.
DATA: wa_abs LIKE LINE OF ta_abs.
FIELD-SYMBOLS: <fs_ptquoded> LIKE LINE OF ta_ptquoded.
PARAMETERS : p_pernr TYPE p_pernr.
SELECT * FROM ptquoded
INTO TABLE ta_ptquoded
WHERE pernr = p_pernr.
LOOP AT ta_ptquoded ASSIGNING <fs_ptquoded>.
wa_abs-pernr = <fs_ptquoded>-pernr.
CLEAR: l_week.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = <fs_ptquoded>-datum
IMPORTING
week = l_week.
wa_abs-year = l_week+0(4).
wa_abs-week = l_week+4(2).
wa_abs-abs = <fs_ptquoded>-quode.
COLLECT wa_abs INTO ta_abs.
ENDLOOP.
SORT ta_abs BY year week.
LOOP AT ta_abs INTO wa_abs.
WRITE : wa_abs-year, wa_abs-week, wa_abs-abs.
NEW-LINE.
ENDLOOP.
Please, assign points and close the thread if solved.
Best regards,
Guillaume -
Creation of Datasource on Logical Database
Hi,
Any information as to how to create Datasource from a logical database in R/3 would be a great help.
Thanks,
Nikhilhi,
Using that LDB, you can write SQL statements in ECC,so create a table and dump the data from LDB into that table. And create a DS on that table.
LDB: you can't see it in SE11, just it is combination of some tables.
While creating DS in RSO2, we have 3 options, but LDB option is not there, either you create a Function Module using that LDB or Table then you connet that in RSO2.
Thanks
Reddy -
How to read data from Logical Database ADA for more than one financia year
Hi,
I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
Kind regards,
Zbigniew Debowski
REPORT ZWRZD075.
NODES: anlav, anlcv.
START-OF-SELECTION.
GET anlav.
WRITE:/ anlav-anln1, ' ', anlav-anln2.
GET anlcv.
WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.Hi!
Have you already tried your luck in Java Programming forum?
Regards,
Thomas -
How to remove spaces at selection screen coming from logical database
Hi Experties,
When we hide some selection from the logical database. The spaces still occupied and this make our selection screen looks awkward.
How to remove the spaces left by hidden selection ?
Regards
NislinaHi,
I came across your un-answered question while searching for a solution on the similer problem. Though I couldn't fine a solution on SDN, but figured out one myself. Thought its a good idea to share it.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group4 = '003'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Here screen-group4 contains the sequence number of the select-options field starting from 000 onwards.
You may like to assign points and close the question.
Kind Regards,
Khalid Mustafa -
To reterieve value from logical database psj
i need to reterieve value from the logical database psj,
the table name is BPJA1 and the field name is WTJHR, based on the wbs element.Hi,
assign your prog (attributes) to ldb psj and
try:
GET BPJA1 FIELDS wtjhr. "-> look F1
Andreas -
Logical Database DDF - GET KNA1 - change KUNNR to another customer....
Hi
Question 1a:
When using logical database DDF I perform a GET KNA1 a check is performed in order to see if customer should be within selection or not. In some cases this customer refers to another customer (fiscal address) that should be used instead.
So Customer KNA1-KUNNR: 123 should instead be Customer 456 which contains the relevant data for the next step in the selections from the logical database.
..GET KNB1
..GET BSID...
How is it possible to replace customer 123 with customer 456 so the continous processing of the logical database will use the new customer number instead.
Question 1b
And a follow up question - If there is a solution to question above....
How can I make sure that IF customer 456 pops up in the regular selection from the logical database - It is excluded since it was already used (when customer 123 was replaced with 456 above)...
Best regards
HenrikHi Ranganath!
Thankyou for looking into my problem.
Ranganath Ramesh wrote:
...If you want to do something like that then you need to manually populate the customer numbers which are related to the selection screen field....
Could you please clarify how I manually could add this new customer number to my selection screen field...whithout disturbing the origianal selection with GET KNA1 - at the same time as the CHECK-statement for my old customer number fails and is excluded from the selection.
BR
Henrik -
To make selection period mandatory in Logical Database Report
Hi All,
My report is using customized HR Report Category with selection period as Key Date.
My requirement is to make Key Date as mandatory field and with default value as sydatum.
Pls help .
Regards,
NibhaHello,
Although the selection screen will appear from the logical database you define, you can add your validation check at the event 'At selection-screen' to check if particular field is initial or not and give proper error message.
Other way would be at the initialisation event use the following :
loop at screen.
if screen-name = 'P_NAME'.
screen-input = '1'.
endif.
modify screen.
endloop.
Also at initialisation
s_date = sy-datum.
Regards,
Mansi. -
Customizing user selection fields of Logical database PNP
Dear Gurus,
I had made a z-copy of payslip program for incorporation of Logo. Now we need to put this report in Enterprise Portal (EP). Now since we would not want any user to view any other person's payslip, I need to disable the selection field (PERNR) for user selection.
Problem is this field for user selection is coming from standard Logical Database (LDB - PNP) used in the program. So how can I make this field hardcoded as sy-uname and non-modifiable without making z-copy of LDB-PNP.
Also I wish to harcode Payroll Area writing some code (from table PA000) but again I cannot write this in std. PNP LDB and writing it in driver program will not help.
Thanks in advance.
Regards,
AmitWrite the highlighted coding in initialization ...
initialization .
select single pernr from pa0105
into pernr-pernr
where usrid = sy-uname.
if sy-subrc = 0.
PNPPERNR-sign = 'I'.
PNPPERNR-option = 'EQ'.
PNPPERNR-LOW = pernr-pernr.
Append PNPPERNR.
endif.
loop at screen.
if screen-name = 'PNPPERNR-LOW' or
screen-name = 'PNPPERNR-HIGH'.
screen-input = '0'.
endif.
modify screen.
endloop.
at selection-screen output.
loop at screen.
if screen-name = 'PNPPERNR-LOW' or
screen-name = 'PNPPERNR-HIGH'.
screen-input = '0'.
endif.
modify screen.
endloop. -
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,
SuganyaHi,
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 -
Fetching value using Logical Database
Hi
I have some fields in my selection screen apart from the selection screen obtained from my logical database.
Kindly let me know how to fetch data from logical database.
My requirement is this:
I have to select company code from T001 based on entry frm selection screen .
with the obtained company code along with other fields from dynamic selection screen I have to fetch value from Lfb1.
Kindly let me know how to do this
Thanks
Yaminiuse f.m LDB_PROCESS....
refer demo program DEMO_LOGICAL_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! -
Greetings to All!
Problem, help...
There is a logic database "AUK" - documents of calculation, successfully used it in 4.6.
Necessity of use of this logic database in 6.0 has appeared, it is impossible. On www.service.sap.com have answered, that this logic database "AUK" is obsolete and is not used after version 4.0.
What to do?
Whether there is any other logic database which I could use instead of "AUK"?
Or perhaps to create the logic database having copied "AUK"?
Beforehand I thank .Hi
if you doesn't wants to use the data from AUK Logical database
then try to fetch the data from the tables related to that and use them in data fetching they are:
AUAK,AUAO,AUAB,AUAS,AUAO,AUAV etc
see the doc on LDB's
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
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fabap%2fabap-code-samples%2fldb+browser.doc
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
Re: **LDB**
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.
Regards
Anji -
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
Maybe you are looking for
-
How can I Create an individual MD5 file for each folder in a main directory?
The specs for a file delivery I'm making require an individual MD5 file per folder, with the contents of that folder being inside the MD5 file. Such as: DAY_01 (MAIN FOLDER) A01 -(files 1-1000) -md5 for files 1-1000 A02 -files 1001-2000 -md5 for file
-
Why can't I get a border-less 4x6 print with iphoto 5
I always seem do get borders on the sides of my pictures. I have done the 4x6 page set-up and the constrain to 4x6 suggestions. When I click 4x6 in the print menu it say the photo won't print. When i click one photo per page I get the borders on the
-
Our application was working fine till recently before upgarding to JDK1.3.1_03. I am having problem with Calendar Object.When I set a month, I do not seem to be getting the correct output I am pasting the sample code below. Calendar calendar=Calendar
-
Business Transaction Search for Inbox In SPRO
Hi, I am creating my own Index Table for Transaction Search in SPRO to optimize the search performance. This will be used in icweb client Inbox Search. I will remain all standard search fields and some customizing ID fields. In the SPRO, I woul
-
New computer. old computer
i just got a new laptop and just finished importing my music from the itunes on my other computer. Is it safe to delete the music and sign out of itunes on my older computer?