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

dump when calling the function module , length not same error

Former Member
0 Likes
2,438

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.

1 ACCEPTED SOLUTION
Read only

former_member194416
Contributor
0 Likes
1,466

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

9 REPLIES 9
Read only

former_member194416
Contributor
0 Likes
1,467

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

Read only

Former Member
0 Likes
1,466

just check the lenght of the export paramter

m.a

Read only

0 Likes
1,466

i am referring the export parameter to a structure as mentioned above , zexport.

in the program also i declared output as same as structure

Read only

0 Likes
1,466

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

Read only

Former Member
0 Likes
1,466

hi

Change the declaration in program.

(data:output type zexport.)

Thanks

Read only

Former Member
0 Likes
1,466

Hi,

In FM also declare i_export like zexport.

Check and revert back.

regards

Karthik D

Read only

0 Likes
1,466

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.

Read only

0 Likes
1,466

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

Read only

0 Likes
1,466

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