Hi Experts,
I have a module function with an Implicit type Table in parameter (not type defined): OUTPUT. And in my MF, I built a FieldSymbol Table. I don't know how to CAST my FieldSymbol Table to my OUTPUT table (Implicit type Table Parameter).
Of course, I am trying to find a generic solution to fix my need because I could have any type of table paramter and any FieldSymbol Table type. Please, check the code out below:
FUNCTION zmy_mf.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(NAME_STRUCTURE) TYPE STRING
*" TABLES
*" OUTPUT
*" EXCEPTIONS
*"----------------------------------------------------------------------
*" ... ... ... CODE
output[] = <ft_table>[]
ENDFUNCTION.
To fix my need I think I have 2 solutions:
First,
I move all my table <FT_TABLE> into OUTPUT table with an implicit CAST. (?)
otherwise,
I have the name of the structure in my MF parameter using for casting my OUTPUT : "NAME_STRUCTURE" then: How could I cast my OUTPUT table with the name string structure "NAME_STRUCTURE" (e.g: NAME_STRUCTURE = 'MARA' and it's also the same type of table of my <ft_table> that was at first a TYPE STANDART TABLE and became a Type Table 'MARA' in my example) and only afterwards, I will move easily my table data <ft_table> into my output[] like that :
output[] = <ft_table>[]
To summurize:
1) CAST my OUTPUT table type with the same non explicit table type of <ft_table>
or
2) CAST my OUTPUT table type with the "name_structure" string. Also the same type of my <ft_table>.
Any idea?
Many thx for your help.
Rachid