Skip to Content
0
Former Member
Apr 03, 2008 at 10:54 AM

Open Dataset Writing only 1 row to applications erver

10 Views

Hi All,

i am trying to write a CSV file to application server. but only 1 record is being written to the Server, the existing record is getting replaced by another record. So finally i am gettingonly the last record from the internal table in the application server file. below is the code used for it. the contents to be written are in itnernal table it_csv.

lv_client = sy-mandt.

IF lv_client = 043.

path1 = 'D:\usr\sap\SED\SEDUpload\'. ""Development server path

CONCATENATE path1 temp lv_date '.csv' INTO file_name.

ELSEif lv_client = 142.

path1 = 'D:\usr\sap\SEQ\SEQUpload\'. "Quality Server Path

CONCATENATE path1 temp lv_date '.csv' INTO file_name.

else.

path1 = 'G:\usr\sap\SEP\download\' . "Production Server Path.

CONCATENATE path1 temp lv_date '.csv' INTO file_name.

ENDIF.

LOOP AT it_csv INTO wa_csv.

OPEN DATASET file_name FOR output IN TEXT MODE ENCODING DEFAULT.

TRANSFER wa_csv TO file_name.

CLOSE DATASET file_name.

ENDLOOP.

Regards

Sabah.....