2008 Apr 13 6:46 AM
Hi experts,
What is the difference between the following 2 syntax:
data: lt_vbak like table of vbak.
data: ls_vbak like vbak.
I will reward all the helpful answers.
Thanks,
Ajay.
2008 Apr 13 6:50 AM
Hi Ajay,
Means defining one internal table lt_vabk with structure of VBAK which has been defined in the Dictionary.
data: lt_vbak like table of vbak.
Means defining one structure or work area with structure of VBAK which has been defined in the Dictionary.
I hope that it helps u.
Regards,
Venkat.O
data: ls_vbak like vbak.
Hi experts,
What is the difference between the following 2 syntax:
data: lt_vbak like table of vbak.
data: ls_vbak like vbak.
I will reward all the helpful answers.
Thanks,
Ajay.
2008 Apr 13 6:50 AM
Hi Ajay,
Means defining one internal table lt_vabk with structure of VBAK which has been defined in the Dictionary.
data: lt_vbak like table of vbak.
Means defining one structure or work area with structure of VBAK which has been defined in the Dictionary.
I hope that it helps u.
Regards,
Venkat.O
data: ls_vbak like vbak.
2008 Apr 13 6:53 AM
Hello Venkat,
From your reply it seems that the following 2 syntax:
data: ls_vbak like vbak.
&
data: ls_vbak like line of vbak.
are same?
Is it true?
Thanks,
Ajay.
2008 Apr 13 6:59 AM
No Ajay. Both syntax are not same.
You have to write like below.
Above statements syntax correct. But ls1_vbak and ls2_vbak structures are same.
Regards,
Venkat.O
DATA: ls1_vbak LIKE vbak.
DATA: lt_vbak LIKE TABLE OF vbak.
DATA: ls2_vbak LIKE LINE OF lt_vbak.
2008 Apr 13 7:06 AM
2008 Apr 13 6:56 AM
Hi ,
data: lt_vbak like table of vbak.
This will create an internal table without header line.
data: ls_vbak like vbak.
This will create only work area or structure.
Regards,
Nishant
2008 Apr 13 6:56 AM
Hi ajay,
the first statement
data: lt_vbak like table of vbak.
declares a table lt_vbak having the same structure as vbak
the second statement
data: ls_vbak like vbak.
will not create a table,instead it will create a work area/headerline (a table line) having the same structure of vbak
2008 Apr 13 6:57 AM
Dear Ajay,
The first statement creates an internal table without header line where every row is of same type as VBAK.
The second statement creates a structured variable which has the same type as VBAK.
Internal table is a variable in ABAP program and denotes an array where each element has the same type and structure as VBAK.
(VBAK is a database table and referring to VBAK in ABAP only refers to the structure of VBAK's one row, not the array/ complete table in the database)
Regards, Rakesh
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |