Data retrival error in Logical Database

Hello Gurus,
I am working on a Report on ASSET ACTIVITY BY DATE RANGE .
The program is copied from std. program S_ALR_87011990.
The above std. program displays for the whole financial year. This is modified for a particalar period range in the new leveraged program.
My question is in the below code.
We are fetching data using LDB ADA. The statement "GET anlcv" works fine here, I mean Sy-subrc is 0 and anlcv structure has some data in it.
When it comes to statement "GET anepv" in the below code, we are not getting any data into that structure and sy-subrc NE 0. Then it is skipping all the get statements and directly going to statement " PERFORM abga_simulieren.".
My logic lies in between this Get statement and the perform statement. When i see it in debugging mode my statement is not executed at all.
What needs to be done. Please anyone help me.
GET anlcv.
CHECK select-options.
MOVE anlcv TO sav_anlcv.
GET anepv.
CHECK select-options.
Nur Bewegungen des Jahres des Berichtsdatums durchlassen.
CHECK anepv-bzdat GE sav_gjbeg.
CHECK anepv-bzdat IN so_bzdat. "Added for SIR-3132
Bewegungen in SAV_ANEPV sammeln.
MOVE anepv TO sav_anepv.
APPEND sav_anepv.
GET anlb LATE.
Check auf Bestandskonto bei Gruppensummen erst hier, wegen
fehlender Abgänge/Umbuchungen
IF NOT summb IS INITIAL.
IF NOT anlav-ktansw IN so_ktanw.
REJECT 'ANLAV'.
ENDIF.
ENDIF.
ANLCV aus Save-Area zurueckholen.
CHECK NOT sav_anlcv-anln1 IS INITIAL.
MOVE sav_anlcv TO anlcv.
Abg-Simu: Abgang simulieren.
PERFORM abga_simulieren.
Promise to reward points
Regards
Mac

Hi
look at the following stuff related to LDB and do accordingly
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

Similar Messages

  • 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.

  • Data retrival error while retrival

    Dynamic calc cannot allocate more than [48] blocks from the heap.Please increase the  CalclockBlock settings and then retry.
    This is the error i am getting when i am retrive the data in excel.i have increased CALCLOCKBLOCKHIGH: increased
    CALCLOCKBLOCKDEFAULT: increased still it gives the erroe please any body help me out its urgent.
    Regards
    User 2271

    Check if the below thread helps you:
    Re: Increase CalcLockBlock setting

  • ORA-01157: cannot identify/lock data file error in standby database.

    Hi,
    i have a primary database and standby database (11.2.0.1.0) running in ASM with different diskgroup names. I applied an incremental backup on standby database to resolve archive log gap and generated a controlfile for standby in primary database and restored the controlfile in standby database.But when i started the MRP process its not starting and thows error in alert log ORA-01157: cannot identify/lock data file. When i queried the standby database file it shows the location on primary database datafiles names not the standby database.
    PRIMARY DATABASE
    SQL> select name from v$datafile;
    NAME
    +DATA/oradb/datafile/system.256.788911005
    +DATA/oradb/datafile/sysaux.257.788911005
    +DATA/oradb/datafile/undotbs1.258.788911005
    +DATA/oradb/datafile/users.259.788911005
    STANDBY DATABASE
    SQL> select name from v$datafile;
    NAME
    +STDBY/oradb/datafile/system.256.788911005
    +STDBY/oradb/datafile/sysaux.257.788911005
    +STDBY/oradb/datafile/undotbs1.258.788911005
    +STDBY/oradb/datafile/users.259.788911005
    The Actual physical location of standby database files in ASM in standby server is shown below
    ASMCMD> pwd
    +STDBY/11gdb/DATAFILE
    ASMCMD>
    ASMCMD> ls
    SYSAUX.259.805921967
    SYSTEM.258.805921881
    UNDOTBS1.260.805922023
    USERS.261.805922029
    ASMCMD>
    ASMCMD> pwd
    +STDBY/11gdb/DATAFILE
    i even tried to rename the datafiles in standby database but it throws error
    ERROR at line 1:
    ORA-01511: error in renaming log/data files
    ORA-01275: Operation RENAME is not allowed if standby file management is
    automatic.
    Regards,
    007

    Hi saurabh,
    I tried to rename the datafiles in standby database after restoring it throws the below error
    ERROR at line 1:
    ORA-01511: error in renaming log/data files
    ORA-01275: Operation RENAME is not allowed if standby file management is
    automatic.
    Also in my pfile i have mentioned the below parameters
    *.db_create_file_dest='+STDBY'
    *.db_domain=''
    *.db_file_name_convert='+DATA','+STDBY'
    *.db_name='ORADB'
    *.db_unique_name='11GDB'
    Regards,
    007

  • DATA-PUMP ERROR: ORA-39070 Database on Linux, Client on Win 2008

    Hi,
    i want to make a datapump export from client Windows 2008. I define dpdir as 'C:\DPDIR'.
    While making expdp
    expdp login\pass@ora directory=dpdir dumpfile=dump.dmp logfile=log.log full=y
    i get those errors
    ORA-39002:niepoprawna operacja
    ORA-39070:nie mozna otworzyc pliku dziennik
    ORA-29283:niepoprawna operacja na pliku
    ORA-06512:przy "sys.utl_file", linia 536
    ORA-29283:niepoprawna operacja na pliku
    (decriptions in polish)
    I found out, that datapump is saving files to the Linux Server (where database is). When i define 'C:\DPDIR' it doesn't recognize it because there is no such directory on Linux.
    How can I save datapump export dumpfile on Windows?

    tstefanski wrote:
    Hi,
    i want to make a datapump export from client Windows 2008. I define dpdir as 'C:\DPDIR'.
    While making expdp
    expdp login\pass@ora directory=dpdir dumpfile=dump.dmp logfile=log.log full=y
    i get those errors
    ORA-39002:niepoprawna operacja
    ORA-39070:nie mozna otworzyc pliku dziennik
    ORA-29283:niepoprawna operacja na pliku
    ORA-06512:przy "sys.utl_file", linia 536
    ORA-29283:niepoprawna operacja na pliku
    (decriptions in polish)
    I found out, that datapump is saving files to the Linux Server (where database is). When i define 'C:\DPDIR' it doesn't recognize it because there is no such directory on Linux.
    How can I save datapump export dumpfile on Windows?
    >Hi,
    i want to make a datapump export from client Windows 2008. I define dpdir as 'C:\DPDIR'.
    While making expdp
    expdp login\pass@ora directory=dpdir dumpfile=dump.dmp logfile=log.log full=y
    i get those errors
    ORA-39002:niepoprawna operacja
    ORA-39070:nie mozna otworzyc pliku dziennik
    ORA-29283:niepoprawna operacja na pliku
    ORA-06512:przy "sys.utl_file", linia 536
    ORA-29283:niepoprawna operacja na pliku
    (decriptions in polish)
    I found out, that datapump is saving files to the Linux Server (where database is). When i define 'C:\DPDIR' it doesn't recognize it because there is no such directory on Linux.
    How can I save datapump export dumpfile on Windows?
    expdp can only create dump file on DB Server system itself.

  • Logical database definition

    Hi Experts ,
    I am trying to execute a program with logical database .
    It is showing error that logical database is unknown.
    REPORT  ZHRTRAIN.
    tables :pernr.
    Infotypes: 0002.
    data: begin of name,
    nachn like p0002-nachn,
    vorna like p0002-vorna,
    end of name.
    select-options : nation for p0002-natio.
    GET PERNR.
      provide * from p0002 between pn/begda and pn/endda.
      check nation.
      move-corresponding p0002 to name.
      condense name.
      write : / p0002-pernr,
      name,
      p0002-natio,
      p002-gebat.
      endprovide.
    Pls tell me how to correct this error.
    Thank you.
    Regds,
    devika.

    HR Logical Databases
    In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets:
    PNP
    PAP
    PCH
    By selecting a logical database, you determine the HR data that can be reported on using an InfoSet.
    Logical Database PCH
    This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data.
    Logical Database PNP
    Use logical database PNP to report on HR master data. It is possible to use logical database PCH to access this data, but PNP meets such reporting requirements more quickly because it is best suited to the task of selecting persons.
    Logical database PNP enables you to access HR master data and infotypes from Personnel Planning. For example, you have the following options:
    Reporting on the costs, number of attendees booked, and instructor for a business event on which an employee is booked
    Reporting on working time and planned compensation for a position that an employee occupies
    Reporting on the validity and proficiency of a qualification that an employee fulfils
    From a technical perspective, this means you can use PNP to report on all of the infotypes that exist for objects (infotype 1000) that have a direct relationship (infotype 1001) with the Person object.
    The ability to access infotypes from Personnel Planning using logical database PNP is a special feature that you can only use in the context of SAP Query and Ad Hoc Query. You cannot use this functionality for ABAP reports you programmed yourself.
    You can also use logical database PNP to report on data from Personnel Time Management (infotypes 2000 to 2999) and Payroll (special payroll infotypes for the USA and customer infotypes; for more information, access Customizing for the Human Resources Information System and see Payroll Results).
    Logical Database PAP
    Logical database PAP enables you to access data from Recruitment.
    See also:
    HR InfoSets for InfoSet Query
    InfoSets in the HR Application

  • HR Logical Database

    Hi,
      Is it common to use logical database for HR report??  How about other module such as SD/MM??
    Regards,
    Kit

    Hi,
    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.
    However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area.
    Logical Databases - Views of Data
    A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database.
    The data structure in a logical database is hierarchical. Many tables in the R/3 System are linked to each other using foreign key relationships. Some of these dependencies form tree-like hierarchical structures. Logical databases read data from database tables that are part of these structures.
    The diagram illustrates how the R/3 System might represent the structure of a company. A logical database can read the lines of these tables one after the other into an executable program in a sequence which is normally defined by the hierarchical structure. The term logical database is sometimes used to mean not only the program itself, but also the data that it can procure.
    Tasks of Logical Databases
    As well as allowing you to read data from the database, logical databases also allow you to program other tasks centrally, making your application programs less complicated. They can be used for the following tasks:
    Reading the same data for several programs.
    The individual programs do not then need to know the exact structure of the relevant database tables (and especially not their foreign key relationships). Instead, they can rely on the logical database to read the database entries in the right order during the GET event.
    Defining the same user interface for several programs.
    Logical databases have a built-in selection screen. Therefore, all of the programs that use the logical database have the same user interface.
    Central authorization checks
    Authorization checks for central and sensitive data can be programmed centrally in the database to prevent them from being bypassed by simple application programs.
    Improving performance
    If you want to improve response times, logical databases permit you to take a number of measures to achieve this (for example, using joins instead of nested SELECT statements). These become immediately effective in all of the application programs concerned and save you from having to modify their source code
    Reward Points if useful
    Raghunath.S
    9986076729

  • Cost center relationship in PCH logical database

    Hi Experts .
    According to what I knew theoretically ,
    External objects such as cost centers or users do not store data in the PCH logical database .
    But I created a position and Idid a cost assignment using relationship A11 to a cost center and went to SE36 and ran PCH for the selection of current plan version and object type K and object id of the cost center .
    After running for the evaluation path KOSTDIUP ( Account assignment usage ) , I could see the relationship of cost center with the earlier created position .
    So if relationships of cost center are not supposed to be in PCH logical database , then how come I can see the above result ?
    Thanks
    Rishabh

    This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data.
    The Organizational Management uses the PCH logical database
    so S-Position is an object in OM, you can see the relationship.
    correct me if i am wrong !!
    regards,
    mohammed

  • What are structures of logical database.

    hi
    what are structures of logical database.

    Dear Chaitanya,
    The structure of LDB can be divided into three sections:
    >Structure
    >Selection
    >Database Program
    STRUCTURE:
    The structure defines the data view of the logical database. It adopts the hierarchy of the database tables defined by their foreign key relationships. This also controls the sequence in which the tables are accessed. It determines the structure of the other components and the behavior of the logical database at runtime.
    The structure of a logical database is usually based on the foreign key relationships between hierarchical tables in the SAP System. Logical databases have a tree-like structure, which can be defined as follows:
    · There is a single node at the highest level. This is known as the root node.
    · Each node can have one or several branches.
    · Each node is derived from one other node.
    The nodes must be structures defined in the ABAP Dictionary or data types from a type group. Normally, these are the structures of database tables which the logical database reads and passes to the user for further evaluation. However, it is also possible, and sometimes useful, to use ABAP Dictionary structures without an underlying database. For technical reasons, the maximum number of nodes allowed in the structure of a logical database is 300.
    Any executable ABAP program that has a logical database linked to it can contain a GET statement for each node of the structure. When you run the program, the corresponding event blocks are processed in the sequence prescribed by the hierarchical structure of the logical database. If a program does not contain a GET statement for every node of a logical database, the processing passes through all the nodes that lie in the path from the root to the nodes specified by GET statements.
    If you call a logical database using the function module LDB_PROCESS, the depth to which the system reads is controlled by an interface parameter.
    SELECTIONS:
    The selections define a selection screen, which forms the user interface of the executable programs that use the logical database. Its layout is usually determined by the structure. You can adapt the selections to your own requirements and also add new ones. When you link a logical database to an executable program, the selections of the logical database become part of the standard selection screen of the program (screen number 1000). If you call a logical database using the function module LDB_PROCESS, the selections are filled using interface parameters.
    The selections in a logical database are defined using the normal statements for defining selection screens, that is, PARAMETERS, SELECT-OPTIONS and SELECTION-SCREEN. In a logical database, you can also use the additions VALUE-REQUEST and HELP-REQUEST to define specific input and value help. You define the selection screen in a special include program known as the selection include.
    When you write programs using a logical database, you can also add your own program specific selections. The standard selection screen then contains the database-specific selections, followed by the program-specific selections that you have defined.
    When the system generates the selection screen for an executable program, database-specific selection criteria and parameters are only displayed if you have declared an interface work area for them in your program using the NODES or TABLES statement.
    Suppose you have a selection include containing the following lines:
    SELECT-OPTIONS slifnr FOR lfa1-lifnr.
    PARAMETERS pbukrs LIKE lfb1-bukrs FOR TABLE lfb1.
    The selection criterion SLIFNR is linked to table LFA1, the parameter PBUKRS to table LFB1. If the TABLES statement in an executable program (report) declares LFA1 but not LFB1, SLIFNR is displayed on the selection screen, but PBUKRS does not appear.
    The selection screen of a logical database can contain dynamic selections as well as static ones. Dynamic selections are extra, user-defined selections that the user can make as well as using the static selections defined in the selection include. To improve performance, you should always use this option instead of reading more data than you need and then sorting it out in the application program.
    To make dynamic selections available for the node nodeof a logical database, the selection include must contain the following statement:
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE node.
    If the node node is requested by the user of the logical databases, the dynamic selections are included in the selection screen. A user can then choose Dynamic selections to enter extra selections for the corresponding fields. If you call the logical database using the function module LDB_PROCESS, you can pass a corresponding parameter. You can use these selections in dynamic statements in the logical database program to read data. The values of the program-specific selection criteria that you defined for a node for which dynamic selections were available are also passed to the logical database. The user can also define the fields for dynamic selections as a selection view for the logical database.
    The selection screen of a logical database is part of the standard selection screen (number 1000) of the executable program to which the logical database is attached. It has a standardized layout - the selection criteria and parameters appear on separate lines in the order in which they were declared. You can change the layout using the SELECTION-SCREENstatement.
    The runtime environment generates the selection screen with number 1000 for every program in which the attributes do not contain a different selection screen version. You can prevent certain input fields from the selection screen of a logical database from appearing on the selection screen by defining selection screen versions with a screen number lower than 1000 in the selection include, and entering this version number in the program attributes. By pressing F4 there, you can get an overview of the selection screen versions defined in the logical database concerned. To define a selection screen version, use the statements SELECTION-SCREEN BEGIN|END OF VERSION. Within these statements you can use SELECTION-SCREEN EXCLUDEto specify fields that you do not want to appear on the selection screen.
    If the attributes of an executable program contain the number of a selection screen version, the version is used in the standard selection screen. Although the input fields that you excluded from the selection screen are not displayed, the corresponding selections still exist, and you can still edit them in the program or by calling the function module LDB_PROCESS.
    DATABASE PROGRAM:
    The database program contains the ABAP statements used to read the data and pass it to the user of the logical database. There is a container for special subroutines into which, amongst other things, the data from the database tables is read. These subroutines are called by the reporting processor in the runtime environment in a sequence that has been predefined by the structure. The database program is determined by the structure and selections and can be adapted or expanded to meet your requirements.
    The name of the database program of a logical database ldbconforms to the naming convention SAPDBldb. It serves as a container for subroutines, which the ABAP runtime environment calls when a logical database is processed. The sequence of the calls and their interaction with the events in executable programs or the function module LDB_PROCESS depends on the structure of the logical database.
    A logical database program usually contains the following subroutines:
    · FORM LDB_PROCESS_INIT
    Called once only before the logical database is processed. It prepares it to be called more than once by the function module LDB_PROCESS.
    · FORM INIT
    Called once only before the selection screen is processed.
    · FORM PBO
    Called before the selection screen is displayed, each time it is displayed. Consequently, it is only called when you use the logical database with an executable program, not with the function module LDB_PROCESS.
    · FORM PAI
    Called when the user interacts with the selection screen. Consequently, it is only called when you use the logical database with an executable program, not with the function module LDB_PROCESS. The interface parameters FNAME and MARK are passed to the subroutine.
    FNAME contains the name of a selection criterion or parameter on the selection screen.
    MARK describes the selection made by the user: MARK = space means that the user has entered a simple single value or range selection. MARK = '*' means that the user has also made entries on the Multiple Selection screen.
    · FORM LDB_PROCESS_CHECK_SELECTIONS
    Called instead of the subroutine PAI if the logical database is called using the function module LDB_PROCESS without a selection screen. This subroutine can check the selections passed in the function module interface.
    · FORM PUT_node
    Called in the sequence defined in the structure. Reads the data from the node nodeand uses the
    PUT node.
    statement to trigger a corresponding GETevent in the ABAP runtime environment. The PUT statement is the central statement in this subroutine: It can only be used within a subroutine of a logical database. The logical database must contain the node node, and the subroutine name must begin with PUT_node. The PUT statement directs the program flow according to the structure of the logical database. The depth to which the logical database is read is determined by the GET statements in the application program or the interface parameter CALLBACK of the function module LDB_PROCESS.
    First, the subroutine PUT_root is executed for the root node. The PUT statement then directs the program flow as follows:
    i. If the database program contains the subroutine AUTHORITY_CHECK_node, the first thing the PUT_node statement does is to call it.
    ii. Next, the PUT statement triggers a GET event in the runtime environment. If there is a corresponding GET nodestatement in the executable program to which the logical database is linked, the associated event block is processed. If the CALLBACK parameter of the function module LDB_PROCESS is filled accordingly, the corresponding callback routine is called.
    iii. The PUT statement directs the program flow
    (a) To the next subroutine of a node that follows directly, if a lower-level node (not necessarily the very next) in the same subtree is requested by GET in the executable program or in the function module.
    (b) To the subroutine of a node at the same level, if the preceding node branches to such a node and if a GET statement exists for such a node in the executable program or the function module.
    The PUT statement in that subroutine starts again at step (i). In the subroutine of the lowest node in a subtree to be processed using GET, the program control does not branch further. Instead, the current subroutine is processed further. When a subroutine PUT_node has been executed in its entirety, the program flow returns to the PUTstatement from which it branched to the subroutine PUT_node.
    iv. When control has returned from a lower-level subroutine PUT_node, the PUTstatement triggers the event GET node LATEin the runtime environment.
    · FORM AUTHORITY_CHECK_node
    Called automatically by the PUT node statement. In this subroutine, you can specify authorization checks for the appropriate node node from the structure of the logical database.
    · FORM PUT_ldb_SP
    Called when the user makes a selection using a search help to process the key chosen in the search help. ldb is the name of the logical database. From this subroutine, you can use the entries in the search help tables to read the relevant entries from the root node root. The processing in the program can then be triggered using PUT root. The subroutine PUT_root is then not called automatically.
    · FORM BEFORE_EVENT
    Called before an event, the name of which is passed in the parameter EVENT. Currently, the EVENT field can only contain the value START-OF-SELECTION, to call a subroutine before this event.
    · FORM AFTER_EVENT
    Called after an event, the name of which is passed in the parameter EVENT. Currently, the EVENT field can only contain the value END-OF-SELECTION, to call a subroutine after this event.
    · FORM par_VAL, selop_VAL, selop-LOW_VAL, selop-HIGH_VAL
    Called when the user calls possible values help for the parameter par or the selection criterion selop. These must belong to the selections in the logical database.
    · FORM par_HLP, selop_HLP, selop-LOW_HLP, selop-HIGH_HLP
    Called when the user calls possible values help for the parameter par or the selection criterion selop. These must belong to the selections in the logical database.
    Example
    Suppose that in the logical database structure, LFB1 is a branch of LFA1.
    and that the following selection criteria are defined in the selection include:
    SELECT-OPTIONS: slifnr FOR lfa1-lifnr,
    sbukrs FOR lfb1-bukrs.
    A section of the database program would then read:
    FORM put_lfa1.
    SELECT * FROM lfa1
    WHERE lifnr IN slifnr.
    PUT lfa1.
    ENDSELECT.
    ENDFORM.
    FORM put_lfb1.
    SELECT * FROM lfb1
    WHERE lifnr = lfa1-lifnr.
    AND bukrs IN sbukrs.
    PUT lfb1.
    ENDSELECT.
    ENDFORM.
    An executable program (report) linked to the logical database could contain the lines:
    GET lfa1.
    WRITE lfa1-lifnr.
    GET lfb1.
    WRITE lfb1-bukrs.
    In this example, the runtime environment calls the routine put_lfa1 after the event START-OF-SELECTION. The event GET lfa1 is triggered by the statement PUT lfa1.
    Once the corresponding event block in the program is complete, PUT lfa1 branches to the subroutine put_lfb1.
    From this subroutine, the event GET lfb1 is triggered in the application program. If LFB1 is the last node to be read, processing resumes with the SELECTloop in put_lfb1. Otherwise, the program flow moves to the subroutine put_node of the next node. At the end of the SELECT loop of the last node, processing resumes in the SELECTloop of the node at the next level up. The example of programming using nested SELECT loops is only used to make the program flow clearer. In a real logical database, you would avoid doing this in order to minimize the number of database accesses.
    Regards,
    Rajesh K Soman
    Please reward points if helpful.

  • How to execute the logical database.

    how to execute the logical database.

    There are two ways of using a logical database - either by linking it with the executable program(specify the LDB name in the program attributes) or by using the function module LDB_PROCESS.
    1.Data read by the logical database is passed back to the program using the interface work areas.Use GET statements in the report.
    GET events are implemented internally as FORM routines.
    2.If you call the logical database using the above function module, the selection screen of LDB is not displayed.It uses special subroutines called callback routines, which are called by the function module and filled with the required data.
    Please refer the following link for more details.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • How to call logical database

    hi friends,
        plz explain me how to call logical database in a report program?

    hi,
    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.
    However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area.
    Logical Databases - Views of Data
    A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database.
    The data structure in a logical database is hierarchical. Many tables in the R/3 System are linked to each other using foreign key relationships. Some of these dependencies form tree-like hierarchical structures. Logical databases read data from database tables that are part of these structures.
    Advantages of Logical database -
    1) No need of programming for retrieval , meaning for data selection
    2) Easy to use standard user interface, have check completeness of user input.
    Disadvantages
    1) Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.
    GO THROUGH THE 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
    Use Tcode SE36 For creating Logical Database.
    Here is a simple Program on Logical database.
    NODES: spfli,sflight.
    START-OF-SELECTION.
    WRITE 'Test Program for GET'.
    *Fetching SPFLI table
    GET spfli.
    WRITE: / 'Carrid:', spfli-carrid,
    'Connid:', spfli-connid.
    *Fetching SFLIGHT table
    GET sflight.
    SKIP 5.
    WRITE: / 'Carrid:', sflight-carrid,
    'Connid:', sflight-connid.
    logical database
    logical database
    http://help.sap.com/saphelp_nw04/helpdata/en/60/183d78163011d2953c0000e8353423/frameset.htm
    general
    example program
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9be035c111d1829f0000e829fbfe/frameset.htm
    regards,
    pavan
    REWARD POINTS IF USEFUL

  • STRUCTURES of LOGICAL DATABASE?

    STRUCTURES of LOGICAL DATABASE?
    please explain

    hi,
    Logical Databases
    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.
    However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area.
    Logical Databases - Views of Data
    A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database.
    The data structure in a logical database is hierarchical. Many tables in the R/3 System are linked to each other using foreign key relationships. Some of these dependencies form tree-like hierarchical structures. Logical databases read data from database tables that are part of these structures.

  • How to find Oudated Logical Database

    Hello,
    How to findout wheather a  Logical Database is outdated or not.
    Anyone have idea for replace LDB TIF with new LDB.
    Waiting for response,
    Reg

    There are two ways of using a logical database - either by linking it with the executable program(specify the LDB name in the program attributes) or by using the function module LDB_PROCESS.
    1.Data read by the logical database is passed back to the program using the interface work areas.Use GET statements in the report.
    GET events are implemented internally as FORM routines.
    2.If you call the logical database using the above function module, the selection screen of LDB is not displayed.It uses special subroutines called callback routines, which are called by the function module and filled with the required data.
    Please refer the following link for more details.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

  • Runtime error while creating logical database report pgm

    Hi,
        I have started doing pgm on Logical Database report using VBAK,VBAP and MARA. I took VBAK as the root node and VBAP& MARA  as subnodes. The actual requirement is:-  I am trying to place these tables in Application server for perfromance issue using Logical database. Based on sales, the items need to be be displayed. And based on Items, the material data should be displayed.So root node here is VBAK.
    I have created these 3 nodes in SE36 tx.code. when I go back to se36 main screen and under "subobjects"  ,I've selected "selections". I got a dialog box saying that "Nodes for which free selections are to be made". I have clicked on the radio buttons.And then clicked on "transfer" . I am getting a runtime error . Please let me know the solution.
        Please do send me the actual process to goon with logical database reporting.

    Hello
    Logically speaking, a company code can have more than one FSV as long as they share the same chart of accounts.
    When COA is common, the FSV pattern can be designed seperatly to serve the purpose of varied reporting.
    The dump you are getting is a temporary snag. Take a screen shot from SM54 after you execute the report and pass it to BASIS for analysis. They would fix that.
    Reg
    assign points if useful

  • How to retrieve data using logical database and custom select options

    Hi all,
    I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
    Thanks in advance.

    Hai Gupta
    Check the following Document & Links
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Sreeni

Maybe you are looking for