cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass a internal table used in one method to another method in a view

Former Member
0 Kudos

hi all,

Is it possible to pass a internal table from one method to another method in a view??

If so , kindly help me.

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Bala,

Another possibility is to have a table category that has the same structure as your internal table. Suppose you need to pass an internal table of type SCARR: you'll actually pass a parameter of type SCARR_TAB (look for it into tcode SE11). If you dont have any such standard type available then you can create a custom table type with your desired structure & then use it in the methods signature (while declaring your input parameters type).

Regards,

Uday

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Balamurugan,

you can do more simple way i.e declare a global internal table in component controller attributes.Populate internal table in one method and you can use the same in another method.

Go to Component controller attributes

Attribute Public Refto Associated type

gt_table select ty_t_table " use table type

Former Member
0 Kudos

Hi Bala,

Just try this code .

call method lo_nd_ship_details->get_static_attributes_table

  • EXPORTING

  • FROM = 1

  • TO = 2147483647

importing

table = it_final_out.

Here the lo_nd_ship_details is the instance ..you can give any name as per you. And it_final_out is the internal table which value you want to pass the other method.

Thanks,

Satya

uday_gubbala2
Active Contributor
0 Kudos

Hi Bala,

If you want to pass this internal table between different methods of the same view then write the contents of this internal table to a context node of your view using BIND_TABLE. You can then read the contents of this internal table from the other method using the reference of that node & the GET_STATIC_ATTRIBUTES_TABLE method.

However if you want to pass the internal table between methods of different views then create a context node at the COMPONENTCONTROLLER level & then do a context mapping of this node to your local views context in both your views. You can follow the same BIND_TABLE & GET_STATIC_ATTRIBUTES_TABLE methods approach.

Regards,

Uday