Application Development 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: 

Urgent.... Help Needed for Storing file in Application Server

Former Member
0 Kudos
123

Hi All,

I have a requirement where in I have to save a file in Application Server.

File is of 141 Character Length, so there can be spaces left at the end.

When I am downloading the file into Application Sever and then downloading the same file from Application Server to Presentation into a notepad then the spaces at the end are truncating.

I want that the file that is generated should be of 141 character though if there may be spaces at the end.

It will be great if you can help me out in this.

Thanks in Advance.

Jayant Sahu.

7 REPLIES 7

varma_narayana
Active Contributor
0 Kudos
94

Hi Jayant..

This may help u...

Use the TCode CG3Y to Transfer App server files to Presentation server.

Use the TCode CG3Z to TransferPresentation server to App server files.

<b>Reward if Helpful</b>

Former Member
0 Kudos
94

Hi,

There will be some small difference if you download the same file in application and presentation server.

You can try to have same internal table for both the downloads.

In such case also there will be slight difference. This can't be avoided.

<b>Reward if helpful.</b>

Former Member
0 Kudos
94

Hi Narayana,

Thanks for your reply, but my requirement is not that, I am downloading the internal table that is generated in my program and the length of the internal table is getting trucncated when I download to Application Server, while it is fine when I download the same Internal table to Presentation Server,

I have to download the file thru my program

Thanks,

Jayant Sahu

Former Member
0 Kudos
94

Hi Uma,

Thanks for the reply. But I have a requirement where in file needs to be exactly the same.

Thanks,

Jayant

Former Member
0 Kudos
94

Hi,

You can create a Internal table of 141 Characters length ...

Data : begin of itab occurs 0,

text(141),

End of itab.

If you use the same to download from the application server there wont be a problem.

Thanks

Yogesh

Former Member
0 Kudos
94

when downloading to App server, you need to specify the LENGTH option on your TRANSFER ststement to keep fixed length. You must also use a STRING type variable in your transfer.

From Documentation on Transfer command:

<b>If the file was opened as a text file or a legacy text file, the trailing blank characters are deleted for all data objects, except for those of data type string. The line end marker defined when the file was opened is then added to the remaining content of the data object or to the result of the conversion, and the final result is written byte-by-byte to the file.</b>

There also used to be a problem with WS_DOWNLOAD - you had to do the following:

Maintaining Trailing spaces when downloading to PC

Before calling DOWNLOAD or WS_DOWNLOAD, do a perform SET_TRAIL_BLANKS(saplgrap) using 'X'

To set the length of each record including your blanks add this code: perform SET_FIXLEN(saplgrap) using '0' '100'

Don't think this is needed any more.

Andrew

Former Member
0 Kudos
94

Thanks Andrew for the reply. But it is still not happening.

Thanks,

Jayant