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

access a field from structuture

Former Member
0 Likes
816

Dear Sir,

How can we access fields of structure in a program ? Structure name is mv10a and field name is kdmat.

I want include this structre in a program so that customer part no can be included in a program

Thanks

Anuradha

6 REPLIES 6
Read only

Former Member
0 Likes
776

Anuradha,

see structure are works exactly as work area they are hoding only one value at a time.so you can use them same way as we use work area in program.

like:

mv10a-kdmat.

Amit.

Read only

bpawanchand
Active Contributor
0 Likes
776

Hi

How can we access fields of structure in a program ? Structure name is mv10a and field name is kdmat.

here is the sample snippet

DATA : fs_struct TYPE mv10a.

*------For Accesing

Fs_struct-KDMAT.

Regards

Pavan

Read only

Former Member
0 Likes
776

Hi,

you defenitely can.

use the syntax:

mv10-kdmat

to refer the field.

Regards,

Anirban

Read only

Former Member
0 Likes
776

Hi,

Its same way as you use the table field..

<Table/Structure name>-<field>.

Regards

Narin

Read only

Former Member
0 Likes
776

Hi anuradha,

You can access the field of a structure in the following manner..

<Structure name>-<Field Name>

Eg, If you want to write the field kdmat of structure mv10a

write mv10a-kdmat

.

Best of luck,

Bhumika

Read only

Former Member
0 Likes
776

Hi,

If you want to use the structure, you can define an object using DATA. Then you can use it like workarea.

See the sample.

DATA x_sample type mv10a.

you can reference the filed like x_sample-kdmat.