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

Header & work area (difference)

Former Member
0 Likes
1,010

hi all,

what is the diff. betw header line & work area?

1 ACCEPTED SOLUTION
Read only

venkata_ramisetti
Active Contributor
0 Likes
964

Hi sanjeev,

If we are talking about internal table then header line and work area are same.

Thanks

Ramakrishna

8 REPLIES 8
Read only

venkata_ramisetti
Active Contributor
0 Likes
965

Hi sanjeev,

If we are talking about internal table then header line and work area are same.

Thanks

Ramakrishna

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
964

Hi,

header line is part of the internal table where as workarea is data object with same structure as of your internal table.

There is no difference in the structure the only difference is how you address it.

If you have internal table with header line then

IT_TAB is the workarea (Header line) and IT_TAB[] is the internal table.

If you have internal table with out headerline then you create the work area as follows

DATA: work_area like line of it_tab.

CLEAR on IT_TAB clears the headerline if the table is with header line other wise entire table.

You should use REFRESH if you want to clear the internal table which is with headerline.

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

Read only

former_member480923
Active Contributor
0 Likes
964

Hi

There's no difference in working principal, only the defination portion is the difference. The Header area coes implicitly with the table defation when you define like this

data: begin of t_itab occurs 0,
        ............
        end of t_itab. 

data: wa_itab type type_strc......

but for itabs defined with reference to type structures the headers are not avialable for them the wok areas are must.

Hope that Helps

Anirban M.

Read only

gopi_narendra
Active Contributor
0 Likes
964

data : it_tab type standard table of ty_itab. is internal table declaration.

data : wa_itab type ty_itab. is work area declaration

data : being of itab occurs 0,

..............

end of itab.

Here both internal table and work are in same declaration.

Regards

- Gopi

Read only

messier31
Active Contributor
0 Likes
964

Hi Sanjeev,

Header and workarea performs the same functionality of temporarily storing internal table data . All headers are work area but all workareas are not header.

Header is the workarea created along with the internal table declaration, where as workarea are created separately i.e separate declaration exit for work area.

Header is the part of the internal table where as work area is not.

Header is created using WITH HEADER LINE with internal table declartion where as work area

may be create using like or type.

Hope this solves your doubt..let me know if not...

Enjoy SAP.

Pankaj Singh.

Read only

Former Member
0 Likes
964

While adding or retrieving records to / from internal table we have to keep the record temporarily.

The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.

<b>Header line is a implicit work area for the internal table.</b> It depends on how the internal table is declared that the itab will have the header line or not.

e.g.

data: begin of itab occurs 10,

ab type c,

cd type i,

end of itab. " this table will have the header line.

data: wa_itab like itab. " <b>explicit work area for itab</b>

data: itab1 like itab occurs 10. " table is without header line.

The header line is a field string with the same structure as a row of the body, but it can only hold a single row.

It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
964

Hello,

The only difference is how you address them, though the structure are the same.

Regards,

Shehryar Dahar

Read only

Former Member
0 Likes
964

thanks for ur reply. now i am clear.