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

Upload CSV file from PC to Application server

Hi,

I'm not a abaper so need help from ABAP gurus.

We have a simple requirement, and need two abap programs for these requirements:

1. First program should upload a .CSV file from PC to Application server. No data transformation/modification is required. The .CSV file should be uploaded as it is. Also Users should be able to provide PC and Application server path at run time.

2. Once file has been uploaded, we want it to be renamed by appending current date.

Any idea, how can I achieve it. I know there exist GUI_UPLOAD function module but not sure how to use it.

Regards,

Vikrant.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2006 at 06:42 AM

    Vikrant,

    If its a one time activity you can use the transactions CG3Y and CG3Z transactions.

    If NOT, then you will have to do this.

    1. Call the method GUI_UPLOAD METHOD of the class, CL_GUI_FRONTEND_SERVICES. This will prompt the user to enter the file path and name.

    2. Once the data is uploaded to a internal table, use the OPEN DATASET, TRANSFER, CLOSE DATASET commands to save the data to a file on the app server.

    Regards,

    Ravi

    Note :Please mark the helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2006 at 06:42 AM

    You can try the tcode CG3Z to upload your file into application server from your PC

    Regards,

    Manohar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 03, 2006 at 06:53 AM

    Hi USE FM GUI_DOWNLOAD to transfer your .CSV file to an internal table itab.

    after that use the code to create a file on the application server and transfer the internal table data to the application server file.

    OPEN DATASET p_ofile_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    OPEN DATASET p_ofile_file1 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    IF sy-subrc = 0.

    CLEAR: wa_local.

    LOOP AT p_local_table INTO wa_local.

    TRANSFER wa_local TO p_ofile_file.

    CLEAR: wa_local.

    ENDLOOP.

    append p_ofile_file sy-datum to p_ofile_file1

    CLOSE DATASET p_ofile_file.

    CLOSE DATASET p_ofile_file1..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 03, 2006 at 07:03 AM

    Hi Vikrant,

    have a look here:

    fm-to-rename-files-in-abap

    Andreas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.