structures i created are
Zinputs has fields name ,age.
Zexport has filelds name , age , sex.
function moudle with export parameter.
i_export and it is refereing to the structure zexport and it has 3 fields.
in fm i declared in export options it as
i_export like zstruct.
and in souce code i have done like this
IF name_n IS NOT INITIAL.
i_export-NAME = i_table-NAME.
i_export-age = i_table-age.
i_export-sex = 'F'.
ELSE.
i_export-NAME = i_table-NAME.
i_export-age = i_table-age.
i_export-sex = 'M'.
ENDIF.
And in the program i have declared like this.
data : user(30) type c.
user = 'Master'.
data :wa type zexport.
DATA : INPUTs LIKE TABLE OF Zinputs .
data : output like table of zexport.
wa-name = 'KUMAR'.
wa-AGE = '42'.
APPEND wa to INPUT.
wa-name = 'shiva'.
wa-age = '37'.
append wa to input.
CALL FUNCTION 'ZFUNCTION'
EXPORTING
input = user
IMPORTING
i_export = output
tables
input1 = inputs
Dump came while executing the function module and
Error analysis is as below
An exception occurred. This exception will be dealt with in more detail
below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught, which
led to a runtime error. The reason for this exception is:
The call to the function module "ZFUNCTION" is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "I_EXPORT".
Although the currently specified field
"OUTPUT" is the correct type, its length is incorrect.