Skip to Content
0
Sep 29, 2012 at 12:53 PM

File not getting written to app server when prog is run in background

490 Views

Folks,

I have a program which has an option to display the data in an ALV report when run in foreground or tranfers the data to a text file to the application server when run in background.When running the report in the background mode (without debugger on) it is not tranferring the whole data but when the same report is executed in debugging in the background mode (with debugger on) it is perfectly fine.

It seems the link to appliction server is getting lost when the program is executed in the background mode (with out debugger on).

I didn't get why the same is not happnening when the same report is executed in the background mode with debugger on.

Below is the logic in use.


{code}

OPEN DATASET l_v_file IN TEXT MODE FOR OUTPUT ENCODING DEFAULT.
* Transfer the data record line by line.

IF sy-subrc IS NOT INITIAL.

MESSAGE e009.
* Unable to open file from Application server

ENDIF.

* transfer the header text to file

TRANSFER l_v_header TO l_v_file.

* transfer the data to file

LOOP AT l_i_csv_final INTO l_rec_csv_final.

TRANSFER l_rec_csv_final TO l_v_file.

CLEAR l_rec_csv_final.

ENDLOOP.

* CLOSE Dataset

CLOSE DATASET l_v_file.

{code}

Can anybody throw some light on what could be the possible issue.

Thanks,
K.Kiran.