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: 

About statment Tables: *(TableName).

Former Member
0 Kudos

Hi,

In a SAP program, I saw a statement like this:

TABLES: *KNA1.

Can someone explain to me what that * means?

Thanks a lot!

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

it is like a mirror, you can use it as workarea. But it is old way of coding, it is obsolete.

Regards

vijay

6 REPLIES 6

Former Member
0 Kudos

Hai Yun

'*KNA1' Means Any single Character followed by KNA1.

Basic form

TABLES dbtab.

Effect

Makes the database table , view or structure dbtab known to the program. These objects are created by selecting Development -> ABAP/4 Dictionary . This transaction automatically defines an identical field string - the table work area - in the program. The names and the sequence of the fields of the table work area dbtab correspond exactly to the names and the sequence of the fields when declaring the database table or view in the ABAP/4 Dictionary . The ABAP/4 data type (see DATA ) and the length of the fields are derived from the data types in the ABAP/4 Dictionary as follows:

Dict. data type ABAP/4 data type

ACCP -> N(6)

CHAR n -> C(n)

CLNT -> C(3)

CUKY -> C(5)

CURR n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

DEC n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

DATS -> D

FLTP -> F

INT1 -> No correspondence

INT2 -> No correspondence

INT4 -> I

LCHR n -> C(n)

LRAW n -> X(n)

LANG -> C(1)

NUMC n -> N(n)

PREC -> X(2)

QUAN n, m, s -> P((n + 2) / 2) DECIMALS m [NO-SIGN]

RAW n -> X(n)

TIMS -> T

UNIT n -> C(n)

VARC n -> C(n)

The fields of the table work area are set to the initial values for their ABAP/4 data types (see DATA ). For the ABAP/4 Dictionary data types INT1 and INT2 , whole number fields of length 1 or 2 are created with the initial value 0 in the table work area.

The length of the table work area is not just the sum of the lengths of the individual fields. Depending on how different fields have to be aligned (Alignment ), the structure can contain nameless "holes".

Example

TABLES SPFLI.

SELECT * FROM SPFLI.

WRITE: / SPFLI-CARRID, SPFLI-CONNID.

ENDSELECT.

Notes

You can display the structure of the table work area in the ABAP/4 Editor by double-clicking on the table name.

The divisions for determining ABAP/4 field lengths are whole number divisions without rounding. The field of the table work area can accept numbers which contain one digit more than the ABAP/4 Dictionary data type allows. Such a situation results in a runtime error when writing to the database.

The table work area always has a global validity area. Even if the TABLES statement is specified in a FORM or FUNCTION , the work area is known when the subroutine has been defined. However, changes to the work area in a subroutine remain local to the FORM or FUNCTION . Therefore, it is advisable to specify the TABLES statement globally. You can keep changes to the table work area local to the subroutine with LOCAL .

Related DATA , TYPES

Thanks & regards

Sreenivasulu P

0 Kudos

Hi Sreenivasulu,

I know what TABLES statement does. But I'm not sure why there is a "*" in front of the table name.

Thanks!

Former Member
0 Kudos

that is the declaration of workarea , but now that statement is obsolete

reward points if helpful

former_member188685
Active Contributor
0 Kudos

Hi,

it is like a mirror, you can use it as workarea. But it is old way of coding, it is obsolete.

Regards

vijay

Former Member
0 Kudos

Hi Yun,

The structure of *KNA1 is same as KNA1.

Regards,

Arun.

0 Kudos

Thank you very much for your replies!