2006 Oct 09 2:42 PM
please have a look at the following piece of code.
itab1 & itab2 both are structures but
itab1 has two components "KEYPART" & "FUNCPART"
while itab2 has "NAME" & "SURNAME".
can anybody please explain what is this keypart & funcpart. and why we are getting different components for two structures.
DATA: BEGIN OF itab OCCURS 0,
name(10),
surname(10),
END OF itab.
data: itab1 type itab.
data: itab2 like itab.
please have a look at the following piece of code.
itab1 & itab2 both are structures but
itab1 has two components "KEYPART" & "FUNCPART"
while itab2 has "NAME" & "SURNAME".
can anybody please explain what is this keypart & funcpart. and why we are getting different components for two structures.
DATA: BEGIN OF itab OCCURS 0,
name(10),
surname(10),
END OF itab.
data: itab1 type itab.
data: itab2 like itab.
2006 Oct 09 2:47 PM
The reason is that in the data statement for ITAB1 you are referening a TYPE called ITAB that exists in the ABAP dictionary, double click on the word ITAB in this statement and you will see the defintion in the ABAP dictionary. The other statement is referencing the ITAB in your program because you are using LIKE.
REgards,
Rich Heilman
2006 Oct 09 2:47 PM
2006 Oct 09 2:55 PM
hi
good
the reason behind this is,
they have store two different value for the two different structures,
and as you have mentioned KEYPART and FUNCPART are two standard values store in the itab1 like that NAME and SURNAME are two values store in the table itab2.
thanks
mrutyun^
2006 Oct 09 2:56 PM
hi,
<b> TYPES and DATA have separate namespaces.</b> So, we can declare 2 variables with the same, out of which one can be done using TYPES and other using DATA.
ex: TYPES : name type i.
DATA : name type c.
DATA: V_new type name,
V_sec like name.
Now, v_new is of type I where as v_sec is of type C.
In your case also, check if itab is declared twice, one in TYPES and other in DATA. The one which you have shown is in DATA. So, check for the other in TYPES.
REgards,
Sailaja.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |