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

Passing asterick with Table name in programs

Former Member
0 Likes
1,659

Hello friends,

i have a doubt in my mind. in a program of previous version , i saw a statement like as follws:

TABLE: *MBEW.

what is significance of putting * in front of the table? i m not able to get the use of this statment.

can nayone tell me the proper meaning of this statement. also, is this statement is still in use or not?

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
987

TABLES: *MBEW.

It has the same effect as that os the statement TABLES: MBEW.

(which create a work area with the same structure as that of MBEW

table)

TABLES: *MBEW.

it will create an aditional work area.

Ex:

TABLES: *MBEW.

SELECT SINGLE * FROM MBEW INTO *MBEW.

will retrieve a single record into the work area with the name *MBEW

6 REPLIES 6
Read only

Former Member
0 Likes
987

Hi

<u>This was used in earlier SAP version (4.5 B or less). This is not recommended by SAP in future versions.

The purpose of using *Table-name was to create a Hader structure of the table.

To use the header area of the table as the work-area (without specifying any internal table ).</u>

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Read only

Former Member
0 Likes
988

TABLES: *MBEW.

It has the same effect as that os the statement TABLES: MBEW.

(which create a work area with the same structure as that of MBEW

table)

TABLES: *MBEW.

it will create an aditional work area.

Ex:

TABLES: *MBEW.

SELECT SINGLE * FROM MBEW INTO *MBEW.

will retrieve a single record into the work area with the name *MBEW

Read only

0 Likes
987

Thanks a lot suresh,

i got the solution.

Read only

Former Member
0 Likes
987

*table name = means to create the workarea with the same name as table name.

you have only one choice to create the 2 table work areas with the same name as tablename. we will go to this option

Read only

Former Member
0 Likes
987

Hi vivek,

Work area * not allowed

In ABAP Objects it is not allowed to specify * work areas as names for database tables and work areas.

Error message in ABAP Objects if the following syntax is used:

SELECT ... FROM *dbtab INTO ...

INSERT *dbtab.

UPDATE *dbtab.

DELETE *dbtab.

MODIFY *dbtab.

Correct syntax:

DATA wa TYPE dbtab.

SELECT ... FROM dbtab INTO wa.

INSERT dbtab FROM wa.

Or

INSERT INTO dbtab VALUES wa.

UPDATE dbtab FROM wa.

Or

UPDATE dbtab SET ... .

DELETE dbtab FROM wa.

Or

DELETE FROM dbtab WHERE ...

MODIFY dbtab FROM wa.

Reason:

The declaration of work areas that are suitable for the respective types using the DATA statement replaces the declaration of * work areas. * work areas can only be declared using the TABLES statement, which is not allowed in ABAP Objects. * work areas can only be used in the forbidden short forms of the Open-SQL statements.

regards,

keerthi

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
987

Hi,

This is the information I got from SDN once.

The * notation is used to contain the temporary values for a table work area.

This need not be limited to the Standard SAP Code. In your programs you would very often declare temporary work areas like -

tables vbak...data lt_vbak like table of vbak.data ls_vbak like line of vbak....data ls_temp_vbak like vbak..

It might be a good idea to have *vbak instead of ls_temp_vbak. That of course depends on the naming conventions you would want to follow for all your custom developments. It is just a convenient and more readable way of declaring the temporary structure.