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

Issue with internal table in object oriented ABAP.

Former Member
0 Likes
424

Hello Gurus,

I am having trouble defining internal table in Object oriented ABAP. for following:

DATA: BEGIN OF IT_TAB OCCURS 0.
        INCLUDE STRUCTURE ZCUSTOM.
DATA    tot_sum   TYPE char40.
DATA END OF IT_TAB.

Can someone help ?

Regards,

Jainam.

Edited by: Jainam Shah on Feb 5, 2010 8:33 PM

Edited by: Jainam Shah on Feb 5, 2010 8:33 PM

Moderator message - Please post in the correct forum. You can easily find out for yourself by looking at SAP help for internal tables using OOP - thread locked

Edited by: Rob Burbank on Feb 5, 2010 2:49 PM

2 REPLIES 2
Read only

Former Member
0 Likes
387

No, you can not declare internal table with header line in OO context. You have to declare the work are/header line separately

Example:


TYPES: BEGIN OF ty_it_tab.
        INCLUDE STRUCTURE mara.
TYPES:  tot_sum TYPE char40.
TYPES: END OF ty_it_tab.

DATA: it_tab TYPE STANDARD TABLE  OF ty_it_tab.
DATA: wk_tab TYPE ty_it_tab.

.
.
.
.
.
LOOP AT it_tab INTO wk_tab.
ENDLOOP.

Edited by: Dean Q on Feb 5, 2010 8:50 PM

Read only

Former Member
0 Likes
387

Give it a shot this way.


DATA:
  BEGIN OF wk_0500_scr_rec.
        INCLUDE STRUCTURE zlmfoll.
DATA:
  cont_ty_2 LIKE zlmfoll-cont_ty,
  END OF wk_0500_scr_rec.
DATA:
  my_table like standard table of wk_0500_scr_rec.