‎2005 Dec 15 5:31 PM
Hi all,
This could be a silly question!! i have a z table with about 70 fields . I have a lot of criteria to check if a record canbe inserted into the ztable.
My questions is i have an internal table with include structure of the ztable. Is it possible to add a field to the internal table - tab- status and then the structure of the table. or do i need to write the internal table with 70 fields + the status. The status is for error check or success check.
data: begin of data occurs 0.
include structure ztable.
data: end of data.
this is what i am presently using how do i add the extra field to this internal table.
this field will not be inserted into the z table but just to check if the record can be inserted or no.
thanks in advance.
‎2005 Dec 15 5:35 PM
Hi,
You don't have to type all 70 fields.
You can do like this.
data: begin of data occurs 0.
include structure ztable
data : status(1),
end of data.
Thanks
Message was edited by: Govindarajan Seenivasan
Message was edited by: Govindarajan Seenivasan
‎2005 Dec 15 5:35 PM
Hi,
You don't have to type all 70 fields.
You can do like this.
data: begin of data occurs 0.
include structure ztable
data : status(1),
end of data.
Thanks
Message was edited by: Govindarajan Seenivasan
Message was edited by: Govindarajan Seenivasan
‎2005 Dec 15 5:39 PM
Hi,
You can always include structure & add fields to the internal table definition.
So you can define your Internal table as.
data: begin of data occurs 0.
include structure ztable.
data:new_field(10),
.....
.....
data: end of data.
Message was edited by: Phani Kiran Nudurupati
‎2005 Dec 15 5:41 PM
yes its possible.
types: begin of tp_data.
types:include structure ztable.
types: status type c.
tyeps: end of tp_data.
data : itab type standard table of tp_data with header l ine.
‎2005 Dec 15 6:09 PM
you can add the fields along with include structure in the following way....
data: begin of data occurs 0.
include structure ztest.
data : status(1),
end of data.try this..
‎2005 Dec 15 6:36 PM
you USE
data: begin of data occurs 0.
include structure ztable.
<b>data : v_tab(1) type c.</b>
data: end of data.
so now you will have DATA internal table with some records.but you cant use directly insert command with DATA internal table (if you add field V_TAB).
create a structure of same type ZTABLE.
so in loop at DATA.
move-corresponding DATA TO ZTABLE.
INSERT ZTABLE FROM ZTABLE.
*--check subrc/dbcnt & proceed further.
endloop.