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

transfer tables between functions ?

Former Member
0 Likes
532

Hello,

i am trying to transfer a table from one function to another and i am getting a run time error saying that:

although the currently specified field 'tempdraw' is the correct type, its length is incorrect.

so what seems to be the problem?

here is a code sample.

i have to transfer table from function1 to function2. here is what i am doing:

function function1

DATA: tempdraw like draw occurs 0.

data: wa like line of tdraw.

loop at tdraw into wa.

append wa to tempdraw.

endloop.

call function function2

exporting tempdraw.

.....

endfunction

function function2

""Local Interface:

*" IMPORTING

*" REFERENCE(TL) LIKE DRAW STRUCTURE DRAW

......

endfunction.

so here i am getting the above stated runtime error.

I even tried to export the table to a memory id in functio1 and then import it in functio2 but this also does not seem to work.

any ideas ?

regards

1 ACCEPTED SOLUTION
Read only

hermanoclaro
Participant
0 Likes
497

Hi,

The tables aren't declared in the function as import to receive a table. You need to declare it in the tables tab.

The error says that you have the same type, but in the import it's an workarea and the table tries to send more than one set of informations at a call.

Award with points the answers that helps you out.

Hello,

i am trying to transfer a table from one function to another and i am getting a run time error saying that:

although the currently specified field 'tempdraw' is the correct type, its length is incorrect.

so what seems to be the problem?

here is a code sample.

i have to transfer table from function1 to function2. here is what i am doing:

function function1

DATA: tempdraw like draw occurs 0.

data: wa like line of tdraw.

loop at tdraw into wa.

append wa to tempdraw.

endloop.

call function function2

exporting tempdraw.

.....

endfunction

function function2

""Local Interface:

*" IMPORTING

*" REFERENCE(TL) LIKE DRAW STRUCTURE DRAW

......

endfunction.

so here i am getting the above stated runtime error.

I even tried to export the table to a memory id in functio1 and then import it in functio2 but this also does not seem to work.

any ideas ?

regards

3 REPLIES 3
Read only

Former Member
0 Likes
497

does TDRAW have the same structure as TEMPDRAW?

Rob

Read only

0 Likes
497

Hi rob

yes, they are of the same type sorry i might have missed the following

code for functio1 starts with

function function1

*"----


""Local Interface:

*" TABLES

*" TDRAW STRUCTURE DRAW OPTIONAL

*"----


.....

......

endfunction

Do you know rob why this is happening ?

Read only

hermanoclaro
Participant
0 Likes
498

Hi,

The tables aren't declared in the function as import to receive a table. You need to declare it in the tables tab.

The error says that you have the same type, but in the import it's an workarea and the table tries to send more than one set of informations at a call.

Award with points the answers that helps you out.