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

structure

Former Member
0 Likes
748

what is the syntax to create structures .. i need to group some fields together

also how do i use them in my code

thanks !

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
727

Hi,

If you want to create a local structure in the program..Check the following..

  • Defining the structure.

DATA: BEGIN OF L_STRUC,

MATNR TYPE MATNR,

WERKS TYPE WERKS_D,

.........

END OF L_STRUC.

  • Populate the structure..

L_STRUC-MATNR = 'TEST'.

Thanks,

Naren

7 REPLIES 7
Read only

suresh_datti
Active Contributor
0 Likes
727

Use Tcode SE11 to create structures.

~Suresh

Read only

Former Member
0 Likes
727

If you want to create a structure in ur program , try this


types : begin of itab,
              matnr like mara-matnr,
              maktx like makt-maktx,
           end of itab.

Read only

Former Member
0 Likes
727

Hi megan,

In the program you can define as follows:

data: begin of work_area,

field1 type matnr_d,

field2(20),

field3 type i,

end of work_area.

Regards,

Ravi

Read only

Former Member
0 Likes
728

Hi,

If you want to create a local structure in the program..Check the following..

  • Defining the structure.

DATA: BEGIN OF L_STRUC,

MATNR TYPE MATNR,

WERKS TYPE WERKS_D,

.........

END OF L_STRUC.

  • Populate the structure..

L_STRUC-MATNR = 'TEST'.

Thanks,

Naren

Read only

Former Member
0 Likes
727

hi,

TYPES : BEGIN OF ty_test,

code TYPE i,

name(10) TYPE c,

amount TYPE p DECIMALS 2,

END OF ty_test.

regards,

priya.

Read only

Former Member
0 Likes
727

isnt there a structure keyword to be used ?

Read only

ferry_lianto
Active Contributor
0 Likes
727

Hi,

Please try this.


data: begin of itab.
        include structure ADRC.
data: field1(10),
      field2(10).
data: end of itab.

Regards,

Ferry Lianto