abap

Upload: srilakshmi

Post on 08-Mar-2016

218 views

Category:

Documents


0 download

DESCRIPTION

abap

TRANSCRIPT

  • Requirement:

    Select those MM tables which are language dependant (For example you want to translate the customizing in two languages)

    Solution:

    report zbctcb96.tables: dd03l, tadir.data: counter type i value 1.select * from tadir where pgmid eq R3TR andobject eq TABL anddevclass like M%.

    select * from dd03l where tabname eq tadir-obj_name and

    ( fieldname like SPRA% or fieldname like LANG% ).

    write: / counter, dd03l-tabname, dd03l-fieldname.add 1 to counter.exit.endselect.endselect.

    The TADIR contains the development objects. All the table objects are selected which are in an MM development class (MM development classes begin with M).

    The DD03L table contains the fields of the database tables. Just those tables are selected, which has a field beginning with either SPRA or LANG. ( language is Sprachein german).Performance considerations in this example:

    How frequently runs the report?

    This report was used only once . I have tried to run it in dialog and finished without time out error. Performance optimization is not necessary.

    Is DD03L and TADIR buffered and how many records are in the tables?

    You find it in /Development Workbench/ABAP 4 Dictionary, Table Display, /Goto/Technical settings

    TableBufferingExpected size in recordsDD03LNo buffering310,000 24,000,000TADIRBuffering single records92 000 370 000

    Both are large tables with no or poor buffering. A good performance can be only expected when you use indexed fields of the tables.

    Are the selection fields indexed?

    The primary key fields are always indexed. Other fields are indexed through additional index files. From the Table Display, /Goto/Indexes.

  • TableIndexIndexed fieldsDD03LDD03L_____5__XTABNAMEAS4LOCALFIELDNAMETADIRTADIR__1DEVCLASS

    This means that both tadir-devclass and dd03l-fieldname are indexed. However it doesnt help, because in the WHERE clause the selection fields does not fully match the index fields.

    Are there nested SELECT statements?

    An example of nested SELECT statements:

    select * from tstc.

    select * from tstct where sprsl eq E and tcode eq tstc-tcode.

    [..]endselect[..]endselect.

    No. In nested SELECTs every ABAP command is executed n*m times, where n and m are the numer of rows in the first table and second table. In this example, after the SELECT statement an EXIT is used which quits after processing one record.