Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi friends what is the perfomence improveing statments in reports.

Former Member
0 Kudos

1)what is the perfomence improveing statments in reports.

2)what is LUW.

3)WHAT IS PRIMARY KEY,FORIGNKEY ,CHECK TABLE,

VALETABLE.

6 REPLIES 6

Former Member
0 Kudos

Hi,

perfromance in reports are.

1. find the perfect the key field while retrieving the data from the data base table.

2.use the internal table. that should be binary search. while using binary search that internal table should be sort.

3. use the field symbols while using the subroutines.

4.use the while end while instead of do and anddo.

5.while u retreving the single time field at that time use the by passing buffer.

6.use for all entries insted of nested select statements.

LUW

In everyday language, a transaction is a sequence of actions that logically belong together in a business sense and which either procure or process data. It covers a self-contained procedure, for example, generating a list of customers, creating a flight booking, or sending reminders to customers. From the point of view of the user, it forms a logical unit.

The completeness and correctness of data must be assured within this unit. In the middle of a transaction, the data will usually be inconsistent. For example, when you transfer an amount in financial accounting, this must first be deducted from one account before being credited to another. In between the two postings, the data is inconsistent, since the amount that you are posting does not exist in either account. It is essential for application programmers to know that their data is consistent at the end of the transaction. If an error occurs, it must be possible to

undo the changes made within a logical process.

In the R/3 System, there are three terms frequently used in this connection:

Database Logical Unit of Work (LUW)

A database LUW is the mechanism used by the database to ensure that its data is always consistent.

SAP LUW

An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW.

SAP Transaction

An SAP transaction is an application program that you start using a transaction code. It may contain one or more SAP LUWs.

PRIMARY KEY means it is a unique key + not null value.

Foriegn key means a relationship between two fields based on the field.

value table means it will contail at field level.

check table means it will come at domain level.

please reward points,

regards,

satish.

Former Member
0 Kudos

Hi,

some of performance improving statements are:-

extract less data(what ever u exactly u required to operate) by:

1. select field1 field2...

*instead of select ...

2.instead of select...endselect use

select.....into table <internal table>.

3.try to use select....with where keyfield1=field1...

ie slect with where clause with keyfields in left-justification oder.

4.if number of joins are more than 3 then use view or For all entries.

5.if databse table of type full buffering type and if u try to check entry by

*select * where key1= ...*

if sy-subrc = 0.

exit.

endif.

endselect.

this causes to buffering of db table to application server and searching of data ..

instead of this use

*select * upto 1 rows from dbtable...*

here it don't buffered to application server so most of memory is saved.

6.use aggrigate functions like sum, avg, min etc instead of buffered to application server or into internal table and then doing summation ton those fields.

Former Member
0 Kudos

Hi

1)Performance tuning is of two type :

1. ABAP

2. Database

For database: u can improve on ur select query by using the required fields only and not using select *

Avaoid Select end select , use Select ... into internal table ...

Avoid joins ... Use Select ...... For all enteries....

USe Exact Proimary key in Where clause or use secondary index in the same order as given in DB table

For Abap : U can improve by freeing the internal table , clearing the header.

Avoid Nested loops ... Use Parallel Cursor technique.

2)LUW is basically of two type:

1> DB LUW

2> SAP LUW

LUW is logical unit of work means once the full transaction is complete (in case of SAP) or when we move from one screen to another (in case of DB LUW) then there should be a commit and rollback involved based on the success of transaction/screen.

Basically in case of DB LUW it could be the case that Transaction is incomplete and this will lead to DB inconsistency. For eg. If some bank transaction is there, if something is credited to one account then it should be debited from one account. On one screen u credited one account (DB LUW has been successful and DB has been changed) and on another screen u wanted to debit that account but on second screen it gave some error (DB LUW has not been successful and DB has not been changed) so it will lead to inconsistency.

TO remove this error SAP came up with SAP LUW which will do DB commit only once the transaction is through.

3) Primary key : Its a unique key for identification and non redudancy of data

Foreigm Key : Its the field corresponding to this table reffered from other table.

Check table : Its for search help and mostly foreign Key table is check table .

Value table : this is the table given in the Domain in the value range tab.

PS: Reward Points if Helpfull.

Regards

Naveen gupta

Former Member
0 Kudos

Hi ganga,

the solutions for the three queations are as followed as per I know-

1- the performance issue is also a big issue as creating a program.because if the correct statements are not used then the program will take long time for execution which is not good.

Some the statements which affect the performance of the table are mentioned below-

a.) always REFRESH the tables before select query-

REFRESH it_tab.

b.)always sort the table and then for read statement use binary search.

c.)after each select query,read statement check for sy-subrc=0.

d.) avoid select query within loop.

2.)A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.

3.)primary key is the field which is unique not repeated,for each value of primary key there will be on record.

foreign key is the field which works as the key field for another table and check table is used for help,which about the values of the field to which it is attached.

Former Member
0 Kudos

Hi,

The R/3 system is multi user system and many users access the same information at the same time, which is mainly DATA. Consider the case where one user is modifying a record, and second user is trying to delete the same record. If the second user is successful in deleting the record then the first user will face problem for modifying the record that is already deleted. The avoid such situation, R/3 system has provided Logical Unit of Work, which is defined as a locking mechanism to protect transaction integrity. Of course, there are other measures, which ensures data integrity like check table i.e. foreign key relationship. Within SAP system there are three types of transaction and may be distinguished as:

• Database transaction known as LUW. It can be defined as a period in which operation requested must be performed as a unit, i.e. all or nothing operation. At the end of LUW, either of the database changes are committed or rolled back.

• Update transaction or SAP LUW. One SAP LUW can have several databases LUW. So a set of a database is either committed or rolled back. The special ABAP/4 command COMMIT WORK, marks the end of a SAP LUW.

• ABAP/4 transaction. Is made up of a set of related task combined under one transaction code. ABAP/4 transactions are for programming environment, in which ABAP/4 transaction functions like one complete object containing screens, menus and transaction codes.

R/3 system has provided in built locking mechanism, which defines the Logical Unit of Work. Also user can set his own locking mechanism. The LUW starts when a lock entry in the system table is created, and it ends when the lock is released.

To provide the user the facility to communicate with the table in order to modify or delete or insert data, R/3 has provided tool called SCREEN PAINTER. This tool allows you to design screen, process screen through program and update the database table. SAP has provided one and only one way to update the database table, i.e. transaction. Though you can update database table by using open SQL statement through program, SAP usually doesn’t recommend this kind of updating. Many standard transactions are available to update standard table but if the need arises, the developer should be able to develop new transaction, which allows the updating of database tables. This can be achieved by using various components of screen painter.

PRIMARY KEY is a Field which is used to identify the table

and these cannot be changed, IF it is changed the data integrity will get lost.

foreign key -- A relationship which can be defined between tables and must be explicitly defined at field level. Foreign keys are used to ensure the consistency of data. Data entered should be checked against existing data to ensure that there are now contradiction. While defining foreign key relationship cardinality has to be specified. Cardinality mentions how many dependent records or how referenced records are possible.

Check tables

The ABAP Dictionary allows you to define relationships between tables using foreign keys. A dependent table is called a foreign key table, and the referenced table is called the check table. Each key field of the check table corresponds to a field in the foreign key table. These fields are called foreign key fields. One of the foreign key fields is designated as the check field for checking the validity of values. The key fields of the check table can serve as input help for the check field.

VALUE TABLE

This is maintained at Domain Level.

When ever you create a domain , you can entered allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only allowed values is H or S.

When ever you use this Domain, the system will forces you to enter only these values.

This is a sort of master check . To be maintained as a customization object. This mean that if you want to enter values to this table you have to create a development request & transport the same.

Former Member
0 Kudos

hi,

The Open SQL statements INSERT, UPDATE, MODIFY, and DELETE allow you to program database changes that extend over several dialog steps. Even if you have not explicitly programmed a database commit, the implicit database commit that occurs after a screen has been processed concludes the database LUW. A logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW is called an SAP LUW. Unlike a database LUW, an SAP LUW can span several dialog steps, and be executed using a series of different work processes. If an SAP LUW contains database changes, you should either write all of them or none at all to the database. To ensure that this happens, you must include a database commit when your transaction has ended successfully, and a database rollback in case the program detects an error. However, since database changes from a database LUW cannot be reversed in a subsequent database LUW, you must make all of the database changes for the SAP LUW in a single database LUW. To maintain data integrity, you must bundle all of you database changes in the final database LUW of the SAP LUW.

Value table - It's a field in a domain it helps in domain level data validation.

Check table - unlike value table it helps in feild level data validation.

The relational data model contains not only tables, but also relationships between tables. These relationships are defined in the ABAP/4 Dictionary by foreign keys. An important function of foreign keys is to support data integrity in the relational data model. Foreign key fields may assume only those values allowed by the check table, in other words, values occurring in the primary key of the check table.

A foreign key provides a link between two tables, for eg.,T1 and T2 by including a reference in table T1 to the primary key of table T2. For this purpose, Foreign key fields assigned to the primary key fields of T2 are included in T1. Table T1, which is the one being checked, is called a foreign key table, and table T2 is called a check table. The terms dependent (foreign key) table and referenced (check) table are also used.

for performance improvement :

1. Always check the driver internal tables is not empty, while using FOR ALL ENTRIES

2. Avoid for all entries in JOINS

3. Try to avoid joins and use FOR ALL ENTRIES.

4. Try to restrict the joins to 1 level only ie only for tables

5. Avoid using Select *.

6. Avoid having multiple Selects from the same table in the same object.

7. Try to minimize the number of variables to save memory.

8. The sequence of fields in 'where clause' must be as per primary/secondary index

9. Avoid creation of index as far as possible

hope these answers are useful to you..

reward points if helpful..