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

Regarding accessing internal tables

Former Member
0 Likes
869

Hi All,

I have a small requirement. I have an internal table for example IT_X and it has a field Y(it has more fields other than Y) and this field Y is of internal table IT_Z.

IT_Z has some fields a,b,c....

Now I need to access field b from IT_X.

I have tried to access it like IT_X-Y-b.But I am unable to access it.

Please help.

Thanks in advance

LRK

Hi All,

I have a small requirement. I have an internal table for example IT_X and it has a field Y(it has more fields other than Y) and this field Y is of internal table IT_Z.

IT_Z has some fields a,b,c....

Now I need to access field b from IT_X.

I have tried to access it like IT_X-Y-b.But I am unable to access it.

Please help.

Thanks in advance

LRK

6 REPLIES 6
Read only

Former Member
0 Likes
846

Hi,

if your IT_X has field 'b' then you can directly access it by giving IT_X-b.

why are you using Y field in between (Is Y a structure which has field B).

Regards,

Syed

Read only

0 Likes
846

Hi Syed,

IT_X has a field called Y and Y is of table IT_Z and this IT_Z has a field called b. (or y has a field called b)

I am trying to access b through IT_X.

Hope now you got my question.

Thanks

LRK

Read only

Former Member
0 Likes
846

Hi;

You can do like this

1.

loop at it_x

loop at it_z where b = it_x-y.

endloop.

endloop

2.

read it_x

if sy-subrc eq 0.

read it_z with key b = it_x-y.

endif.

Regards

Shashi

Read only

Former Member
0 Likes
846

Hi ,

In this regard, you cannot access field of some internal table through field refrence.

If you want to do it you have to add the same feild in the Interanl table X and with a common field of refernce between internal table X and Z . and then you can access it,

Regards,

Nitin.

Read only

0 Likes
846

Hi All,

It got resolved.

First the internal table is moved to work area and then could be accessed.

Thanks All for the help.

Regards,

LRK

Read only

Former Member
0 Likes
846

This message was moderated.