cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform

Former Member
0 Kudos

Hi All,

Is it possible to use 'Headderless Internal Table' and 'Internal table with header line' in Smartform.

Which one of the two option is convinient to use in Smartform and Why?

Regards,

Deepak.

Accepted Solutions (1)

Accepted Solutions (1)

former_member609120
Contributor
0 Kudos

If you use a table with header line, then while displaying the data you specify &itab-fieldname&

If you use table without a header line, then while displaying the data, you have to loop from itab into wa, then specify &wa-fieldname&

For further explanation:

You access internal tables record by record. You must use a work area as an interface for transferring data to and from the table.

When you read data from an internal table, the contents of a specified table record or line overwrites the contents of the work area. Then, you can reference the contents of the work area in your program. When you write data to an internal table, you must first enter the data in the work area from with the system can transfer the data to the internal table.

To avoid inconsistencies, it is beneficial if the work area has the same data type as the records or lines of the internal table. A safe procedure for creating work areas which are compatible with internal tables is to use the same data type for declaring both the internal table and the work area.

In ABAP/4, you can distinguish between two kinds of internal tables:

Internal tables WITH header lines

Internal tables WITHOUT header lines

A header line is similar to a work area for a database table. A work area is used as temporary storage for one entry of a database table. In a similar way, a header line is used to hold one line of an internal table.

An internal table with header line is a tuple from a work area (header line) and the bulk of the table itself. Both are addressed using the same name, the interpretation of the name is context-sensitive. Hence it would stand for the header line in a MOVE statement, but would stand for the bulk of the table in a SEARCH statement.

When you create an internal table WITH a header line, a work area is created automatically with the same data type as the rows of the internal table. The header line and the internal table have the same name. Then, the system uses this work area implicitly.

In ABAP/4 statements for accessing internal tables, you can specify the work area to be used. For internal tables with header lines, you can leave out this specification. Then, the system uses the table work area implicitly.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

generally in internal table we go for headerless internal table, a workarea for that. bcoz when we r printing the data through table, there in data node, we'll give loop itab into workarea.

when ur passing data from driver program, in form interface definr itab type mara. in global definition define w_mara type mara.

when ur not passing data from internal table then u define them in global definitions

itab type table of mara.

w_mara type mara.

hope this helps u. still any doubts, post them.

reward if helpful.