08-02-2006 1:43 PM
Hi everybody,
i created one text file that contains two kinds of records.
my selection screen contains two fields
first one is logical path and second one is printer name
when i am giving values to this fields and execute, the file should save on logical path and directly print on printer.
plz guide how to proceed for achieving this.
Regards,
siri.
08-02-2006 1:48 PM
one hint for you :
to transfer files from presentation server to applicaiton server use the transaction : CG3Z
AND from Application server to presentation server use CG3Y.
If you want to do this in program ;
use GUI_UPLOAD function module to read the contents from the file to the internal table.
then use the below code.
OPEN DATASET <FILENAME> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
loop at itab.
transfer itab to <FILENAME>
endloop.
close dataset <FILENAME>
regards
srikanth
Message was edited by: Srikanth Kidambi
08-02-2006 1:49 PM
Use:
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
logical_filename = logical_filename
IMPORTING
file_name = file.
OPEN DATASET file FOR INPUT IN TEXT MODE .
08-02-2006 1:57 PM
hi,
i am not going to down load or upload the file from presentation/app server just i want to save the text file wht i created in specified logical path
regards,
siri
08-02-2006 2:00 PM
the below code is to SEND the text directly to the printer
call function 'GET_PRINT_PARAMETERS'
exporting
immediately = 'X'
no_dialog = 'X'
importing
out_parameters = x_params
valid = v_valid.
if v_valid <> space.
new-page print on parameters x_params no dialog.
perform display_report.
new-page print off.
endif.
form display_report.
*write the total text which you want to print in this *FORM
endform.
regards
srikanth
08-02-2006 2:02 PM
hi
good
go through these links, i hope these will help you to solve your problem.
http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/88393de3bb752de10000000a114084/content.htm
http://www.sappoint.com/abap/files.pdf
thanks
mrutyun