10-06-2008 3:16 PM
Hi all. I have this problem. I'm calling my FM, which returns some table with datas. But this table is dynamically created in my FM. That means, i don't know a structure of this table before i call this FM. Is there some way, how to return this data to a program? If not, is it possible to do this with methods?
Hope, you understand, what i want
Thanx for ideas
Philipp
10-06-2008 3:22 PM
10-06-2008 3:26 PM
No, that's not it, because the type of table is not known before i call this FM. The table is dynamicaly created in it. So i need to return something like pointer on this table. I think, this is not possible in FM, but in classes/methods maybe yes.
Philipp
10-06-2008 3:29 PM
Did you understand what Rich suggested..? you can define a table parameter with out referring to any type(unknown type). so that it can hold any thing in the runtime. the best examples are GUI_UPLOAD and GUI_DOWNLOAD functions.
10-06-2008 3:47 PM
Yes, i understood very well, but it doesn't solve my problem... maybe it's because of my english...
ok, i try once more.
I wrote FM with importing parameters YT_TAB1, YT_TAB2, YT_TAB3, YT_TAB4. These tables are containing some datas to process. All these tables having same structure. Than i have table YT_GROUP_BY, this table is also importing and contains atributes on which I will collect all records in YT_TAB1 ... 4. On table YT_GROUP_BY depands, which type of structure will be my output table. And this dynamically created table i know only AFTER executing of this FM.
here is interface of my FM
FUNCTION y0bi_cm_overview_dynamic.
*"----------------------------------------------------------------------
*"*"Lokální rozhraní:
*" IMPORTING
*" REFERENCE(XT_S600) TYPE Y0BI_S600_TAB OPTIONAL
*" REFERENCE(XT_S601) TYPE Y0BI_S601_TAB OPTIONAL
*" REFERENCE(XT_S610) TYPE Y0BI_S610_TAB OPTIONAL
*" REFERENCE(XT_S611) TYPE Y0BI_S611_TAB OPTIONAL
*" REFERENCE(XT_GROUP_BY_TABLE) TYPE Y0BI_GROUP_BY_TAB
*" EXPORTING
*" REFERENCE(YT_TABLE) TYPE TABLE
*" TABLES
*" T_OUTPUT_TABLE
*" EXCEPTIONS
*" NO_INPUT_DATA
I know, i can make table parameter without data type, but still, when i call this FM, i have to know type of this T_OUTPUT. Thats the reason, why i can't do this.
10-06-2008 3:47 PM
Hello Philip
For local function modules (i.e. not RFC-enabled) the approach suggested by Rich will work.
The interface of your function module can have an untyped TABLES parameter yet its structure is determined when you do the function call.
Alternatively, if you need a fully dynamic approach which should work for RFC-enabled fm's as well you may have a look at thread
Regards
Uwe