Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Writing in a in file and going to a new line.

Hello.

There's something in a program i am currently writing.

I'm trying to write in 2 files with a format like this :

line1.....
line2.....

In the first file, everything is ok but in the second file, with exactly the same instructions, instead og getting my file like i need it, i've something like that :

line1......               line2....

Here is the code i'm using to write in the file :

  DATA : t_ent_estim like STANDARD TABLE OF ZVOIENT WITH HEADER LINE.

  LOOP AT t_ent_estim.
    TRANSFER t_ent_estim TO p_fici.
  ENDLOOP.

  PERFORM close_file(zvoiform) USING p_fici w_result.

The only difference is that in one case i use an internal table and in the other i use a structure i created myself :

DATA : BEGIN OF tbl_csv_trans OCCURS 0,
        s_csvdata(400),
       END OF tbl_csv_trans.

Anybody can explain to me why with the internal table, the instruction transfer does not write in a new line each occurence of my table ?

Thanks for the help.

Tags:
replied

Hi,

are you using the Open data set in text mode both the places.

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

if not change it and see..

where is your open dataset in your coding.

Regards

vijay

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question