11-10-2008 8:01 AM
hi all,
i need to send the output to application server, if the program executed twice on the same day the output in application server should not overwrite the first executed output.
please help do we have no update option in open dataset.
please help me
my code:
OPEN DATASET f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
thanks in advance.
11-10-2008 8:11 AM
Hello Kiran,
Did you see the help for open dataset statement ?
You can try this :
OPEN ... FOR APPENDING opens the file in append mode.
regards,
Advait
11-10-2008 6:54 PM
Hi kiran,
I use OPEN DATASET multiple times a day to write to a file sequentially. This does not delete the previous record. It only adds to the file.
DATA: dsn(40) VALUE '/usr/filename.txt'.
DATA: wa_itab like line of itab.
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.
Let me know if you have any questions.
SL