Application Development and Automation 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: 
Read only

append 3 workarea into internal table

Former Member
0 Likes
4,046

Hi,

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

Thanks,

Deesanth

12 REPLIES 12
Read only

Former Member
0 Likes
2,283

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

Read only

0 Likes
2,283

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

Read only

0 Likes
2,283

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.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,283

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

Regards,

Suhas

Read only

Former Member
0 Likes
2,283

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.

Read only

Former Member
0 Likes
2,283

Hi do as bdlow

append wa_data1 to itab.

append wa_data2 to itab.

append wa_data3 to itab.

rgds

rajesh

Read only

Former Member
0 Likes
2,283

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

Read only

narin_nandivada3
Active Contributor
0 Likes
2,283

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

Read only

Former Member
0 Likes
2,283

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

Read only

Former Member
0 Likes
2,283

Hi,

Append like this

append wa1 to itab.

append wa2 to itab.

append wa3 to itab.

Read only

karol_seman
Active Participant
0 Likes
2,283

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

Read only

Former Member
0 Likes
2,283

own