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

work area

Former Member
0 Likes
529

Hi Friends,

i have one std table kna1.

Now i wanted to create internal table & work area for this.

Anybody will tell me how to do this??

data: itab_kna1 type standard table of kna1,

wa_kna1 type kna1.

Is it right??

Hi Friends,

i have one std table kna1.

Now i wanted to create internal table & work area for this.

Anybody will tell me how to do this??

data: itab_kna1 type standard table of kna1,

wa_kna1 type kna1.

Is it right??

3 REPLIES 3
Read only

Former Member
0 Likes
495

Hi ,

You can use following syntax.

data: itab_kna1 type standard table of kna1,

wa_kna1 like line of itab_kna1.

Regards,

Sumit.

Read only

Former Member
0 Likes
495

yes that will work.You can also do like this :

types : begin of t_kna1.

include structure kna1.

types : end of t_kna1.

data :

gt_kna1 type standard table of t_kna1,

wa_kna1 type t_kna1.

Read only

Former Member
0 Likes
495

Hi Salil,

Yes your code will work perfectly.

however, if you dont need all the fields of standard table KNA1 or if you need more fields then in KNA1, then you can define a type,

types : begin of t_kna1,
          include structure kna1,
          field1 type abc,
          fiedl2 type dec,
        end of t_kna1.
or
types : begin of t_kna1,
          kunnr  type kna1-kunnr,
          field1 type abc,
          fiedl2 type dec,
        end of t_kna1.

and then define your table and work area with this sturcture.

Regards,

Richa.