Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Syntax question

Former Member
0 Likes
538

Hello,

A syntax question that I have.

I have seen example of this type of code many times.



DATA: 
	asdf   TYPE /aaa/bbb.

  CALL METHOD some_object->some_method
    EXPORTING
      some_var   = asdf[].

What are angle brackets here for?

Thank you.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
510

the brackets mean that you are passing the body of an internal table without the header line.

This is kind of redundant as you are not allow to use header lines with ABAP OO anyway.

Just remember that it means that you are passing an internal table.

Regards,

Rich Heilman

Read only

0 Likes
510

Hello Rich,

what is header line?

Thank you.

Read only

0 Likes
510

Header line is like a built in work area in which a line of the interal table is read. When you loop at an internal table, the line of data needs to go somewhere, if you have declared with a header line, no problem reading like this.


data: itab type table of string with header line.

Loop at itab.
Write:/ itab.
endloop.

If you have not declared with a header line, then you must declare a work area to put the data into.

data: itab type table of string.
data: wa type string.
Loop at itab into wa.
write:/ wa.
endloop.

Remember, declaring an internal table like this, the header line is implied.

Data: begin of itab occurs 0,
      fld1 type string,
      end of itab.

Most important, header lines are illegal in ABAP OO. So get used to not using them.

Regards,

Rich Heilman

Read only

suresh_datti
Active Contributor
0 Likes
510

asdf[] imply the contents of an itab asdf.

Regards,

Suresh Datti