Application Development and Automation 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: 
Read only

File length

Former Member
0 Likes
2,058

Hi,

We are facing some file length problem.

When we are trying to upload the files to application sever using open dataset it is storing upto 256 characters in a line. How can we extend this?

Please help me.

7 REPLIES 7
Read only

Former Member
0 Likes
1,418

Actually its storing more than 256 characters, you can check by downloading it via tcode cg3y . No special care required.

When using cg3y you have to use BIN mode for transfer

Read only

Former Member
0 Likes
1,418

Hi

There's no limit for the size of the record of a file, the problem is if you want to print the record to video or you want to save the data in a Z-TABLE.

If you want to display the file in the video:

DATA: W_RECORD TYPE STRING.

NEW-PAGE LINE-SIZE 1032.

OPEN DATASET <FILE> IN TEXT MODE.
IF SY-SUBRC = 0.
  DO.
    READ DATASET <FILE> TO W_RECORD.
    IF SY-SUBRC <> 0. EXIT. ENDIF.
    WRITE / W_RECORD.
  ENDDO.
  CLOSE DATASET <FILE>.
ENDIF.

If you need to store the record into a table, u can create a table with field having LRAW as type, in this case you need to insert another field (type INT4) where the length is indicated, so this table should have the field:

MANDT TYPE MANDT

<KEY> ???????????? (it should be a counter)

LRAW_LEN TYPE LAW_LINE

LRAW1000 TYPE LRAW1000

OPEN DATASET <FILE> IN TEXT MODE.
IF SY-SUBRC = 0.
  DO.
    READ DATASET <FILE> TO W_RECORD.
    IF SY-SUBRC <> 0. EXIT. ENDIF.
    MOVE SY-INDEX TO ZTABLE-COUNTER.
   LEN = STRLEN( W_RECORD ).
    MOVE: LEN TO ZTABLE-LRAW_LEN.
                W_RECORD TO ZTABLE-LRAW1000.
    INSERT ZTABLE.
  ENDDO.
  CLOSE DATASET <FILE>.
ENDIF.

In this way it can store a record having max 1000 chararacters

Max

Edited by: max bianchi on Oct 23, 2008 3:09 PM

Read only

BH2408
Active Contributor
0 Likes
1,418

Hi ,

the above will work ...

Read only

Former Member
0 Likes
1,418

Hi,

I want to save the data into application sever. Then I will download that data into CSV format. But the moment I wrote it to the application sever, i could not see whole data except 250 characters. i.e I could not write the file more than 250 characters into application server file. How can we extend this length.

Read only

Former Member
0 Likes
1,418

You are not getting the point , You can only see 250 chara by viewing but the program is actually writing more as a proof you can download and see . For download of that i justed cg3y tcode . Hope your got the point .

Read only

Former Member
0 Likes
1,418

Hi

Just as I said, the problem is not the file, but the writing.

It's possible to write string of 255 char by default: so if you try to see your file file by trx AL11, the file will be truncated after 255 char.

If you want to see the whole file you need to create a report like this:

DATA: W_RECORD TYPE STRING.
 
NEW-PAGE LINE-SIZE 1032.
 
OPEN DATASET <FILE> IN TEXT MODE.
IF SY-SUBRC = 0.
  DO.
    READ DATASET <FILE> TO W_RECORD.
    IF SY-SUBRC  0. EXIT. ENDIF.
    WRITE / W_RECORD.
  ENDDO.
  CLOSE DATASET <FILE>.
ENDIF.

But remember it can't write line longer than 1032 char

Max

Read only

Former Member
0 Likes
1,418

You can see only 250 characters in Application server.You download the content from application server to presentation server and see the output.

Use this program ZUX2PC1A for downloading data from application server to presentation server