HOW MANY WAYS TO DEFINE INTERNAL TABLES.
Answers were Sorted based on User's Feedback
Answer / girish m
there r so many ways to define internal table
1. data: begin of itab occurs 100,
matnr like mara-matnr,
mtart like mara-mtart,
end of itab.
2.data: begin of itab.
include mara.
data: end of itab.
3. data: begin of itab.
matnr like mara-matnr,
mtart like mara-mtart,
end of itab.
data: jtab type standard table itab,
gtab type itab.
4. data: itab like standard table of mara.
data: jtab like table itab.
5. data: itab like table of mara with header line.
Is This Answer Correct ? | 24 Yes | 10 No |
Basically there are 3 methods of creating the internal table which are used frequently, are as following:
1) for ex.
data: it_mara type table of mara.
note: after type table of, always a structure is used.
hence, here we call it structure mara not table mara.
and one thing more, here we can use like table of . but
it is not recommend. it is mostly used method.
2) for ex.
data: it_mara type mara occurs 0.
it means it_mara is a internal table of type mara.if we
write:
data: it_mara type mara occurs o with headerline.
it means there will be a internal table and a workarea
with the same name i.e. it_mara. hence it will little
confusing.
3) tables mara.
data: it_mara like mara occurs 0.
here, with the help of first statement, a workarea will be created with the name of mara and second statement will crate internal table with the name of it_mara. This is also little confusing because we mara is also of database table name and here it is also name of work area.
for exe.
select *
from mara
into mara.
hence, first method is most suitable and it should be used.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / krishna
data:itab type standard table of strcture name with header line.
data: itab1 type strcture name.
Is This Answer Correct ? | 2 Yes | 1 No |
What are the general naming conventions of ABAP programs?
What is an abap dictionary? : abap data dictionary
What is ALV?
Explain what are the events used for logical database?
What is the function of a data element? : abap data dictionary
Define subtype ? : abap hr
what is table maitainance generator and how to create that? what is transaction code?
What kind of financial periods exist in SAP? What is the relevant table for that?
What is get cursor field?
Is exit a function module?
How can we handle table control in bdc? : abap bdc
In Badi wher is the standard prograam name to add the additional progaram