cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logic for accessing data in internal table that has reference to object.

former_member761924
Participant
0 Likes
1,797

There is an internal table with fields as below.

Inside the infotype reference, there is an attribute A_PRIM_INFTY_RAW_TAB which is a table.

I need to access this table. Could you please help me with writing code to access this table.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

SimoneMilesi
Active Contributor
0 Likes

Hello, you can do something like

FIELD-SYMBOLS: <fs> TYPE ANY,
               <ftab> TYPE ANY TABLE.


READ TABLE A_INFOTYPE_REF_TABLE INDEX 1 ASSIGNING <fs>.
ASSIGN COMPONENT 'A_PRIM_INFTY_RAW_TAB' OF STRUCTURE <fs> TO <ftab>.

Then you have your desired internal table in <ftab>.

former_member761924
Participant
0 Likes

But A_PRIM_INFTY_RAW_TAB is attribute inside the reference of the A_INFOTYPE_REF_TABLE.

FredericGirod
Active Contributor

You have to declare a data TYPE REF TO the class, and create a local friend to access this table. Did you see my comment ?

SimoneMilesi
Active Contributor
0 Likes

Hi liki999 ,

If A_PRIM_INFTY_RAW_TAB is a private attribute, you can invoke the corresponding method of class CL_ECPAO_IN_INFOTYPE_0000 to read it.
Your object will be <FS> and you can invoke it like <fs>-method_to_get_data() (sorry, i've not such class in my system).

Edit:
Refer to frdric.girod comment 🙂