Application Development 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: 

Passing table back to FM

Former Member
0 Kudos

Hi

I am writing a RFC FM.

I am passing order no to the subroutine and I need to get back all the components for that Production order from RESB table.

Perform get_next_component_list using l_aufnr

based on the AUFNR passed to subroutine I have to get all the details of the components in to the FM.

Please let me know the syntax of how to fetch the data back in Intrenal table.

Thanks in advance

2 REPLIES 2

Former Member
0 Kudos

PARAMETERS: p_carr TYPE sflight-carrid,

p_conn TYPE sflight-connid.

DATA sflight_tab TYPE STANDARD TABLE OF sflight.

...

PERFORM select_sflight TABLES sflight_tab

USING p_carr p_conn.

...

FORM select_sflight TABLES flight_tab LIKE sflight_tab

USING f_carr TYPE sflight-carrid

f_conn TYPE sflight-connid.

SELECT *

FROM sflight

INTO TABLE flight_tab

WHERE carrid = f_carr AND

connid = f_conn.

ENDFORM.

Former Member
0 Kudos

Hi,

do as below

create a structure with the fields what ever you require from RESB table.

In the Function module

Import Parameter: I_AUFNR.

Table Parameter: T_DATA like zstructure.

In the source code do like below

select <fields> from RESB into table t_data.

write the below code in your subroutine get_next_component_list

 Call Z_Function_module
   exporting 
     i_aufnr = i_aufnr
   tables
     t_data = itab.

<b> Reward points for helpful answers</b>

Satish