‎2008 Jun 12 7:14 AM
Hi friends,
I'm having data in one structure inside one function module .
I want to move that data to one internal table so i can retrieve it .
Plz tell me how to do it .??
Thanks in advance.
‎2008 Jun 12 7:16 AM
Hi,
Your question is not very clear.
I the structure of workarea and internal table are same , then you can write
APPEND WA_DATA TO I_DATA.
‎2008 Jun 12 7:26 AM
data: location_data type temp
CALL FUNCTION funcname
EXPORTING
location_data = ls_location_data
I want to move this location_data to one internal table so i can fetch data .
‎2008 Jun 12 7:16 AM
Hi,
You can write as:
append <str data> to <int table>.
Mention this internal table name in Tables tab in function module.
‎2008 Jun 12 7:24 AM
If the resultant structure is not there as an exporting parameter from the function module. You can use field symbols.
first declare your internal table type structure with the same name as your FM structure.
delcare two fields symbols of the structure type.
After calling the FM, assign the FM structure to your field symbol1 <fs1>.you can do this by giving the main program name of FM as reference ie
ASSIGN ((SAP***)structurename) TO <fs1>.
assign local internal table type also in the same way. For this pgm name is not required, as this is in your local program. <fs2>
then swap this field symbol values
<fs2> = <fs1>
This much steps if you do, you can get the values in your local internal table type.
‎2008 Jun 12 7:28 AM
U are using the structure inside the FM..means...u are importing it from some place..suppose ur structutre is s and internal table is itab..then declare a work area wa_itab of type same as itab.
then wa_itab1-field1 = s-field1 .
wa_itab1-field2 = s-field2 .
:
:
then append wa_itab1 to itab.
hope it works...reward if useful...
regards
Rudra
‎2008 Jun 12 7:28 AM
if the structure of the FM is in the tables part of the FM
u can use
read table <table_name> into work_area sy-index = 1.
if sy-subrc eq 0.
append work_area to itab.
endif.