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

referencing structure fields

Former Member
0 Likes
1,398

i have declared my structure as shown below

TYPES: t_mast TYPE STANDARD TABLE OF zrmmast.

DATA: it_mast TYPE t_mast.

how do i reference the fields for structure it_mast say for example table zrmmast has a field status and i want to reference field status using it_mast.

i want to select from TAB where status = status of structure it_mast

9 REPLIES 9
Read only

Former Member
0 Likes
1,062

Hi

You can access all the fields of the table zrmmast using the structure it_mast

ie you can say it_mast-status or any field followed by it_mast-...

Reward points for useful Answers

Regards

Anji

Read only

0 Likes
1,062

thanx but i tried that and it gave me this error "IT_MAST is a table without a header line and therefore has no component called status". any other idea

Read only

0 Likes
1,062

HI,

Your IT_MAST is not a strucutre dude..

its an internal table thats why you cannot refer its fields like that,

what you can do is in you second DATA statement use as follows

DATA: IT_MAST like line of t_mast.

Regards,

Sesh

.

Read only

Former Member
0 Likes
1,062

select * from TAB where status = it_mast-status.

Thanks,

Max

Read only

0 Likes
1,062

thanx but i tried that and it gave me this error "IT_MAST is a table without a header line and therefore has no component called status". any other idea

Read only

Former Member
0 Likes
1,062

Hi,

define work area

wa_mast type t_mast.

you need to loop at it_mast into wa_mast and then refer

select ...... where status = wa_mast-status..

rewards if useful

regards,

nazeer

Read only

0 Likes
1,062

thanks but its now giving me this error: it "wa_mast cannot be converted to the line type of it_mast"

Read only

0 Likes
1,062

Hi,

If you want to create a work area create it as I have told

<b>DATA: wa_area like line of t_mast.

OR event better

DATA: wa_area type zrmmast.</b>

t_mast is an internal table and for creating a work area you have to use its line type.

Regards,

Sesh

.

Read only

Clemenss
Active Contributor
0 Likes
1,062

Hi willard,

it is difficult to know your situation in detail.

post your relevant code (don't forget to use Code button above) and people will flood you with answers.

In the meantime, find out the difference between structures, internal tables, types ans so on.

Regards,

Clemens