Skip to Content
author's profile photo
Former Member

Diff between the following declarations

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • author's profile photo
    Former Member
    Sep 29, 2005 at 12: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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 12:23 PM

    I think there is no difference between this 2 decleration.

    Alex

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 12: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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 12: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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 04:23 PM

    Hi,

    The two declaration are same.

    Sriram.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 29, 2005 at 04: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,

    Add comment
    10|10000 characters needed characters exceeded

    • Short answer......

      No difference.

      The OCCURS statement is "obselete".

      You can not use the OCCURS syntax in ABAP Objects. You must use TYPE TABLE OF

      Please remember to award points to all your fellow SDNers whose posts have helped you. Thanks.

      Regards,

      Rich Heilman