ABAP-ABAPDictionaryFAQ-051213-0818-9486

download ABAP-ABAPDictionaryFAQ-051213-0818-9486

of 7

Transcript of ABAP-ABAPDictionaryFAQ-051213-0818-9486

  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    1/7

    1.2.3.4.5.6.7.8.

    ABAP Dictionary FAQWhat types of objects can be created in the ABAP Dictionary?What types of tables can be created in the ABAP Dictionary?Which field differentiates a table from client-dependent and client-independent?What is the difference between pooled tables and cluster tables?What is the difference between Database tables and Views?What are the different types of Views?Can I use all the views in the ABAP program ?What is Table Maintenance Generator?What is One step, two step in Table Maintenance Generator?How do you activate the database table after making changes to it?In which table are the programs stored in?I have recently added a few fields to a custom table. But I don't get these fields in the table maintenance program?What is the difference between INSERT and MODIFY?What is the difference between Modify and Update?How do I create index on a database table?What is the difference between Check Table and Value Table?When Value table becomes check table?What is the difference between Domain and Data Elements?When I create new entries in the table the field values are always in Uppercase. How do I get the data with mixed case?

    What is the need of reference table and reference field in Currency/Quantity fields?Where to find the table of tables?How to add new fields in standard table ?How to create the Table Maintenance Generator?In which table can we find the Report Source Code?What is the difference between Transparent tables and Pooled tables?What is a Data Element?What is a Matchcode?What tables contain DDIC objects?What are Lock Objects?What is significance of table maintenance attribute?Where to find the relationships between different database tables ?

    What types of objects can be created in the ABAP Dictionary?Tables - Transparent Table, Pooled Table, Clustered TableViews - Database View, Projection View, Maintenance View, Help ViewData Types -Data Elements, Data Structures,Table TypesType GroupsDomainsSearch HelpsLock ObjectsMatchcodes

    back to top

    What types of tables can be created in the ABAP Dictionary?

    Transparent Tables: Exist with the same structure both in dictionary and in database exactly with the same data and fields.Pooled Tables: These are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to storecontrol data. Several pooled tables can be combined in a table pool. The data of these pooled tables is then sorted in a common table inthe database. The basic idea of the table pool is the storage of data records from the tables defined in ABAP dictionary that are notdependent on one another. Intersection of key fields of the tables which are combined is empty. Example - RFCDOCCluster Tables: Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can beused to store control data. They can also be used to store temporary data or texts, such as documentation. The idea of cluster tables isthat you store functionally dependent data which is divided among different tables in one database table. Accordingly, the intersection ofthe key fields of the cluster tables is formed by the key of the table cluster(cluster key). Exaple - CDPOS

    Check this link for more info:- http://help.sap.com/saphelp_nw70/helpdata/EN/4f/991f82446d11d189700000e8322d00/frameset.htm

    http://help.sap.com/saphelp_nw70/helpdata/EN/4f/991f82446d11d189700000e8322d00/frameset.htmhttp://help.sap.com/saphelp_nw70/helpdata/EN/4f/991f82446d11d189700000e8322d00/frameset.htm
  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    2/7

    back to top

    Which field differentiates a table from client-dependent and client-independent?

    Client-dependent tables contains a column of type CLNT as the first key field. This field is often named MANDT (and less often CLIENT).Client-independent tables do not have this field. These last can be accessed from any client unlike client-dependent tables.

    Unknown macro: {gliffy}

    When open SQL ABAP statements apply to a client-dependent table, SAP automatically adds the client selection in the WHERE clause. For

    example SELECT * FROM mara WHERE matnr LIKE '1%' will be automatically translated into SELECT * FROM mara WHERE mandt = sy-mandtAND matnr LIKE '1%' (where sy-mandt is the client where the program runs). If you try to do client selection yourself, it is ignored, except if youadd the CLIENT SPECIFIED keyword.

    back to top

    What is the difference between pooled tables and cluster tables?

    Cluster tables and Pooled tables have many to one relationship with the underlying database.A table pool or table cluster should ideally be used for storing control information such as screen number sequences, small program data anddocumentation. Data used for business transactions should be stored in transparent tables

    A table pool corresponds to a table in the database in which all records from the pooled tables assigned to it are stored.Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.

    A pooled table cannot have the name having more than 10 characters.All the key fields of the pooled table must be of character data type.In pooled tables, the maximum length of the key field/data fields should not exceed the length of varkey/vardata of the pool respectively.Pooled tables have 2 key fields tabname(Holds the name of pooled table, its CHAR of length 10) and varkey(Contains all key fields of thecorresponding table ,its CHAR max length 110). Tabname and varkey are used to retrieve data.They also have Dataln(Contains length of the content in the field,its INT2 type) and Vardata (This is where actual data of a field is stored)

    In cluster table the records having the same key are stored in a single key in the cluster.If there is an overflow of the data records a continuation record is created with the same table key.Detailed information on pooled and cluster table can be found at http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm

    Unknown macro: {gliffy}

    A cluster table has the following structure:

    Field Data type Meaning

    CLKEY1 * First key field

    CLKEY2 * Second key field

    ... ... ...

    CLKEYn * nth key field

    Pageno INT2(5) Number of the continuation record

    Timestamp CHAR(14) Time stamps

    Pagelg INT2(5) Length of the string in Vardata

    Vardata RAW

    Contains the entries from the data fields ofthe assigned cluster tables as a string, max.length n depends on the database systemused

    back to top

    What is the difference between Database tables and Views?

    The Table has a physical storage of data whereas views do not have physical storage of data.

    Unknown macro: {gliffy}

    Unknown macro: {gliffy}

    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htmhttp://wiki/display/HOMEhttp://wiki/display/HOMEhttp://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm
  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    3/7

    The view is derived from one or more tables which is created only with the required fields from the database table(s). It can also be created withtable inner joins and specifying conditions for data retrieval.

    back to top

    What are the different types of Views?

    Projection view - Just retrieves some fields from a single table.Help View - This is used for search help.

    Database View - This is inner join view of one or more tablesMaintenance View - Helps in creating maintaining data of the application object. The data can be distributed among several tables.

    Check this link for more info:- http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm

    back to top

    Can I use all the views in the ABAP program ?

    No. You can use only projection view or database view in your ABAP program.

    back to top

    What is Table Maintenance Generator?

    The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table.Adatabase table can be manipulated by a program or manually.In SE11 under delivery and maintenance if 'Table maintenance allowed' is selected . We can manually enter entries using SE16 or tablemaintenance generator screen.This can be accessed using transaction SE54 or SM30 (Maintain Table Views Initial screen) in SE11 using the menu Utilities->TableMaintenance Generator.

    back to top

    What is One step, two step in Table Maintenance Generator?

    This specifies the screens to be created in the Table Maintenance Program.

    Single step: Only overview screen is created i.e.the Table Maintenance Program will have only one screen where you can add, delete or edit records.

    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and canfurther go on to edit further details.

    back to top

    How do you activate the database table after making changes to it?

    After making changes to the table, in order to reflect the changes go to transaction SE14 and Choose Edit and then choose Activate and AdjustDatabase.

    OR

    You can directly activate it from the SE11. Goto Utilities-> Database Object -> Database Utility -> Activate and Adjust Database.

    back to top

    In which table are the programs stored in?

    The programs are stored in the table TADIR and the development class packages in TDEVC.

    back to top

    I have recently added a few fields to a custom table. But I don't get these fields in the tablemaintenance program?

    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm
  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    4/7

    You have to delete and recreate your own existing table maintenance program to see your new fields.

    I had faced similar problem, I re-generated the view maintenance and I could see newly added fields in the maintenance program.

    back to top

    What is the difference between INSERT and MODIFY?

    Whenever you need to create new records in the database table use INSERT. Whenever using INSERT be sure that a duplicate entry having thesame values for the primary key fields are not present. Else it may throw a dump.

    When you use MODIFY it makes a check for the matching key field values. If present it modifies the matching record, else it creates a new recordin the database table.

    Possible syntaxes for INSERT:

    INSERT INTO dbtab VALUES waINSERT dbtab FROM waINSERT dbtab FROM TABLE itabPossible syntaxes for MODIFY:MODIFY dbtab FROM waMODIFY dbtab FROM TABLE itab

    back to top

    What is the difference between Modify and Update?

    Update will update the existing records in the table. Whereas Modify will modify/update the existing records and if the record is not found then therecord will be inserted.

    Possible syntaxes for UPDATE:

    UPDATE dbtab SET column1 = field1 [column2 = field2, etc.] WHERE logexpUPDATE dbtab FROM waUPDATE dbtab FROM TABLE itab

    back to top

    How do I create index on a database table?

    Go to transaction SE11, open your database table. Choose the menu, Goto->Indexes to create index. Give your index name and choose thefields of the table. Be careful, an additional index may vanish with the next upgrade or hotpackage.

    back to top

    What is the difference between Check Table and Value Table?

    The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown inthe input help for the referenced field.

    If you use a check table to check values, only data that is stored in database tables is used in the check. If the allowed values are restricted due toinheritance or dependencies while you are classifying an object, these restrictions are not checked.

    The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not usedin the Input Help.

    When you define a domain that all the table fields or structure components referring to this domain should be checked against a certain table. Thisinformation can be stored in the domain by entering a value table.

    The basic difference between value table and check table is check table can be used as a input help for a field on which check table is assigned.Value table contents are never used for input help.

    back to top

    When Value table becomes check table?

  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    5/7

    While establishing foreign key relation between check table and foreign key table if at the domain level value table is provided then the system willpropose that value table as check table if you accept this proposal then value table will becomes check table.

    back to top

    What is the difference between Domain and Data Elements?

    The Domain specifies the Technical attributes of the field such as the data type, length and the value range.

    A data element describes either an E or a R .lementary Type eference Type

    An is defined by the built-in data type, length and possibly the number of decimal places. These type attributes can either beElementary Type defined directly in the data element or copied from a domain .A defines the types of reference variables in ABAP programs.Reference Type back to top

    When I create new entries in the table the field values are always in Uppercase. How do I get the datawith mixed case?

    The reason for this is that the Domain for the field in the table might have Lowercase checkbox unchecked. Check the Lowercase checkbox topreserve the case of your data.

    back to top

    What is the need of reference table and reference field in Currency/Quantity fields?The reference table and reference field are the fields which specify the currency key or Unit of Measure. Suppose if the user specifies a currencyamount say 1000$, the currency amount field would indicate the amount 1000 and the currency key indicates that the currency specified is inDollars.

    back to top

    Where to find the table of tables?

    DD02L is the table which stores all the table names

    How to add new fields in standard table ?

    Create Z-Structure with the fields needed and append the structure to the standard table by using the option append structure within table display.

    We can enhance the standard tables by using Append structures and customizing includes.

    Append structures allow you to attach fields to a table without actually having to modify the table itself. Table enhancements using appendstructures therefore do not have to be planned by SAP developers. An append structure can only belong to exactly one table.

    In contrast, includes allow you to use the same structure in multiple tables. The include statement must already exist in the SAP table or structure.Table enhancements using includes do, however, have to be planned by SAP developers.

    back to top

    How to create the Table Maintenance Generator?

    After creating the table in the menu click on Utilities -> TMG (or transaction code ). There Enter the authorization group like &NC&. Enter one

    existing function group. Give package name. Select the radio button One step if you want to display entries in one screen or Two step if you wantto display entries in two screens. Click on Find screen numbers button in application tool bar.Select the radio button propose or some thing toassign one screen to your new TMG. Click on create.

    back to top

    In which table can we find the Report Source Code?

    Table REPOSRC contains the Report Source Code, but it can be correctly read only by READ REPORT abap statement.

    http://wiki/display/HOMEhttp://wiki/display/HOME
  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    6/7

    What is the difference between Transparent tables and Pooled tables?

    Transparent tables :

    It has a one- to- one relationship with a table in the database.Transparent tables are used to hold Application data is the master data or transaction data used by an application.application data.Example of Master data : Material master (MARA)Example of transaction data : Purchase ordersTransparent tables are probably the only type of table we will ever create.Pooled tables :It has many-to-one relationship with a table in the database.Used to hold system data, such as System configuration information, or historical and statistical data.It is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It can only hold pooledtables.Pooled tables are primarily used by SAP to hold customizing data.During initial implementation of the system the data in the customizing tables is set up by a functional analyst.A table in the database in which all records from the pooled tables assigned to the table pool are stored corresponds to a table pool.

    A pool has the following structure:

    Field Data type Meaning

    Tabname CHAR(10) Name of pooled table

    Varkey CHAR ( n ) Contains the entries from all key fields of thepooled table record as a string, max. lengthfor n is 110

    Dataln INT2(5) Length of the string in Vardata

    Vardata RAW ( n ) Contains the entries from all data fields of thepooled table record as a string, max. length ndepends on the database system used

    If a pooled table record is saved, it is stored in the table pool assigned. The name of the pooled table is written to the field . TheTabname contents of all key fields of the pooled table are written as a string to field and the contents of all data fields as a string to field .Varkey Vardata The length of the string stored in is entered in field by the database interface.Vardata Dataln

    What is a Data Element?

    This defines Field label name and Field Label length.

    A data element describes either an or a .elementary type reference type

    An elementary type is defined by the built-in data type, length and possibly the number of decimal places.

    A reference type defines the types of reference variables in ABAP programs.

    What is a Matchcode?

    This is just another kind of search help provided by the ABAP Workbench via ABAP Dictionary. It is defined in ABAP Dictionary. This wasreplaced by search help from 4.0 above.

    Before 4.0 input helps were defined by creating matchcodes and help views, these objects are converted to search helps with the same name.

    An elementary search help can be created by using a matchcode ID. And collective search help is created by using a matchcode object. WhenMatchcodes are attached to input fields these attachments are converted to the collective search helps to the corresponding screen fields.

    back to top

    What tables contain DDIC objects?

  • 8/13/2019 ABAP-ABAPDictionaryFAQ-051213-0818-9486

    7/7

    1. TADIR - Directory of Repository Objects2. DD01L - Domain3. DD02L - Tables4. DD03L - Table Fields5. DD04L - Data Elements6. DD06L - Pool/Cluster structures7. DD07L - Fixed values for Domains8. DD08L - Relationship definitions9. DD09L - Technical Settings of tables10. DD12L - Secondary Indexes11. DD23L - Matchcode Objects12. DD25L - Aggregate Header (Views, MC Objects, Lock Objects)13. DD30L - Search Helps14. DD40L - Table types (internal tables defined in DD)

    back to top

    What are Lock Objects?

    A R/3 system allows multiple users to access the same object at a given point of time by lock mechanism. When one person is editing theprogram/transaction these locks are set and released accordingly by function modules. These function modules are generatedautomatically by the Lock Object definition in ABAP dictionary.

    For more info refer to this link: http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

    back to top

    What is significance of table maintenance attribute?

    This attribute of table maintenance decide about whether table records can be created or not using table maintenance generator or whether theentries can be viewed only.This attribute donot have effect on program. one can create entries in table having any value for thisProgrammaticallyattributeback to top

    Where to find the relationships between different database tables ?

    Database Tables like DD08L provide the information about the relationships between different database tables.

    back to top

    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm