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: 

append 3 workarea into internal table

Former Member
0 Kudos
2,119

Hi,

I have 3 workarea and i want to append into one internal table.so how to append.

Thanks,

Deesanth

12 REPLIES 12

Former Member
0 Kudos
356

Hi,

If those three work areas are different ones then u candirectly write the append statements.

like this


append wa1 to itab.
append wa2 to itab.
append wa3 to itab.

if u r requirement is different please let me know it clearly..

regards

Sunil Kumar Mutyala

0 Kudos
356

Hi,

But all the values in the 3 workarea will append to one internal table in a single line(one record)not in 3 lines.

Thanks,

Deesanth

0 Kudos
356

Hi,

Each time we use append statement one new line will get inserted in the internal table. ( 3 append statements means 3 lines)

DO you want to insert new lines or do you want to midify existing values of teh internal table?

Regards,

Swarna Munukoti.

0 Kudos
356

No man ... 3 appends --> 3 lines in internal table.

Regards,

Suhas

Former Member
0 Kudos
356

Hi,

If those three work areas are having the same fields and order as internal table field order then you can append them directly to the internal table using APPEND statement.

Append S_WA1 to T_ITAB.

If it is having the different field order then move to the fields separately to internal table header and use APPEND.

Former Member
0 Kudos
356

Hi do as bdlow

append wa_data1 to itab.

append wa_data2 to itab.

append wa_data3 to itab.

rgds

rajesh

Former Member
0 Kudos
356

Hi,

I hope the following link will help you,

https://forums.sdn.sap.com/click.jspa?searchID=14807562&messageID=4249748

append wa1 to itab.

append wa2 to itab.

append wa3 to itab.

Regards,

Harish

narin_nandivada3
Active Contributor
0 Kudos
356

Hi Deesanth,

Use 3 Append statements independently one for each workarea.

And for additional information on APPEND statement please check this link...

[Append|http://www.sapnet.ru/abap_docu/ABAPAPPEND.htm]

Hope this would help you

Good luck

Narin

Former Member
0 Kudos
356

HIII

then you need to use MODIFY statement like below code..

IF sy-subrc EQ 0.
    LOOP AT i_output INTO wa_output.
      READ TABLE i_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
      wa_output-lgort = wa_mard-lgort.
      MODIFY i_output FROM wa_output.
      CLEAR wa_output.
    ENDLOOP.                           " LOOP AT i_output
  ENDIF.                               " IF sy-subrc EQ 0

here you need to use READ statement to get workarea data from different tables and use MODIFY statement to append that data in the same row.

reagrds

twinkal

Former Member
0 Kudos
356

Hi,

Append like this

append wa1 to itab.

append wa2 to itab.

append wa3 to itab.

karol_seman
Active Participant
0 Kudos
356

Hi,

what exactly do you want to do?

If you want to have three lines use append.

If you have two same lines in two different workareas?

if you want to have doubled values you have to use command COLLECT

COLLECT wa into itab.

If you want to have it just once use modify.

One of this three commands must be useful for you!

Regards,

Karol

Former Member
0 Kudos
356

own