Skip to Content
Jul 05, 2010 at 05:54 PM

Object Services - How to loop at a table ' osreftab ' ?


Hi Object Services Gurus,

I'm try to transform a table selected via object services (transaction service) to a table with type VRM_VALUES (the one necessary to fill selection screen listbox parameters).

So, i have a table with type 'osreftab' and i need to loop it accessing the attributes of its lines (which i just know at runtime). How can i proceed with this? Below is what i'm trying..

* (This is a method of a global class which pretends to transform a variable 'osreftab' into a variable 'vrm_values').

DATA: l_wa_value TYPE VRM_VALUE,
           l_i_values TYPE VRM_VALUES.

DATA: l_o_tax_code TYPE OSREF.

* im_tax_codes type is osreftab

LOOP AT im_tax_codes INTO l_o_tax_code.
*l_wa_value-KEY = l_o_tax_code->?
*l_wa_value-text = l_o_tax_code->?
  APPEND l_wa_value TO l_i_values.