Skip to Content
avatar image
Former Member

upload file into application server

Hi ,

I created path in application server to upload data.

but path is not creating.

parameters: filename(128) default '/usr/tmp/testfile.dat'

lower case.

open dataset filename for output in text mode encoding default.

if sy-subrc ne 0.

write: 'File cannot be opened. '.

exit.

endif.

loop at gstring into wastr.

transfer wastr-fstring to filename.

endloop.

close dataset filename. " Closing the file

Thanks,

Asha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 10, 2008 at 02:09 PM

    What i understood from your question is...your open dataset returns sy-subrc as 4. If yes, declare parameters as below and try:

    PARAMETERS: FILENAME TYPE PATHEXTERN

    default '/usr/tmp/testfile.dat'

    Thanks,

    SKJ

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 01:08 PM

    Dear Asha,

    To upload data/ down load data application server use below transactions.

    CG3Y

    CG3Z

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 01:09 PM

    Asha

    Try to upload a file using Transaction CG3Z with the same file path on Application Server... By doing so you may find the cause...

    Thanks

    Amol Lohade

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2008 at 01:10 PM

    Try this code

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETERS : p_asfile TYPE rlgrap-filename DEFAULT '/usr/tmp/testfile.dat'.

    .

    SELECTION-SCREEN END OF BLOCK b1.

    OPEN DATASET p_asfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    IF sy-subrc <> 0.

    EXIT.

    ENDIF.

    LOOP AT it_emp INTO wa_emp.

    TRANSFER wa_emp TO p_asfile.

    ENDLOOP.

    CLOSE DATASET p_asfile.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 01:14 PM

    To set up the path permanently ..basis help is needed..

    Also check if there are proper authorization to save the file in application server and to open the dataset

    Add comment
    10|10000 characters needed characters exceeded