Skip to Content
0
Former Member
Jul 16, 2006 at 11:05 AM

Multiple file creation

18 Views

Hi.

I have to create multiple files for mulitiple plants entered through select-options.

I have done this for single file but not getting the idea how to do it for multiple files.

<u><b><b>My work:</b></b></u>

*File creation

CONCATENATE

c_path "file path

c_qm " 'QM'

c_underscore "underscore

c_results " 'RESULTS'

c_underscore

s_werks "plant

c_underscore

sy-datum+4(2) "system date

sy-datum+6(2)

sy-datum+0(4)

c_underscore

sy-uzeit+0(2) "system time

sy-uzeit+2(2)

c_ext "file extension

INTO g_file_name.

ENDLOOP.

  • Open File on the application server for processing

OPEN DATASET g_file_name FOR OUTPUT IN TEXT MODE

ENCODING DEFAULT.

IF sy-subrc NE 0.

*Display error message

MESSAGE i055. " Error in opening file

LEAVE LIST-PROCESSING.

ELSE.

LOOP AT i_final INTO wa_final.

TRANSFER wa_final TO g_file_name.

ENDLOOP.

ENDIF.

CLOSE DATASET g_file_name.

  • Then i am updating the database table using i_update

  • Work Area for Z_DATADOWNLOAD table

DATA: l_wa_update TYPE ztable

l_wa_update-prog_name = g_repid.

l_wa_update-plant = s_werks.

l_wa_update-last_run_dt = g_sysdate.

l_wa_update-last_run_tm = g_systime.

MODIFY ztable FROM l_wa_update.

Pls let me know how to manage this for multiple files.