‎2008 Dec 12 4:55 PM
HI Experts,
I have a program which creates a text file. This program is attached to an output type.
When i run a transaction VT70 in background, i dont see any error but the files are not created either.
But if i run it in foreground and in debugging i change sy-batch and force it to run it in background the files are created.
Code im using:
DATA: l_file TYPE rlgrap-filename.
l_file = l_manifest.
OPEN DATASET l_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE l_message.
IF sy-subrc = 0.
LOOP AT gt_manifest INTO gs_manifest.
TRANSFER gs_manifest TO l_file.
ENDLOOP.
CLOSE DATASET l_file.
Endif.
‎2008 Dec 12 5:05 PM
OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
WITH SMART LINEFEED.
‎2008 Dec 12 5:35 PM
No this is not working.
After executing in background from VT70 when in go and check in shipment (VT02N) ,
it says directory does not exists.
‎2008 Dec 12 5:45 PM
‎2008 Dec 12 6:50 PM
Is ur system UNICODE? Is this is the issue?
i guess, u can debug a back ground job, some thing like SMQ1, i forgot the tx code!!
thanq
‎2008 Dec 12 7:50 PM
In Sm50 you can debug your background running job...
did you maintain exceptions or use try this way:
OPEN DATASET filename FOR INPUT IN --BINARY-- MODE.
IF sy-subrc NE 0.
WRITE / 'File open failure'.
RETURN.
ENDIF.
READ DATASET filename INTO str_utf16.
CLOSE DATASET filename.
CATCH cx_root INTO lr_ex.
message = lr_ex->if_message~get_longtext( ).
WRITE:/ message.
CLOSE DATASET filename.