Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Short Dump while passing internal table to Function Module

Former Member
0 Likes
883

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.

.

5 REPLIES 5
Read only

Former Member
0 Likes
664

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

Read only

0 Likes
664

I tried that but it is saying Tables parameters are obsolete.

please help me.

Read only

0 Likes
664

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

Read only

Former Member
0 Likes
664

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.

Read only

0 Likes
664

Excellent! Thanks Manish.

It is working now.

Thanks,

Suresh.