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

file generation error

Former Member
0 Likes
416

Hi,

want to write 5 tables in 1 file, to write 5 tables into file ,calling program 5 times,passing different itab each time.

But when 1 itab gets write in to the file, when program calls again with 2 itab, it writes overwrites itab 2 . This erase itab 2 data.

Plz tell how to write all itabs.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
392

Use APPENDING TABLE ITAB while selecting the data.

I used SELECT setname setclass descript FROM setheadert APPENDING TABLE i_setheadert

While i_setheadert had already data before selecting from setheadert.

3 REPLIES 3
Read only

Former Member
0 Likes
393

Use APPENDING TABLE ITAB while selecting the data.

I used SELECT setname setclass descript FROM setheadert APPENDING TABLE i_setheadert

While i_setheadert had already data before selecting from setheadert.

Read only

0 Likes
392

can u plz tell me more detail

Thanks for reply.

Read only

0 Likes
392

You can use like this -

OPEN DATASET dsn FOR APPENDING IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.

LOOP AT ITAB INTO wa_itab.

TRANSFER wa_itab TO dsn.

ENDLOOP.

ENDIF.

CLOSE DATASET dsn.

P.S. - You should use search. F1 on statements. Search in Forums.