Skip to Content

All characters are not writing into Application server using OPEN DATASET

Dear all,

I'm trying to write around 1400 characters into CSV file using OPEN DATASET. But only around 1023 characters are writing into CSV file using OPEN DATASET. Please find below ABAP code I'm using

Data: lv_line(3000) type c.

OPEN DATASET lv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

CONCATENATE lv_customer_line+0(550)

lv_address_line+0(l450)

lv_register_line+0(400)

INTO lv_line.

TRANSFER lv_line TO lv_file.

In the above code, each variable contains record. Also, my requirement is that contents of CSV file should not be separated by any tab deliminator or ';' etc.. Due to this reason, I didn't use SEPARATED BY in above code.

After writing into Application server, only 1023 characters are coming after downloading into CSV file. I've used CG3Y tcode to download CSV file from application server.

Could you please let me know how can I write whole character'1300' into CSV file ?

Thanks in advance,

Dipesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Feb 03, 2016 at 03:21 PM

    Hi Dipesh,

    Change the transfer line like following:

    TRANSFER lv_line TO lv_file LENGTH 1400.

    Regards,

    Ryan Crosby

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 03, 2016 at 04:43 PM

    Try to use BIN format in CG3Y.

    Thanks,

    Juwin

    Add a comment
    10|10000 characters needed characters exceeded

    • I found out that TC CG3Y uses two function modules:

      for ASCII: C13Z_FILE_DOWNLOAD_ASCII

      All other types: C13Z_FILE_DOWNLOAD_BINARY

      In the ASCII FM the data_tab is defined with length 256, therefore 256 is indeed the maximum. However in the C13Z_FILE_DOWNLOAD_BINARY the data_tab is defined with LRAW which is 2550 so it should be able to hold all your data.

      Maybe you can place a breakpoint at the start of FM C13Z_FILE_DOWNLOAD_BINARY to see what is happening in there.

  • author's profile photo Former Member
    Former Member
    Posted on Feb 04, 2016 at 04:31 PM

    Am able to see all the 3000 characters in the csv file.

    DATA: lv_line(3000) TYPE c.

    lv_line+0(1) = 1.

    lv_line+1020(4) = 1024.

    lv_line+1996(4) = 2000.

    lv_line+2996(4) = 3000.

    l_fname = l_path.

    OPEN DATASET l_fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    TRANSFER lv_line TO l_fname.

    CLOSE DATASET l_fname.


    In CG3Y, used BIN format to download.


    Is it different from your issue.


    May be the issue due to content of variables used to populate lv_line in your code. ?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 04, 2016 at 11:38 PM

    CG3Y truncates the data, it's been mentioned on SCN before. Google -> 'open dataset line length site:sap.com'. Get a better tool to download the file, like FTP, then check again.

    Some side comments:

    - CSV is a comma-separated file, if the file is not "separated by anything" then it's not a CSV file;

    - what's the meaning of +0 ? You only need to specify offset when there is one. It seems awfully redundant with 0. And can't you just define variables with proper length instead of using these limits?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Jelena Perfiljeva wrote:

      - what's the meaning of +0 ? You only need to specify offset when there is one. It seems awfully redundant with 0.

      True - but if I remember my original training, that's the way we were taught.

      Rob

  • Posted on Feb 16, 2016 at 09:48 AM

    Hi All,

    Its my mistake. All the characters had displayed in a single column i.e. first column of excel sheet. If we will change the format in excel, we will see that every characters will be present there.

    Thanks all for your support.

    This post shall be closed now.

    Thanks,

    Dipesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 16, 2016 at 11:10 AM

    Hi

    Here a couple of ways to download a file form SAP Server.

    Try the ABAP Report CACS_FILE_COPY

    Sab

    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.