Skip to Content
author's profile photo Former Member
Former Member

how to save text file in logical path

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.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 12: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

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 02, 2006 at 12: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 .

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 01: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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 01: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

    Add comment
    10|10000 characters needed characters exceeded