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

Function module table output

Former Member
0 Likes
1,976

Hi,

I am having a problem with a function module I created, First I created the program as a stand alone program and it runs fine, fills up the output table and displays data. I then put the code into a function module. When I run the function module I get no results BUT if I put a breakpoint at the last command beffore end function I see all my records in my output table. How do I get the function module to end and show me how many records were inserted into my table? I tried declaring my table in the tables tab but did not have any luck. Any idea's?

Thanks,

5 REPLIES 5
Read only

Former Member
0 Likes
1,090

In the tables tab declare your table output like that:

RETURN LIKE BAPIRETURN.

Inside the program fill the table


move: 'E'  to return-type,
      '002' to return-code,
      text-m17 to return-message.
append return.

And call the function:

DATA: t_return TYPE TABLE OF BAPIRETURN WITH HEADER LINE.

CALL FUNCTION <fm_name>
  TABLES
    return = t_return.

Edited by: Alvaro Giancarlo Achin Aguero on Jun 19, 2008 2:04 AM

Read only

Former Member
0 Likes
1,090

Hi Thanks,

I will try that in a program but my question really is how do I see my table while still in the function module? I.E when the function module ends and says ran xxx microseconds and shows table and results. I am getting zero results even though if I look at the table right before the function ends it is full

Read only

Former Member
0 Likes
1,090

This is what's happening, My internal table is filled then the next command is endfunction as soon as the FM leaves the form for filling my table the contents are cleared. So I need to find a way to not clear the contents

Thanks

Read only

0 Likes
1,090

Hi George Laing,

Declare ur table in TABLES paramenter Tab in the function module as shown

Parameter Name                       Type                           Associated Type
LT_TAB                               TYPE                               MARA

After fetching the data from the data base in to ur Internal table then populate the table LT_TAB by appending or moving the contents directly.

Make use the Table IT_TAB is populated or not.

Best regards,

raam

Read only

Former Member
0 Likes
1,090

Hi, try to see that the structure of output_table into of the program is equal to the estructure of output_table into the function, maybe this will be the error ....