‎2008 Apr 30 5:50 AM
hi
experts
types : BEGIN OF WA_KNA1,
CNO(10) TYPE C,
COUNTRY TYPE LAND1_GP,
NAME LIKE KNA1-NAME1,
END OF WA_KNA1.
data : wa_kna2 type wa_kna1.
1.DATA IT_KNA1 like TABLE OF WA_KNA2.
2. data it_kna2 type table of wa_kna1.
in 2nd statement i replace wa_kna1 with wa_kna2.
it shows error that wa_kna2 unknown...
can any body explain..
*********************************************************************************
data : BEGIN OF WA_KNA1,
CNO(10) TYPE C,
NAME LIKE KNA1-NAME1,
END OF WA_KNA1.
1. DATA IT_KNA1 like TABLE OF wa_kna1.
2. data it_kna1 type table of wa_kna1.
2nd stametn is shows error.
please explain....
Regards..
Spandana
‎2008 Apr 30 6:25 AM
Hi
The problem is, if u declare WA_KNA1 in TYPES...the stmt
data it_kna2 type table of wa_kna1 ..will go and check WA_KNA1 in TYPES declaration. In general if u define TYPE TABLE OF in data declaration,, ABAP will go and check in TYPES declaration.....
But if u define LIKE TABLE OF it will go and check in DATA declaration whether refering table exists or not...
Rewards if usefulll !!!!
Regards,
ABAPer 007
‎2008 Apr 30 5:55 AM
hi,
do this way ..
data : wa_kna2 like wa_kna1.
data it_kna1 type standard table of wa_kna1.
regards,
Santosh
‎2008 Apr 30 6:10 AM
‎2008 Apr 30 5:56 AM
hi,,
data it_kna2 like wa_kna2.wa_kna2 is not defined in types...so u should use like and not type.
regards,
madhumitha
‎2008 Apr 30 8:15 AM
Hello Madhumitha,
I feel sorry for you. Spandana hasn't provided you with a single point even you answered his/her question correctly (though there was a little typing mistake: "like table" instead of "like"). Spandana gave all 10 points to ABAPer 007. That's not fair.
Regards,
Heinz
‎2008 Apr 30 6:25 AM
Hi
The problem is, if u declare WA_KNA1 in TYPES...the stmt
data it_kna2 type table of wa_kna1 ..will go and check WA_KNA1 in TYPES declaration. In general if u define TYPE TABLE OF in data declaration,, ABAP will go and check in TYPES declaration.....
But if u define LIKE TABLE OF it will go and check in DATA declaration whether refering table exists or not...
Rewards if usefulll !!!!
Regards,
ABAPer 007
‎2008 Apr 30 12:51 PM
hi
i am using line type & row type..
i created line type as zline, table type as ztab with line type of zline in se11.
when i declare like this
1. data :w_it type ztab
it gives the body of ztab..
where
while we r declaring in standard table like mara..
2. data : w_it type mara.
it gives the work area of mara.
types : BEGIN OF WA_KNA1," occurs 0,
CNO(10) TYPE C,
COUNTRY TYPE LAND1_GP,
NAME LIKE KNA1-NAME1,
END OF WA_KNA1.
3 .data : w_it type wa_kna1. " it also gives the work area
please expalin wt diff b/w 1,2, 3
Regards..
Spanadana
‎2008 May 01 7:16 AM
Hi,
1. wa_it has the structure as ztab has,
2. wa_it has the structure of mara and
3. wa_it has the structure of wa_kna1, i.e. it consists of the fields cno, country and name.
None of the three data declarations is an internal table!
Have success,
Heinz
‎2008 May 02 6:11 AM
hi
henz
thanks to reply
but in 1. statemnet
i t shows the body of the ztab( table type)
not strucutre..
while othere shows structure..
can u explain..
Regards
Spandana
‎2008 May 02 4:13 PM
Hi Spandana,
Statement 1 shows you the body in case when your ztab is declares as TYPE TABLE.
Hope it helps,
Heinz
‎2008 May 03 4:50 AM
hi
heinz
thank u very much
i understand completely....
thank u
Spanadana