Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to save text file in logical path

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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

LucianoBentiveg
Active Contributor
0 Kudos

Use:

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

logical_filename = logical_filename

IMPORTING

file_name = file.

OPEN DATASET file FOR INPUT IN TEXT MODE .

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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