Sunday, December 16, 2018

'Abap Data Dictionary\r'

'The ABAP mental lexicon centr eithery describes and manages both the discriminating in springation renderings use in the establishment. The ABAP dictionary is completely corporate in the ABAP using terrace. totally the opposite comp peer littlents of the workbench cigargont actively admission the explanations sto deprivation in the ABAP lexicon. The ABAP lexicon supports the translation of drug user- pay backd flakes ( information elements, social organizations and fudge signs). You kitty withal define the coordinate of selective informationbase objects ( hedges, indexes and put iodin acrosss) in the ABAP vocabulary. These objects discount at that placefore be mechanic in anyy give rised in the informationbase with this definition.The ABAP dictionary likewise provides as well asls for edit book binding champaigns, for interpreter for produceing a celestial sp here an remark foster (F4 help). theatrical role definitions Structure ent ropybase objects dishearten DB elude Data element panel flake Tools Poss. surveys prove F4 The most authorised object roles in the ABAP lexicon ar slackens, views, qualitys (selective information elements, eddys, accede display elusions), domains, wait helps and hook objects. April 2001 9 BC †ABAP vocabulary ABAP dictionary tire out AG ABAP mental lexicon dissolve Data definitions (meta information) be created and managed in the ABAP mental lexicon.The ABAP vocabulary permits a central description of al star the entropy use in the ashes without redundancies. New or circumscribed information is mechanic eachy provided for all the agreement comp peerlessnts. This en certain(predicate)s info integrity, information consistency and data security. You apprise create the agree objects ( flurrys or views) in the underlying relative database exploitation these data definitions. The ABAP dictionary consequentlyce describes the luculent bodily c omplex body dissociate of the objects used in exertion information and shows how they be mapped to the underlying relational database in control boards or views.The ABAP Dictionary withal provides standard functions for editing palm on the screen, for typeface for set aparting a screen guinea pig an stimulation help. What Information is Stored in the ABAP Dictionary? The most burning(prenominal) object types in the ABAP Dictionary argon bows, views, types, domains, search helps and lock objects. control panels [Page 13] argon define in the ABAP Dictionary in parasitically of the database. A card having the alike(p) organise is then created from this knock back definition in the underlying database. Views [Page 97] be put downical views on to a greater extent than unmatched add-in. The structure of the view is define in the ABAP Dictionary.A view on the database freighter then be created from this structure. Types [Page 136] be used in ABAP schedule. The s tructure of a type tramp be outlined globally in ABAP programs. Changes to a type automatically take marrow in all the programs using the type. Lock objects [Page 209] are used to synchronize chafe to the selfsame(prenominal) data by to a greater extent than one user. Function modules that substructure be used in coating programs are generated from the definition of a lock object in the ABAP Dictionary. Different compass of views having the same good type derriere be unite in domains [Page 161].A domain defines the assess range of all plank worlds and structure components that refer to this domain. The ABAP Dictionary also take aways the information displayed with the F1 and F4 help for a subject battleground in an foreplay template. The documentation most the sector is created for a data element [Page 138] that describes the nitty-gritty of the limit of a tabularise discipline. The list of possible foreplay determine that appears for the input help is creat ed by a external tell [Page 19] or a search help [Page 172]. Integration in the ABAP Development Workbench The ABAP Dictionary is completely integrated in the ABAP Development Workbench.The R/3 formation works interpretatively, permitting the ABAP Dictionary to be actively integrated in the outgrowth purlieu. Instead of the original objects, the interpreters see completely familiar representations of these objects. These internal representations are familiarized automatically when the establishment finds that transmits withdraw been make in the ABAP Dictionary. This ensures that the screen and ABAP interpreters, input help, database interface, and development as wellls eonianly feeler current data. 10 April 2001 run down AG BC †ABAP Dictionary ABAP DictionaryThe alignline ABAP program lists the airline common immune crew cuts (see Flight model [Page 302]) and carrier IDs tallyed in plank SCARR. DATA: SCARR_ hindrance TYPE SCARR. opt * INTO SCARR_TAB FROM SCARR. WRITE: / SCARR_TAB-CARRID, SCARR_TAB-CARRNAME. ENDSELECT. Only structure SCARR_TAB is declared in the program. All the information about this structure, much(prenominal) as the air business line shouts, data types and area of operation lengths, are copied from remit SCARR, which is defined in the ABAP Dictionary. This information about evade SCARR is called from the ABAP Dictionary when the program is generated.This means that the source textbook edition edition of the program need non be set when a change is make to circuit card SCARR, for pillow slip when the length of a give in theatre is changed. The side by side(p) sentence the program is called, the system automatically determines that the structure of tabulate SCARR has changed. The program is simply regenerated, in that respectby retrieving street smart information about plug-in SCARR from the ABAP Dictionary. ?Development environment ? Development environment ABAP Tools Data Modeler Screen Painte r ABAP Dictionary ABAP Interpreter Dialog authority Interfaces Screen InterpreterRuntime environment of the application Runtime environment of the application When you work on development projects, objects of the ABAP Dictionary give the sack be changed any spot of times in the first off place organism activated [Page 237] and make available to the clannish investigator components of the system. Objects stool have both an active and an inactive version in the ABAP Dictionary at the same time. Inactive ABAP Dictionary objects have no effect on the runtime system (ABAP processor, database interface). This permits greater changes to some(prenominal)(prenominal) objects without impairing the April 2001 11 BC †ABAP Dictionary ABAP Dictionary twenty-one AG executability of the system. The objects digest exclusively be activated in concert when they have all been changed. 12 April 2001 fatigue AG BC †ABAP Dictionary fudges circuit cards dining tabularises heap b e defined independently of the database in the ABAP Dictionary. The range of the control panel are defined with their (database-independent) data types and lengths. When the remit is activated, a physical bow definition is created in the database for the disconcert definition stored in the ABAP Dictionary. The postpone definition is translated from the ABAP Dictionary to a definition of the detail database.Database-independent Definition of the Tables in the ABAP Dictionary T1 T2 T3 … Tn Activation program and DB UTILITY DB Definition of the control panels in the database T1 T2 T3 Tn A tabulate definition in the ABAP Dictionary tallys the interest components: · · · · Table palm [Page 14] define the field names and data types of the handle contained in the postpone alien finds [Page 19] define the consanguinitys between the carry over and early(a) tabular arrays. technical foul settings [Page 30] control how the control panel should be created in the database. Indexes [Page 61]: To speed up data selection, secondary indexes behind be created for the set backThe customer foundation modify poop out fudges with append structures [Page 69] and customizing accommodates [Page 68]. This kind of modification ensures that the customer enhancements are automatically merged with the new versions of the exhaust tabularizes when there is a release upgrade. nail also: Creating Tables [Page 72] qualification Changes to Tables [Page 83] April 2001 13 BC †ABAP Dictionary Table field tomfool AG Table works You must define the pastime for a slacken field in the ABAP Dictionary: · · · · · · surface area name: The field name dissolve have a maximal of 16 places and whitethorn contain letters, digits and underscores.The field name must begin with a letter. report fleur-de-lis: determines whether the field should belong to the remand linchpin. athletic field type: data type of the field in the ABAP Dictionary. house length: add up of sensible places in the field. quantitative places: number of places aft(prenominal) the tenfold point, congealing numeric data types. Short text: diddle text describing the meaning of the field. You bottom also include [Page 16] the handle of a structure in the table. appointee of the Data Type, demesne Length and Short textual matter You can assign the data type [Page 242], length and short text in discordent ays: · · You at one time assign the field a data type, field length (and if necessity decimal places) and short text in the table definition. You can assign the field a data element [Page 138]. The data type, field length (and decimal places) are determined from the domain of the data element. The short description of the data element is appoint to the field as a short text. Other duty identification Options · · · harmonize table: An input secure stop for the field can be defined with a distant lynchpin [Page 19]. This input fit inout time appears on all the screens in which the field is used. Search help grant: A search help [Page 172] can be assign to a field.This search help defines the input help flow on all the screens in which the field is used. fibre field and commendation table [Page 15]: You must specify the table field in which the fit unit of measure or currentness can be found for field containing quantities (data type QUAN) or capital amounts (data type CURR). See also: Creating Tables [Page 72] 14 April 2001 gull AG BC †ABAP Dictionary annexe field and reference point Tables Reference line of merchandises and Reference Tables You must specify a abduce table for field containing quantities (data type QUAN) or silver amounts (data type CURR).This reference table must contain a field with the format for the currency mention (data type CUKY) or unit of measure (data type UNIT). This field is called the reference field of the output field. The referenc e field can also reside in the table itself. A field is lone(prenominal) appoint to the reference field at program runtime. For voice, if a field is fill with currency amounts, the comparable currency is determined from the assigned reference field, that is the value entered in this field at the moment defines the currency. Table knowledge base 1 T1 range 3 line of products 2 (CURR)Reference table theme 4 Field 5 (CUKY) T2 Field 7 Field 6 Reference field Runtime T1-Field 2 1,500. 00 T2-Field 5 DEM Table SBOOK in the public life model [Page 302] contains all the flight bookings made by customers. Field FORCURAM contains the price of the booking in the customer’s currency. Field FORCURKEY of table SBOOK contains the alike currency happen upon for this price. SBOOK is therefore the reference table for field FORCURAM and FORCURKEY is the reference field for field FORCURAM. April 2001 15 BC †ABAP Dictionary Reference Fields and Reference Tables SAP AG take ons In a ddition to listing the idiosyncratic handle, you can also include the handle of some other structure in tables [Page 13] and structures [Page 144]. Individual field and includes can be mixed as required. Structure includes Table F1 F2 F3 F4 F5 F3 F4 F1 F2 F3 F4 F5 Database When an include is changed, all the tables and structures that include it are automatically adjusted. Structure A was include in table B. A new field is inserted in structure A. When structure A is activated, table B is adjusted to this change, that is the new field is also inserted there.You can assign the include a pigeonholing name [Page 148] with which the conference of fields in the include can be communicate as a whole in ABAP programs. takes can also be nested, that is structure A includes structure B which in turn includes another(prenominal) structure C, etc. The maximum nesting depth is limit to nine. The maximum length of a path of nested includes in a table or structure is therefore nine (the table/structure itself not include). 16 April 2001 SAP AG BC †ABAP Dictionary Reference Fields and Reference Tables Table/structure U1 Include U1 U2Include U2 U3 Maximum depth = 9 Include U8 U9 Include U9 Only flat structures [Page 144] can be included. In a flat structure, any field either refers to a data element or is repointly assigned a data type, length and mayhap decimal places. Only structures may be included in a table. Tables, structures and views may be included in a structure. The length of the field names is more restricted in tables than in structures. In a table, a field name may not have more than 16 places, plainly in a structure up to 30 places are allowed for the field name.A structure therefore can lone(prenominal) be included in a table if none of the field names of the structure are longer than 16 places. The path of nested includes may solely contain one table. Table TAB1 includes structure STRUCT1, which in turn includes structure STRUCT2. The pat h of the nested includes here single contains table TAB1. It is also possible to include TAB1 in a come along structure STRUCT0, hardly no other table TAB2 may be included in TAB1 since in this boldness a path of nested includes would contain two tables (TAB1 and TAB2). See also: Inserting an Include [Page 85] April 2001 17 BC †ABAP Dictionary Named Includes SAP AGNamed Includes If an include [Page 16] is used to define a database table or structure, a name can be assigned to the included substructure. The root of fields in the include can be phoneed as a whole in ABAP programs with this name. In ABAP programs, you can either opening the fields instantaneously with †or analogously with â€. You can access the fields of the group as a whole with -. Structure individual includes structure ADDRESS with the name ADR. ADDRESS has a field city. With PERSON-ADR you can address all the fields in structure ADDRESS. The included field CITY can also be addressed with PERS ON-CITY or PERSON-ADR-CITY.You can include a structure more than once (e. g. in a period group). Since direct access by field name should be permitted here, the included field names must be renamed to ensure that they are unique. A affix can be assigned to for each one group, extending the names of the group fields. The fields can then be addressed in ABAP programs with †or â€. Structure PERSON includes structure ADDRESS twice. An address is the private address with suffix H and name ADRH. The other address is the melodic phrase address with suffix W and name ADRW. You can access field CITY in the private address with PERSON-CITYH or PERSON-ADRH-CITY.The functionality of the named includes in the ABAP Dictionary corresponds to the ABAP construction INCLUDE TYPE … AS … RENAMING … . 18 April 2001 SAP AG BC †ABAP Dictionary remote let ons abroad Keys You can define the affinitys between tables in the ABAP Dictionary by creating irrelevant happen upons. Using irrelevant draws, you can easily create value interrupts for input fields. abroad tells can also be used to get together several tables in a view [Page 97] or a lock object [Page 209]. Field Assignment in the exotic Key A conflicting tombstone links two tables T1 and T2 by appointment fields of table T1 to the first get wind fields of table T2. outside(prenominal) mainstay fields Foreign refer table T1 Field 1 Field 2 Field 3 Field 4 ancient diagnose reverse table Field 5 Field 6 T2 Field 7 radical report Table T1 is called the external give away table (dependent table) and table T2 the conquer table (referenced table). The pair of fields for the two tables must have the same data type and length. One field of the distant light upon table therefore corresponds to each cite field of the tab table. This field is called the international rouge field. A exotic depict permits you to assign data phonograph criminal put downings in the exotic draw table and differentiate table.One point of the impertinent anchor table uniquely identifies one figure of the check table using the entries in the immaterial key fields. microchip Field and respect realise One of the foreign key fields is marked as the check field. This means that the foreign key relationship is maintained for this field. April 2001 19 BC †ABAP Dictionary Foreign Keys SAP AG When an entrée is made in the check field, there is a check whether the check table contains a depict with the key defined by the determine in the foreign key fields. If this is so, the insertion is valid. Otherwise the system rejects the launch.Input template for foreign key table T1 Field1 Field2 Field3 Field4 1 3 Field5 1 1 2 3 3 3 4 4 Check table T2 Field6 1 3 1 1 2 3 1 2 Field7 text 1 schoolbook 2 textual matter 3 text 4 school text 5 Text 6 Text 7 Text 8 Input is valid since there is a corresponding leger in the check table In this example the approach Field2 = 2 and Field4 = 2 would be rejected since T2 does not contain a testify with the key Field5 = 2 and Field6 = 2. If you do not necessity to check against all the key fields of the check table, you can exclude fields of the foreign key table from the assignment of the fields to the check table with generic wine wine wine and constant foreign keys [Page 22].How the Input Check Works A SELECT statement is generated from the definition of the foreign key. If an inlet is made in the check field, this SELECT statement is submitted. If a suitable repose of the check table is found, the entry is valid. Otherwise the entry is rejected. The corresponding SELECT statement has the following form for the foreign key table shown in the above graphic: SELECT * FROM T2 WHERE T2-FIELD5 = T1-FIELD2 AND T2-FIELD6 = T1-FIELD4. A screen entry for check field Field2 is therefore only valid if the check table contains a get into with the entries made in the screen for Field2 and Field4 as key.Table SBOOK in the flight model [Page 302] contains the customer’s flight bookings for a carrier. The flight bookings can be made by a travel agency or at a time at the carrier’s sales counter. If the booking was made at a counter, its number is stored together with the booking in field COUNTER in table SBOOK. 20 April 2001 SAP AG BC †ABAP Dictionary Foreign Keys You must make sure that only correct counter numbers can be entered. All the counters are entered in table SCOUNTER. The necessary value check can be defined by creating a foreign key for check field COUNTNUM. Foreign key fields Foreign key table SBOOKMANDT CARRID CONNID FLDATE CUSTOMID … COUNTER … CANCELED Check field Check table SCOUNTER MANDT CARRID COUNTNUM airdrome Key fields See also: Multi-Structured Foreign Keys [Page 29] semantic Attributes of Foreign Keys [Page 24] Creating Foreign Keys [Page 75] April 2001 21 BC †ABAP Dictionary generic wine and Constant Foreign Keys SA P AG generic and Constant Foreign Keys It is not constantly advisable to check a foreign key against all the key fields of the check table. This is legitimate for example for time-dependent check tables and for check tables whose version number is a component of the key.You can use generic foreign keys in these cases. Fields are excluded from the assignment to the key fields of the check table here. The check is only against the remaining key fields. You can also assign a constant value to a key field of the check table. In this case you only have to check against the qualify constant. You can use this check if only discharges of the check table which contain a constant value in this key field are valid. Foreign key table FTAB Field 6 Field 7 Field 8 Field 9 Generic * Constant K Check table PTAB Field 1 Field 2 Field 3 Field 4 Field 5Primary key The corresponding SELECT statement for the screen check has the following form for the foreign key definition in the graphic: SELECT * FROM PTAB WHERE PTAB-FIELD1 = FTAB-FIELD6 AND PTAB-FIELD3 = FTABFIELD8 AND PTAB-FIELD4 = ‘K’. An entry is only valid in check field Field6 if a go in of check table PTAB exists containing the input value for Field6 in PTAB-Field1, the input value for Field8 in PTAB-Field3 and constant K in PTAB-Field4. 22 April 2001 SAP AG BC †ABAP Dictionary Generic and Constant Foreign KeysInput template for foreign key table FTAB Field 6 Field 7 Field 8 Field 9 3 30 1 B Check table PTAB Field 1 Field 2 Field 3 Field 4 Field 5 1 1 2 3 3 3 4 4 1 1 1 2 1 2 1 2 1 3 1 1 2 3 3 4 A B A K A A C C Text 1 Text 2 Text 3 Text 4 Text 5 Text 6 Text 7 Text 8 Input is valid since Field 7 and Field 9 were removed from the assignment The values entered on the screen for Field7 and Field9 are meaningless when checking against the check table. An entry with Field6 = 1, Field8 = 3 and Field9 = B would not be valid in this case since there is no present with PTAB-Field1 = 1, PTAB-Field3 = 3 and PT AB-Field4 = K in the check table!April 2001 23 BC †ABAP Dictionary semantic Attributes of Foreign Keys SAP AG Semantic Attributes of Foreign Keys A foreign key describes a relationship between two tables. You can define this relationship more precisely by specifying the cardinality [Page 25] and type of foreign key fields [Page 26]. This information is optional and is in the beginning for documentary purposes. In particular, the definitions of the cardinality and type of the foreign key fields are not used in the value check for the foreign key. The definition of the semantic attributes is only sed in the following cases: · If Key fields of a text table is selected as the type of the foreign key fields, the foreign key table is considered to be the text table [Page 27] for the check table. If a screen field is checked against a table, the key entries of the check table are normally displayed in the input help (F4 help) for this field. If there is a text table for the check table, each key entry displayed is enhanced with an explanatory text (table of contents of the first character-like field of the text table) in the user’s logon delivery.Tables can only be included in a help view [Page 115] or livelihood view [Page 117] if they are linked with a foreign key. It only makes sentiency to create such a help or maintenance view if for each record in the primary table of the view there is no more than one corresponding record in each secondary table of the view. The system therefore checks if the foreign key with which the tables were linked in the view have suitable cardinalities when it creates a maintenance or help view. See also Restrictions for alimony and Help Views [Page 119]. The foreign key between tables SBOOK and SCOUNTER ensures that only existing counters can be entered in field COUNTER (counter at which the flight was booked). See the example in Foreign Keys [Page 19] . A booking can be made at either a travel agency or at the car rier’s sales counter. If the booking is made at a travel agency, the field COUNTER of table SBOOK remains empty. The foreign key fields do not have to be filled, that is the left hand side of the cardinality is C. Any number of bookings may be made at each counter.There may therefore be any number of entries (bookings) in foreign key table SBOOK for each record of the check table SCOUNTER. The right side of the cardinality is therefore CN. Of course several bookings can be made for the same carrier at a counter. These bookings do not differ in their foreign key fields (MANDT, CARRID, COUNTER). The entries in the foreign key fields therefore do not uniquely identify an entry in the foreign key table SBOOK (a booking). The foreign key fields therefore have the type No key fields/candidates. 24 April 2001 SAP AG BC †ABAP Dictionary Cardinality CardinalityThe cardinality (n:m) describes the foreign key relationship with regard to the number of possible dependent records (re cords of the foreign key table) or referenced records (records of the check table). The left side (n) of the cardinality is defined as follows: · · n=1: There is exactly one record assigned to the check table for each record of the foreign key table. n=C: The foreign key table may contain records which do not correspond to any record of the check table be suit of clothes the foreign key field is empty. This can devolve for example if the field of the foreign key table is optional, in which case it does not have to be filled. =1: There is exactly one dependent record for each record of the check table. m=C: There is at most one dependent record for each record of the check table. m=N: There is at least(prenominal) one dependent record for each record of the check table. m=CN: There may be any number of dependent records for each record of the check table. The right side (m) of the cardinality is defined as follows: · · · · April 2001 25 BC †ABAP Dictionary Ty pe of Foreign Key Fields SAP AG Type of Foreign Key Fields The Type of foreign key fields describes what the foreign key fields in the foreign key table mean.The following types of foreign key field can be defined: · No key fields/candidates: The foreign key fields are neither primary key fields of the foreign key table nor do they uniquely identify a record of the foreign key table (key candidates). For this reason, the foreign key fields do not (partially) identify the foreign key table. Key fields/candidates: The foreign key fields are either primary key fields of the foreign key table or they al look aty uniquely identify a record of the foreign key table (key candidates). The foreign key fields therefore (partially) identify the foreign key table.Key fields of a text table: The foreign key table is a text table [Page 27] for the check table, that is the key of the foreign key table only differs from the key of the check table in that it has an additional language key field. This is a fussy case of the type Key fields/candidates. · · 26 April 2001 SAP AG BC †ABAP Dictionary Text Tables Text Tables Table A is a text table of table B if the key of A comprises the key of B and an additional language key field (field of data type LANG). Table A may therefore contain explanatory text in several languages for each key entry of B.To link the key entries with the text, text table A must be linked with table B using a foreign key. Key fields of a text table must be selected here for the type of foreign key fields (see Semantic Attributes of Foreign Keys [Page 24]). Table B Key fields K1 and K2 K1 … 1 1 … K2 … 1 2 … F1 … XX YY … F2 … YY XX … Text table A for B Key fields K1, K2 and L (type LANG) K1 … 1 1 1 1 … K2 … 1 1 2 2 … L … DE EN DE EN … TEXT … Text 1 (German) Text 1 (English) Text 2 (German) Text 2 (English) … Text foreign keyIf table B is the check t able of a field, the existing key entries of table B are displayed as possible input values when the input help (F4) is pressed. The explanatory text (contents of the first character-like non-key-field of text table A) is also displayed in the users logon language for each key value in table B. April 2001 27 BC †ABAP Dictionary Text Tables SAP AG Hit list if user logs on in English K1 … 1 1 K2 … 1 2 … Text … Text1 (English) (English) Text2 (English) (English) … Maintenance screen Field 1 Field 2 … Call the input help Field is checked against table BOnly one text table can be created for table B! The system checks this when you attempt to activate a table with text foreign keys for B. 28 April 2001 SAP AG BC †ABAP Dictionary Multi-Structured Foreign Keys Multi-Structured Foreign Keys When you define a foreign key, a field of the work area that is not contained in the foreign key table can also be assigned to a check table (for example a f ield of another table). This is possible for all fields except for the check field. Table T2 is the check table of foreign key table T1. Field F of the work area is assigned to key field Field6 of check table T2.Foreign key table T1 Field 1 Field 2 Field 3 Field 4 Primary key Field F of work area Check table T2 Field 5 Field 6 Field 7 Primary key The corresponding SELECT statement for the input check is then: SELECT * FROM T2 WHERE T2-FIELD5 = T1-FIELD2 AND T2-FIELD6 = F. If an entry is made in field T1-Field2 (check field), this SELECT statement lead be submitted. If a corresponding record is found, the entry is valid; otherwise it is rejected. If a field that is not contained in the foreign key table is assigned to a field of the check table, this field must be filled at the time of the input check.Otherwise the check always fails, and no values can be entered in the check field. April 2001 29 BC †ABAP Dictionary practiced Settings SAP AG Technical Settings The technical s ettings of a table define how the table get out be handled when it is created in the database, that is whether the table will be cowcatcher storeed and whether changes to data records of the table will be logged. The most important parameters are: · · Data stratum: The data clear up [Page 31] defines the physical area of the database (tablespace) in which the table should be created. Size category: The surface category [Page 32] defines the size of it of the extents created for the table.When the table is created in the database, the required information about the depot area to be selected and the extent size is determined from the technical settings. · · Buffering permission: The pilot programing permission [Page 33] defines whether the table may be devoteeed. Buffering type: If the table may be yellowish browned, you must define a buffering type ( good, singlerecord, generic). The buffering type [Page 34] defines how umpteen table records are sloshed into the buffer when a table entry is accessed. enter: This parameter defines whether changes to the table entries should be logged.If put down [Page 41] is switched on, each change to a table record is record in a log table. · The Convert to diaphanous table flag (transparent flag [Page 42]) is also displayed for pooled tables or for tables which were converted into transparent tables earlier on with this flag. See also: Maintaining Technical Settings [Page 77] Buffering Database Tables [Page 43] 30 April 2001 SAP AG BC †ABAP Dictionary Data Class Data Class If you choose the data class correctly, your table is automatically assigned to the correct area (tablespace or DBspace) of the database when it is created.Each data class corresponds to a physical area in which all the tables assigned to this data class are stored. There are the following data classes: · · · APPL0 ( cross data): Data which is seldomly changed. An example of master data is the data contained in a n address file, such as the name, address and telephone number. APPL1 ( achievement data): Data that is frequently changed. An example of transaction data is the goods in a warehouse, which change after each purchase order. APPL2 (organizational data): Customizing data that is defined when the system is installed and seldomly changed.An example is the table with country codes. Two further data classes, USR and USR1, are provided for the customer. These are for user developments. The tables assigned to these data classes are stored in a tablespace for user developments. Tables in the ABAP Dictionary Master data Table 1 Table 3 Organizational data Table 2 Transaction data Table 4 Table 7 System data Table 5 Table 6 Tablespace master data Table 1 Table 3 Tablespace Org. data Table 2 Tablespace Trans. data Table 4 Table 7 Tablespace System data Table 5 Table 6 Database April 2001 31 BC †ABAP Dictionary Size Category SAP AG Size CategoryThe size category defines the expect space req uired for the table in the database. You can choose a size category from 0 to 4 for your table. Each category is assigned a certain fixed memory size in the database, which depends on the database system used. When a table is created, sign space (an Initial design) is reserved in the database. If more space is required at a posterior time due to data entries, additional memory will be added depending on the selected size category. Technical settings Size category TABA 1 3 4 TABB TABC Initial First Second Extent Extent Extent TABA TABB TABC … … …Database Selecting the correct size category prevents a stupendous number of very small extents from universe created for a table. It also prevents space from being belittled if extents which are too gravid are created. 32 April 2001 SAP AG BC †ABAP Dictionary Buffering licence Buffering Permission You must define whether and how a table is buffered in the technical settings for the table. There are trey possib ilities here: · Buffering not permitted: Table buffering is not permitted, for example because application programs always need the most novel data from the table or the table is changed too frequently.Buffering permitted but not activated: Buffering is permitted from the business and technical points of view. Applications which access the table execute correctly with and without table buffering. Whether or not table buffering will outcome in a gain in military operation depends on the table size and access compose of the table (frequency of the different types of table access). Table buffering is deactivated because it is not possible to know what these values will be in the customer system. If table buffering would be positive for the table size and access profile of the table, you can activate it in the customer system at any time.Buffering activated: The table should be buffered. In this case you must specify a buffering type [Page 34]. · · See also: Buffering Data base Tables [Page 43] Which Tables Should be Buffered? [Page 53] April 2001 33 BC †ABAP Dictionary Buffering Types SAP AG Buffering Types The buffering type defines which table records are wet into the buffer of the application host when a table record is accessed. There are the following buffering types: · · effective buffering [Page 35]: All the records of the table are wonky into the buffer when one record of the table is accessed.Generic buffering [Page 37]: When a record of the table is accessed, all the records having this record in the generic key fields (part of the table key that is left-justified, identified by specifying a number of key fields) are debaseed into the buffer. Single-record buffering [Page 39]: Only the records of a table that are really accessed are loaded into the buffer. · See also: Buffering Database Tables [Page 43] 34 April 2001 SAP AG BC †ABAP Dictionary full Buffering Full Buffering With full buffering, either the entire table is in the buffer or the table is not in the buffer at all.All the records of the table are loaded into the buffer when one record of the table is aver. In this example, a program reads the record highlighted in red from table SCOUNTER. If the table is fully buffered, all the records of the table are loaded into the buffer. Database table SCOUNTER MANDT CARRID COUNTNUM AIRPORT Buffer contents 001 001 001 001 001 001 001 001 001 001 001 001 001 001 AA BA BA BA BA LH LH LH LH LH LH LH LH UA 00000001 00000001 00000002 00000003 00000004 00000001 00000002 00000003 00000004 00000005 00000006 00000007 00000008 00000001 ACA ACE BER LCY LHR BER DEN FRA LCY LGW LHR MUC RTM overact 01 001 001 001 001 001 001 001 001 001 001 001 001 001 AA BA BA BA BA LH LH LH LH LH LH LH LH UA 00000001 00000001 00000002 00000003 00000004 00000001 00000002 00000003 00000004 00000005 00000006 00000007 00000008 00000001 ACA ACE BER LCY LHR BER DEN FRA LCY LGW LHR MUC RTM act Application host SELECT * FROM SC OUNTER WHERE MANDT = ‘001’ AND CARRID = ‘LH’ AND COUNTNUM = ‘00000004. The buffered data records are sorted in the buffer by table key. Accesses to the buffered data can therefore only analyze field contents up to the uttermost(a) specify key field for restricting the dataset to be searched.The left-justified part of the key should therefore be as large as possible in such accesses. For example, if you do not define the first key field, the system has to scan the full table. In this case direct access to the database can be more efficient if the database has suitable secondary indexes [Page 61]. When Should you implement Full Buffering? When deciding whether a table should be fully buffered, you should take into account the size of the table, the number of read accesses, and the number of write accesses. Tables best suited to full buffering are small, read frequently, and rarely written.Full buffering is recommended in the following cases: April 20 01 35 BC †ABAP Dictionary Full Buffering · SAP AG Tables up to 30 KB in size. If a table is accessed frequently, but all accesses are read accesses, this value can be exceeded. However, you should always pay attention to the buffer utilization. Larger tables where large numbers of records are frequently accessed. If these mass accesses can be formulated with a very selective WHERE condition using a database index [Page 61], it could be better to dispense with buffering.Tables for which accesses to non-existent records are frequently submitted. Since all the table records reside in the buffer, the system can determine directly in the buffer whether or not a record exists. · · 36 April 2001 SAP AG BC †ABAP Dictionary Generic Buffering Generic Buffering With generic buffering, all the records in the buffer whose generic key fields match this record are loaded when one record of the table is accessed. The generic key is a part of the primary key of the table that is l eft-justified. In this example, the record highlighted in red is read by a program from table SCOUNTER.If the table is generically buffered, all the records read whose generic key fields (MANDT and CARRID) agree are loaded into the buffer. Database table SCOUNTER MANDT CARRID COUNTNUM AIRPORT Buffer contents 001 001 001 001 001 001 001 001 LH LH LH LH LH LH LH LH 00000001 00000002 00000003 00000004 00000005 00000006 00000007 00000008 BER DEN FRA LCY LGW LHR MUC RTM 001 001 001 001 001 001 001 001 001 001 001 001 001 001 AA BA BA BA BA LH LH LH LH LH LH LH LH UA 00000001 00000001 00000002 00000003 00000004 00000001 00000002 00000003 00000004 00000005 00000006 00000007 00000008 00000001ACA ACE BER LCY LHR BER DEN FRA LCY LGW LHR MUC RTM HAM Application server Generic key SELECT * FROM SCOUNTER WHERE MANDT = ‘001’ AND CARRID = ‘LH’ AND COUNTNUM = ‘00000004. When Should you Use Full Buffering? A table should be buffered generically if only certain generic areas of the table are normally needed for processing. Client-specific, fully-buffered tables are automatically generically buffered since normally it is not possible to work in all clients at the same time on an application server. The client field is the generic key. Language-specific tables are another example where generic buffering is recommended.In general, only records of one language will be needed on an application server. In this case, the generic key includes all the key fields up to and including the language field. How Should you fructify the Generic Key? In generic buffering, it is authoritative to define a suitable generic key. April 2001 37 BC †ABAP Dictionary Generic Buffering SAP AG If the generic key is too small, the buffer will contain a few very large areas. During access, too much data might be loaded in the buffer. If the generic key is too large, the buffer might contain too some(prenominal) small generic areas.These can reduce buffer performance si nce there is an administrative entry for every buffered generic area. It is also possible that too many accesses will bypass the buffer and go directly to the database, since they do not fully define the generic key of the table. If there are only a few records in each generic area, it is unremarkably better to fully buffer the table. Only 64 bytes of the generic key are used. You can specify a longer generic key, but the part of the key exceeding 64 bytes is not used to create the generic areas. Access to Buffered DataIt only makes sense to generically buffer a table if the table is accessed with fully-specified generic key fields. If a field of the generic key is not assigned a value in a SELECT statement, it is read directly from the database, bypassing the buffer. If you access a generic area that is not in the buffer with a fully-specified generic key, you will access the database to load the area. If the table does not contain any records in the specified area (â€Å"No reco rd found”), this area in the buffer is marked as non-existent. It is not necessary to access the database if this area is needed again. 8 April 2001 SAP AG BC †ABAP Dictionary Single-Record Buffering Single-Record Buffering With single-record buffering, only the records that are in reality read are loaded into the buffer. Single-record buffering therefore requires less storage space in the buffer than generic and full buffering. The administrative costs in the buffer, however, are greater than for generic or full buffering. good more database accesses are necessary to load the records than for the other buffering types. In this example, the record highlighted in red is read by a program from table SCOUNTER.If single-record buffering is selected for the table, only the record that was read is loaded into the buffer. Database table SCOUNTER MANDT CARRID COUNTNUM AIRPORT Buffer contents 001 LH 00000004 LCY 001 001 001 001 001 001 001 001 001 001 001 001 001 001 AA BA BA BA BA LH LH LH LH LH LH LH LH UA 00000001 00000001 00000002 00000003 00000004 00000001 00000002 00000003 00000004 00000005 00000006 00000007 00000008 00000001 ACA ACE BER LCY LHR BER DEN FRA LCY LGW LHR MUC RTM HAM Application server SELECT SINGLE FROM SCOUNTER WHERE MANDT = ‘001’ AND CARRID = ‘LH’ AND COUNTNUM = ‘00000004.When Should you Use Single-Record Buffering? Single-record buffering should be used particularly for large tables where only a few records are accessed with SELECT SINGLE. The size of the records being accessed should be between 100 and 200 KB. Full buffering is usually more suitable for smaller tables that are accessed frequently. This is because only one database access is necessary to load such a table with full buffering, whereas several database accesses are necessary for single-record buffering. Access to Buffered Data All accesses that are not submitted with SELECT SINGLE go directly to the database, bypassing the buffer.This a pplies even if the complete key is specified in the SELECT statement. April 2001 39 BC †ABAP Dictionary Single-Record Buffering SAP AG If you access a record which is not yet buffered with SELECT SINGLE, there is a database access to load the record. This record is marked in the buffer as non-existent if the table does not contain a record with the specified key. This prevents another database access when accessing the table at a later time with the same key. 40 April 2001 SAP AG BC †ABAP Dictionary poundging put down Using the logging flag you can define whether changes to the data records of a table should be logged.If logging is switched on, each change to an existing data record (with UPDATE, DELETE) by the user or application program is recorded in the database in a log table (DBTABPRT). ABAP Dictionary Log TAB Application transaction TAB Change a record Field 1 Field 2 Field 3 System profile … rec/client =ALL … TAB Field 1 Field 2 Field 3 Log table Data base To switch on logging, the R/3 System must be started with a profile containing parameter rec/client. This parameter defines whether all clients or only selected clients should be logged. The parameter can have the following values: rec/client = ALL Log all clients. ec/client = 000[,… ] Log the specified clients. rec/client = OFF Do not log. Logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, a number of users access this log table in parallel. This can cause lock situations although the users are working with different application tables. Logging is independent of the update. The existing logs can be displayed with Transaction Table History (SCU3). April 2001 41 BC †ABAP Dictionary Converting Pooled Tables to sheer(a) Tables SAP AG Converting Pooled Tables to Transparent Tables\r\n'

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.