‎2009 Jun 30 9:34 AM
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.
‎2009 Jun 30 9:36 AM
output parameter must be in same type and length with your export parameter in FM.
Edited by: Gungor Ozcelebi on Jun 30, 2009 10:39 AM
‎2009 Jun 30 9:36 AM
output parameter must be in same type and length with your export parameter in FM.
Edited by: Gungor Ozcelebi on Jun 30, 2009 10:39 AM
‎2009 Jun 30 9:38 AM
‎2009 Jun 30 9:39 AM
i am referring the export parameter to a structure as mentioned above , zexport.
in the program also i declared output as same as structure
‎2009 Jun 30 9:42 AM
data : output like table of zexport.
export parameter can't be a table define it like below.
data : output type zexport.
If you want to make it table you must define in Tables section in your fm interface. No problem you can again use it like exporting parameter.
Edited by: Gungor Ozcelebi on Jun 30, 2009 10:43 AM
‎2009 Jun 30 9:45 AM
hi
Change the declaration in program.
(data:output type zexport.)
Thanks
‎2009 Jun 30 9:49 AM
Hi,
In FM also declare i_export like zexport.
Check and revert back.
regards
Karthik D
‎2009 Jun 30 10:02 AM
karthik,
in fm i declared as i_export like zexport only.
Gungor Ozcelebi
so as you said , right now i have 3 fields in the export ie i will get this as output from the internal table type structure zexport.
so do i need to declare it in the tables section than export section? If so already i declared input fileds in the table section type stucture zinputs? how to tell to the sytem(declare in fm) which is input and which is output in tables section.
‎2009 Jun 30 10:06 AM
Hi,
Try declaring the i_export parameter also in the tables section of the FM as you give for inputs but with structure zexport.
Also change the call function by moving i_export under tables.
Check and revert back.
Regards
Karthik D
‎2009 Jun 30 10:07 AM
It's up to your coding. You can use table statement both as importing or exporting parameter and you don't need to define anything special in your FM. Just fill it before calling FM to use it as a importing parameter or fill it in your fm to use it as an exporting parameter.
You can also fill it before you call your fm and modify in your fm like a changing parameter.
Edited by: Gungor Ozcelebi on Jun 30, 2009 11:08 AM