‎2011 Feb 15 2:29 PM
I have been asked to populate an export variable that actually references the table type of an interface. So in SE11 the Zxxxx table type actually uses the reference type definition of a 'Z' interface.
The requirement is to retrun a table of locations and then pass this to parameter e_locations.
e_locations = TABLE TYPE OF Zxxxx (and Zxxx = reference type ZIFxxxxx)
My questions is this possible and if so what is the correct syntax.
‎2011 Feb 15 2:49 PM
It sounds like you want to use a table type as an export (import) parameter for a function module? Declare your table type in the DDIC as 'ZTT_XXXXX...'. Your function parameter would just be defined using TYPE 'ZTT_XXXXX' in the interface. In your code, populate an internal table (defined using the table type) with a work area (defined using the line type which also is your Z-table line type). Assign the internal table to the function parameter in the call.
‎2011 Mar 06 9:23 PM
Halo,
Suppose you have an interface ZINTF
Go to Se11 and create a global table type ZTT_INTF where reference line is ZINTF.
Then in your FM the exporting parameter should be type ZTT_INTF.
Regards
Arshad
‎2011 Mar 12 5:50 AM
‎2011 Mar 13 4:21 AM
You can declare your parameter as TYPE STANDARD TABLE it will accept any table types.
Please let me know if this helps.
Thanks
‎2011 Mar 15 2:25 PM
HI, what I had to do was to instantiate the class first and then pass the results to my table referencing the interface.
loop at it_warehouse into s_warehouse.
try.
* Instantiate the warehouse for each record
call method zcl_warehouse=>make_warehouse "static method
exporting
i_warehouse_no = s_warehouse-warehouse_no
receiving
r_warehouse = lco_warehouse.
endtry.
* and then populate the interface with the resulting instances
append lco_warehouse to rit_locations.
endloop.