‎2008 Jun 19 12:32 AM
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,
‎2008 Jun 19 1:04 AM
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
‎2008 Jun 19 1:24 AM
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
‎2008 Jun 19 1:46 AM
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
‎2008 Jun 19 3:27 AM
Hi George Laing,
Declare ur table in TABLES paramenter Tab in the function module as shown
Parameter Name Type Associated Type
LT_TAB TYPE MARAAfter 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
‎2008 Sep 01 8:46 AM
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 ....