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: 

itab to extract

Former Member
0 Kudos

If we have "2" internal tables , with the fields of the "2" internal tables --which have equal structure --is it possible to form an extract?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

In case if u want to combine both the internal tables , itab1 & itab2, you can append itab2 to itab1 or the vice versa.

If you want to combine both the tables into a new table ,

itab3[] = itab1[].

APPEND LINES OF i_tab2 TO i_itab3.

Reward if Useful.

Regards,

Chitra

2 REPLIES 2

Former Member
0 Kudos

Hi

You are wrong.

EXTRACT is the key word like SELECT or GET to fetch the data with respect to Field groups

it is not used to combine the 2 internal tables

Field groups are used when the data is too high, in which case Internal tables are not used due to memory problems

see this links and example

fieldgroups

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_gr.htm

http://www.geocities.com/SiliconValley/Grid/4858/sap/ABAPCode/Fieldgroups.htm

Sample Report Code

REPORT demo_extract.

NODES: spfli, sflight.

FIELD-GROUPS: header, flight_info, flight_date.

START-OF-SELECTION.

INSERT: spfli-carrid spfli-connid sflight-fldate

INTO header,

spfli-cityfrom spfli-cityto

INTO flight_info.

GET spfli.

EXTRACT flight_info.

GET sflight.

EXTRACT flight_date.

END-OF-SELECTION.

SORT STABLE.

LOOP.

AT FIRST.

WRITE / 'Flight list'.

ULINE.

ENDAT.

AT flight_info WITH flight_date.

WRITE: / spfli-carrid , spfli-connid, sflight-fldate,

spfli-cityfrom, spfli-cityto.

ENDAT.

AT flight_date.

WRITE: / spfli-carrid , spfli-connid, sflight-fldate.

ENDAT.

AT LAST.

ULINE.

WRITE: cnt(spfli-carrid), 'Airlines'.

ULINE.

ENDAT.

ENDLOOP.

Regards

Anji

Former Member
0 Kudos

Hi ,

In case if u want to combine both the internal tables , itab1 & itab2, you can append itab2 to itab1 or the vice versa.

If you want to combine both the tables into a new table ,

itab3[] = itab1[].

APPEND LINES OF i_tab2 TO i_itab3.

Reward if Useful.

Regards,

Chitra