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 Gu

Transaction 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

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
    saurabh

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

  • 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?
       Thanks

    Hi 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 create the logical file name

    Hi All,
        I have requirement where i need to post the Inventory Management data. for this i need to execute std. program RM07MMBL which is having logical file name in the selection screen. but i have placed my input file in application server.
       Can any one tell how to create the Logical filename which refers the physical path. I also tried <b>t-code SF01 & Table - FILENAMEC</b>I and found that we need to add an entry in this table but i really dont know how we have to do since this table cannot be maintained in SM30 also..
      Help Me.
      Thanks in Advance!...
    Regards,
    Ramkumar

    Hi Ram,
    Try using FILE transaction code...
    Follow these steps to create:::
    Double click on Logical file Path Definition
    Click on New Entries,
    Give Logical file Path name as Z_LOGICAL PATH and save it
    now choose this path and double click on Assignemt of Physical path to Logical path
    double click on the OS name
    Give some description and give some Physical path name from AL11 transaction and save it
    Now Double click on Logical File Name Definition,
    Click on New Entries,
    Give some logical file name: Z_LOGICAL_FILENAME
    Physical file: test
    Data Format: BIN
    Logical Path: Z_LOGICAL PATH
    Hope this helps
    Regards,
    Phani
    Message was edited by:
            Sivapuram Phani Kumar

  • How to create tree by database table

    hello sir ,
    my table is as follows,
    NAME LINK ID PID ROLLID
    User mgt. f?p=131:1: 1 - 10 ////root node///
    district 10 1 1 child
    Roles 16 14 4 child
    Users 11 10 1 child
    ROLLID is given from another table whis is (ROLES). i making tree by the combinations of id , pid, & roll id. by the roll id i can manage the tree to do not display specific nodes to specific users.
    ROLE table as :
    ROLE_ID NAME DESCRIPTION
    1 Administrator This is administrator
    2 Assistant Director -
    3 Assistant Statistical Officer -
    4 Data Entry Operator -
    but i think it is very complicated process . give me solution about it
    also i have to give my images to each node. how can i do that?

    You already have a thread going about this: Re: how to create tree by database table .
    Scott

  • How to create a logical file

    Hi,
    Please help me, i just want to know how to create a logical file and wht is the procedure to assign a physical file to the created logical file.

    Hi Abdul,
    Here is the process to create Logical File Path.
    1)Go to tcode FILE.
    2) Click on Logical File Path Definition. Give name "ZTEST" and some description.
    3) Click on Assignment of Physical Path to Logical Path. and provide Syntax Group and physical path.
    4) Click on Logical File Name Definition and give descrition, physical filename, Data format as ASC, Application area and logical path which you have created.
    Please check this links.
    Using Logical Files in ABAP Programs
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95e635c111d1829f0000e829fbfe/content.htm
    Creating and Defining Logical Filenames
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3df8358411d1829f0000e829fbfe/content.htm
    Regards,
    Priyanka.

  • How to create a standby database?

    I am running Oracle 8.1.5 on Sun Solaris. How to create a standby database? Can somebody tell me the step-by-step procedure?

    Can you tell what version of Oracle you are running, because the steps can vary depending on your version.

  • How to create a new database in SUP

    Hi,
    Iam using SUP 2.1 ESD#1 licensed version
    How to create a new database other than the default sampleDB.
    Thanks,
    B.Ushasri

    Hi B.Ushasri,
    This is actually pretty easy.
    1) open the Unwired Workspace (SDK in eclipse).
    2) Bottom right, add a new Database connection with the following details:
               Sybase ASA v12.x,
               host=Your Sup box,
               port=5500,
               user=dba
               password= Your password (default = dba)
    3) Once you connect successfully, right click on the connection and choose the "Create database" option.
    That should do it for you. It is the same connection as the sampleDB connection so if you already have that defined then its a simple, right click on it once connected and hit create database.
    Hope that helps,
    Brenton.

  • How to Create A new Database in the oracle 10g XE

    i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

    Hi there 785434,
    (This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
    Moderator, please move this if able
    I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
    Example:
    CREATE TABLE TEST
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE
    LOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE TABLE TEST_HISTORY
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE,
    CHANGE_DESCRIPTION
    NOLOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE OR REPLACE TRIGGER TRG_BU_TEST
    BEFORE UPDATE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
    END;
    CREATE OR REPLACE TRIGGER TRG_BD_TEST
    BEFORE DELETE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
    END;
    Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
    Note that this method might not be suitable for very high transaction rates.
    You will need to 'clear' these history tables as part of routine maintenance.
    Hope that this Helps.
    Ronald.

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

  • How to create User and Database in different Table spaces

    How to create User and Database in different Table spaces using oracle 10g
    Regards
    daya

    I am sorry but your question does not seem to make much sense.
    Can you please rephrase your question?

  • 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 create physical standby database without dataguard

    Hi,
    Can anyone please help me how to create Physical Standby Database without dataguard. As i am using Oracle 10.2.0.1 Standard Edition for production databases.
    Please find the specifications of my server :
    Database : Oracle 10.2.0.1(Standard Edition)
    Server : Linux 4.0(32 bit machine)
    As we know that Dataguard cannot be created in Standard Edition as we dont have that option in this edition. So please help me how to create the physical standby database.
    Thanks in advance.
    Regards,
    Farooq

    Hello,
    I hope this link helps you out...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rcmbackp.htm
    http://www.dbasupport.com/oracle/ora10g/manual_standby.shtml
    Thanks & Regards
    Pratik Lakhpatwala
    Jr Oracle DBA
    Edited by: Pratik.L on Dec 31, 2009 12:03 PM

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • How to create a Cloning Database

    Dear all,
    Would you plz help me with How to create a Cloning Database in Oracle9i and Windows 2000 Server
    and how to automatically synchronize the cloned database with data
    Thanks,
    Ahmed Abd El Latif

    Oracle Data Guard Concepts and Administration
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96653/toc.htm
    theres the answer to your question.
    In big detail.
    i hope it helps

Maybe you are looking for