2013 Dec 02 6:46 PM
Hi Experts,
I am passing internal table to FM and getting output as internal table.
FM:
Import- I_TAB_INPUT TYPE ZBW_TT_DOC_TYPE(created table type based on structure ZBW_ST_DOC_TYPE)
Export-E_TAB_OUTPUT TYPE ZBW_TT_DATASOURCE_MODE(created table type based on structure ZBW_ST_DATASOURCE_MODE)
in Routine:
DATA: ITAB_SOURCE TYPE TABLE OF ZBW_ST_DOC_TYPE WITH HEADER LINE,
WA_SOURCE TYPE ZBW_ST_DOC_TYPE,
ITAB_DATASOURCE_MODE TYPE TABLE OF ZBW_ST_DATASOURCE_MODE WITH
HEADER LINE,
WA_DATASOURCE_MODE TYPE ZBW_ST_DATASOURCE_MODE.
CALL FUNCTION 'Z_BW_GET_DATASOURCE_MODE_2'
EXPORTING
I_TAB_INPUT = ITAB_SOURCE
IMPORTING
E_TAB_OUTPUT = ITAB_DATASOURCE_MODE.
ENDLOOP.
I am getting short dump like below.
The call to the function module "Z_BW_GET_DATASOURCE_MODE_2" is incorrect:
The function module interface allows you to specify only
fields of a particular type under "I_TAB_INPUT".
The field "ITAB_SOURCE" specified here is a different
field type
Where I am going wrong, please guide me.
Thanks,
Suresh.
.
2013 Dec 02 7:18 PM
You need to move your parameters to tables instead of import and export. In import and export you can only pass structures not tables.
Neal
2013 Dec 02 7:27 PM
I tried that but it is saying Tables parameters are obsolete.
please help me.
2013 Dec 02 7:50 PM
That would be why sap is still using them in much of their new code. The term obsolete is relatively meaningless in most cases.
Neal
2013 Dec 02 7:33 PM
Your internal table has header line.
In FM call, try passing ITAB_SOURCE[] instead of ITAB_SOURCE.
And ITAB_DATASOURCE_MODE[] instead of ITAB_DATASOURCE_MODE.
2013 Dec 02 7:38 PM