Application Development and Automation 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: 
Read only

general doubts

Former Member
0 Likes
677

1. Difference between internal table and a dictionary table?

2.can you create an internal table dynamically?(at run time)

3. select sing * and select single * upto one row

4. what is the table name that will contain all the script form names and print program names?

1. Difference between internal table and a dictionary table?

2.can you create an internal table dynamically?(at run time)

3. select sing * and select single * upto one row

4. what is the table name that will contain all the script form names and print program names?

3 REPLIES 3
Read only

Former Member
0 Likes
628

> 1. Difference between internal table and a dictionary

> table?

Internal tables are created at run time and are defined in the ABAP code. Data dictionary tables are defined in txn SE11 and have a corresponding table at the database level (Oracle, DB2, Informix, ADABAS, etc.).

> 2.can you create an internal table dynamically?(at

> run time)

If I understand the question correctly... yes.

> 3. select sing * and select single * upto one row

Earlier releases of SAP allowed SELECT SINGLE if the entire database key was specified in the WHERE clause. The statement UP TO 1 ROWS was used to get a single record from the database when the key was not known. I believe recent versions of SAP now allow the SELECT SINGLE without specifying the entire key.

> 4. what is the table name that will contain all the

> script form names and print program names?

TNAPR. Usually people use the views V_TNAPR or VN_TNAPR. The second also shows the SmartForm objects.

Read only

Former Member
0 Likes
628

Hi Baleeq,

<b>1. Difference between internal table and a dictionary table?</b>

<i>Internal tables</i> : Are user defined(<b>in the code</b>) tables , they are created at the time of runtime of the program and can hold data. They exist only during program runtime so are for temporary data storage.

<i>Dictionary table</i> : Are defined in SE11 and the definitions of the table are stored in the Database, so is the data present in it. Thus its a permanent storage of data.

<b>2.can you create an internal table dynamically?(at run time)</b>

Yes its possible to create Internal tables dynamically at runtime.

Check these blogs.

<a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap">SAP Developer Network Blog: Dynamic Internal Tables and Structures - ABAP</a>

<a href="/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table">SAP Developer Network Blog: Dynamic Internal Table</a>

<b>3. select sing * and select single * upto one row</b>

Both fetch a single record from the database table.

Difference is that <i>select sing *</i> requires specification of the key fields to fetch the data. While

<i>upto one row</i> needs no key specification.

<b>Note</b> :<i> select single * upto one row</i>, check your synatx there is nothing like this as far as i know, there is <i>select single *</i> and <i>select * up to 1 row</i>.

<b>4. what is the table name that will contain all the script form names and print program names?</b>

Check the table <b>TNAPR</b>

Regards,

<b>AS</b>

Read only

Former Member
0 Likes
628

hi

good

internal table->

An internal table is a run time instance. It get created when program starts execution.

*It get destroyed when program terminates. it has two different parts. HeaderLine(optional) & Body(Compulsory).

*Any value that comes to or goes from interanal table , that travels through headerline.\

*A related program is .

*declaration.

data: begin of inernaltable occurs 0,

x type c,

y type i,

end of itab.

*initializing headerline

internaltable-x = 'd'.

internaltable-y = 34.

*storing value into internal table

appene internaltable .

appene internaltable .

appene internaltable .

*reading internal table

loop at itab .

write: / internaltable-x, internaltable-y. "writes to output list

endloop.

database table->

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/content.htm

http://www.sap-basis-abap.com/saptab.htm

dynamic internal table->

http://www.sap-img.com/ab030.htm

Difference between select single and select upto one row->

Difference Between Select Single and Select UpTo One Rows

According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.

select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.

The best way to find out is through sql trace or runtime analysis.

Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.

The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.

The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.

Mainly: to read data from

The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.

4-Sap Table

TVARV

thanks

mrutyun