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

oo in Internal table

Former Member
0 Likes
559

hi frnds

some of them r telling that oo concept never allow Internal table with header ....i want 2 know that it is true r not ?...... is it true means they how selecting screen is working? it consist in build internal table with header.....

Hi Rama,

It is true that in OO internal table with header line is not allowed when passing to the methods as parameters only but not in the other cases. You will declare a work area inside your method or declare it globally to available to the class.

You wont pass select-options to the parameters of the methods.

Thanks,

Vinay

3 REPLIES 3
Read only

Former Member
0 Likes
540

hI ram

in case of oops concept we have to create header line and internal table separately and we have to process recors from separate work area to internal table..

Rewar points to all helpful answers,

kiran.M

Read only

Former Member
0 Likes
540

Hi Rama,

It is true that in OO internal table with header line is not allowed when passing to the methods as parameters only but not in the other cases. You will declare a work area inside your method or declare it globally to available to the class.

You wont pass select-options to the parameters of the methods.

Thanks,

Vinay

Read only

uwe_schieferstein
Active Contributor
0 Likes
540

Hello Ramasubramanian

In classes we (fortunately) have to use itabs without header lines. Thus, you always have to use table types, either from the DDIC or self-defined.

Example:

DATA:
  lt_knb1    TYPE STANDARD TABLE OF knb1,
  ls_knb1   TYPE knb1.

  SELECT * FROM knb1 INTO TABLE lt_knb1.

  LOOP AT lt_knb1 INTO ls_knb1.  " separate workarea, no header line

  ENDLOOP.

Within global classes you cannot call selection-screens directly. Instead you could call a function module where a selection screen is defined. You have to transfer the select-options (= itab with header line) to an itab without header line.

For details please refer to:

Regards

Uwe