‎2005 Sep 29 1:14 PM
Diff b/n the fllowing declarations
*data: begin of ITAB1 occurs 0.
include structure /nam/abc_dates.
*data: end of ITAB1.
and
data : ITAB2 TYPE TABLE OF ITAB2 WITH HEADER LINE.
and please let me know
how to declare and use interanl table in two diff function modules in the same function group
Message was edited by: Pavankumar P
‎2005 Sep 29 1:21 PM
hi,
when u use begin of for defining internal table then the header line will be included automatically in other cases we need to specify the Header line explicitly or we woke with work area.
cheers,
sasi
‎2005 Sep 29 1:23 PM
I think there is no difference between this 2 decleration.
Alex
‎2005 Sep 29 1:27 PM
So if I'm right you want to use the same table globally within one function group - right?
To do so, add a top include to your group and declare your table there. It will be available and changable in any of your function modules.
Concerning your two table declarations:
the first of the declarations defines a table without a header line. You have to use the table in loops and read table declarations always transferring a table line to a workarea. E.g.:
LOOP AT itab INTO workarea.
[...work with "workarea"]
ENDLOOP.
The second declaration (which is obsolete) defines a table with header line, which can be used in loops as follows:
LOOP AT itab.
[... work with "itab"]
ENDLOOP.
use the declaration
DATA itab TYPE TABLE OF struc_type [OCCURS 0]
to declare an internal table without header line.
Best regards
Wolfgang
‎2005 Sep 29 1:31 PM
its wrong Ralf,
The decleration of internal table starts (Begin of), its automatically have the header line.
Alex
‎2005 Sep 29 1:30 PM
no difference, both the tables have header line, first declaration create internal table with header line where in second declaration you have to explicitely add WITH HEADER LINE otherwise it will create internal table without header line.
‎2005 Sep 29 2:24 PM
No Difference. The only thing is that you need to specify the OCCURS 0 addition in the first declaration.
Amit
‎2005 Sep 29 5:23 PM
‎2005 Sep 29 5:33 PM
Hello Pavan,
Welcome to SDN.
While declaring internal table you can basically use occurs 0 addition or
DATA itab {TYPE TABLE OF linetype|LIKE TABLE OF lineobj}.
Effect
This is a shortened form of the definition of a standard table. It corresponds to
DATA itab {TYPE STANDARD TABLE OF linetype|
LIKE STANDARD TABLE OF lineobj} WITH DEFAULT KEY.
or the old definition (compare variant 4)
DATA itab {TYPE linetype|LIKE lineobj} OCCURS 0.
If you add WITH HEADER LINE, then it creates a work area or header.
Coming to other point of declating internal tables in two different function in the same Func Grp
Use the following path GOTO --> Global data and then declare your internal tables there.
These tables can be used globally in all function modules assigned to that func grp.
Thanks,
‎2005 Sep 29 5:57 PM