Application Development 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: 

How to create an internal table with a types structure?

former_member384574
Active Participant
0 Kudos

Hi experts,

I've 3 internal tables with the same structure, I think I could put a type structure and put that type inside the body of the internal data, is this possible? If true, how can I put that?

Example:

TYPES: Begin of type_s,

pernr like pa0001-pernr,

end of type_s.

Data: begin of itab_1 occurs 0,

¿¿¿??? reference to type_s

end of itab_1.

Thanks a lot,

Regards,

Rebeca

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Data itab_1 type standard table of type_s.

is the declaration for internal table without workarea.

As suggested, use f1 help for more information

16 REPLIES 16

former_member181995
Active Contributor
0 Kudos

I would suggest you to hit F1 !

Cheers

Former Member
0 Kudos

Hi,

TYPES: Begin of type_s,

pernr like pa0001-pernr,

end of type_s.

Data: itab_1 type standard table of type_s.

You can use sorted or hashed instead of standard.

Regards,

Kumar Bandanadham

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Data itab_1 type standard table of type_s.

is the declaration for internal table without workarea.

As suggested, use f1 help for more information

0 Kudos

Thanks a lot, the question...can I use this?

DATA: BEGIN OF ITAB_1 OCCURS 0,

INCLUDE STRUCTURE types_s,

DATA: END OF ITAB_1.

Or this is only for internal tables? And If I want a workarea?

Thanks, and sorry I don't have available help from F1.

Thanks,

Regards,

Rebeca

0 Kudos

Hi,

Use like this..

DATA: Begin of type_s,

pernr like pa0001-pernr,

end of type_s.

DATA: BEGIN OF ITAB_1 OCCURS 0.

INCLUDE STRUCTURE type_s.

DATA: END OF ITAB_1.

Otherwise like this.

types: Begin of type_s,

pernr like pa0001-pernr,

end of type_s.

Data: itab_1 type standard table of type_s.

Note: You have to create work area explicitly.

Like this

data wa like itab1.

Edited by: Velangini Showry Maria Kumar Bandanadham on May 26, 2009 1:04 PM

0 Kudos

>

>

> Thanks, and sorry I don't have available help from F1.

>

> Thanks,

> Regards,

> Rebeca

If you cannot avail F1 help, where are you typing ABAP code, in .NET IDE ? LOL

Regards

Karthik D

0 Kudos

Ok, thanks, It was the way I first thought, but I was not sure that works.

Thanks a lot, everybody.

Regards,

Rebeca

0 Kudos

I don't know why I don't have that option, but I can't see anything of Sap help....

0 Kudos

Hi,

Yes you can.But that is the declaration for internal table with header line with implicit work area. But it is always advisable to declare internal table and work area as below.

Data itab_1 type standard table of type_s.

is the declaration for internal table without workarea.

data wa type type_s.

is the workarea declaration.

0 Kudos

>

> I don't know why I don't have that option, but I can't see anything of Sap help....

This is a serious trouble!

Have a look at

0 Kudos

It happens also if you install IE7.Just remove it and check.

[Documentation not visible in Sap help|]

0 Kudos

>

> It happens also if you install IE7.Just remove it and check.

Nopes. I m using IE7 itself. And I never encounter such problem with IE7.

0 Kudos

Amit,

Sap GUI is not compatible with IE7 in some ocassions.

Did you check the link in the thread which i gave earlier.

Even one of my colleague had got the same experience and

succeded after uninstalling it.

0 Kudos

Yep I checked.

May be I'm having correct patch level?

0 Kudos

Hi Rebeca

You can use the next declarations:

Data itab_1 type standard table of type_s.  " for the internal table

* and
data  wa_1 like line of itab_1.    " for the work area.

Former Member
0 Kudos

hi,

TYPES: Begin of itab,

pernr like pa0001-pernr,

end of itab.

Data: itab1 type standard table of itab,

itab2 type standard table of itab,

itab3 type standard table of itab.

work area

data: w_itab type itab.