2007 Oct 04 10:19 AM
Hi,
is it possible to give an FM a table with the type ANY? The table type is dynamic.
Regards,
Sinan
2007 Oct 04 10:28 AM
HI,
sorry you cannot define type any
for typeing a table only table types should be used
reward if helpful
vivekanand
2007 Oct 04 10:30 AM
Hi..
Yes we can do this.
In this case the Internal table will become Generic.
reward if Helpful.
2007 Oct 04 10:35 AM
Hi,
how can I do that? Can you give me an Example?
I have something like that:
CALL FUNCTION 'FM'
IMPORTING
ls_table = ls_return
TABLES
lt_table = lt_tableset.
How can I define with SE37 the table parameter:
LT_TABLE TYPE ANY
and the structure parameter:
LS_TABLE LIKE ANY
2007 Oct 04 10:36 AM
Hi ,
It is possible to declare a table with generic type.ie as type any..
This can acccesed using a field symbol.
Regards
Meikandan
2007 Oct 04 10:46 AM
Yes sure...
You can define in the import & export parameter associate type....as any.
Like below:
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(ITAB) TYPE ANY
*" EXPORTING
*" REFERENCE(JTAB) TYPE ANY
*"----
2007 Oct 04 10:54 AM
I get the following Error Message when I try to activate the FM:
For typing of TABLES parameters, only table types should be used. -
How can I make the tables parameter to be a reference?
""Local Interface:
*" IMPORTING
*" REFERENCE(LS_TABLE) TYPE ANY
*" TABLES
*" LT_TABLE TYPE ANY
Release: 4.6 c
2007 Oct 04 11:05 AM
TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as internal standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to such a formal parameter, an empty header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. In the case of formal parameters defined with TABLES, no value transmission is possible.
Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created in the function module for the internal table using the addition LIKE LINE OF itab of the DATA statement in the function module.
So you cant use the Tables type any option.....
Message was edited by:
Muthurajan Ramkumar
2007 Oct 04 11:18 AM
Hi,
now I get the Error Message that the changing Parameter is not a intern table.
*"----
""Lokale Schnittstelle:
*" EXPORTING
*" REFERENCE(LS_TABLE) TYPE ANY
*" CHANGING
*" REFERENCE(LT_TABLE) TYPE ANY
*"----
FIELD-SYMBOLS:
<fs_tab> LIKE LINE OF lt_table.
2007 Oct 04 11:28 AM
May i know , why you want to assing lt_table as a fieldsymbol...
You can directly pass a workarea(structure) to the lt_table and do the operation...
I think, the like line of statement and the field symbol declaration is not needed...
Could you please brief your requirement....?
2007 Oct 04 12:44 PM
The FM get a table with various Fields and give back a structure from that table. How can I define this table and structure in the FM without saving the type in DDIC?
2009 Dec 16 12:38 PM
Hi Sinan Keklik ,
I was just browsing thru your post , I have the similar requirement can you please share how you solved the problem.
Regards,
Rachit
2009 Dec 16 1:27 PM
Hi.
This is pretty simple.
In the changing parameter you can defile one field type standard table . It will take all types of internal table.
Thanks
Subhankar
2009 Dec 17 5:34 AM
Hi Subhankar,
Could you please give me some example.
Basically I don't know the structure of the result table , that's why i am seeing this option.
Regards,
Rachit Khanna