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

Problem in GUI_DOWNLOAD Function.

Former Member
0 Likes
779

Hello Friends.

I am trying to do is to download data in a file from a BAPI

structure and make a flat file with this format and

then try to upload the same data in different client

via LSMW.

What happens is that I get the download of the file

contents but the spacing of the characters have

shifted and so when I run the same file in LSMW the

values of the fields do not appear consistent.

Ours is a unicode system ecc 6.0 and when i go in

debugger I see the values in consistent format but

when it comes to download it changes .

kindly please suggest something.

I also tried to write the file directly with open

dataset for output but in that also I get an error

regarding encoding.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = i_file

filetype = 'ASC'

append = ' '

write_field_separator = ' '

header = '00'

trunc_trailing_blanks = ' '

write_lf = 'X'

TABLES

data_tab = i_data_tab

I use the most standard settings.

Kindly suggest how can I get the required output.

Thanks in advance.

Regards,

Sohail

7 REPLIES 7
Read only

uwe_schieferstein
Active Contributor
0 Likes
708

Hello Sohail

The function modules for upload/download are not Unicode-compatible. Instead use the corresponding static methods of class CL_GUI_FRONTEND_SERVICES (GUI_UPLOAD, GUI_DOWNLOAD).

Regards,

Uwe

Read only

Former Member
0 Likes
708

>

try to use field separator..then spaces will be maintained...

> CALL FUNCTION 'GUI_DOWNLOAD'

> EXPORTING

> * BIN_FILESIZE =

> filename = i_file

> filetype = 'ASC'

> append = ' '

write_field_separator = 'X '

> header = '00'

> trunc_trailing_blanks = ' '

> write_lf = 'X'

> TABLES

> data_tab = i_data_tab

>

> I use the most standard settings.

> Kindly suggest how can I get the required output.

>

>

> Thanks in advance.

> Regards,

> Sohail

Read only

Former Member
0 Likes
708

Hi,

you can set the default codepage for upload/download in the SAPLogon as described in the SAP Note Number: 765763

SAP GUI and the server are enhanced in such a way that the user can specify his codepage of choice in the SAPLogon dialog in the connection's advanced properties.

Regards,

Stefan

Read only

Former Member
0 Likes
708

Hello All,

Thanks for your prompt replies, I tried all the options that each one told but still I am facing the same problem.

I am not able to download the file in the correct format.

Please do help me if you have any thoughts.

Thanks.

Sohail Mansuri

Read only

Clemenss
Active Contributor
0 Likes
708

Hi Sohail,

probably the structure i_data_tab contains non-character fields. Please give more details.

Regards,

Clemens

Read only

Former Member
0 Likes
708

Hello Clemens,

It does contain DATs and NUMC fields .

Regards,

Sohail

Read only

0 Likes
708

Hi Sohail,

> It does contain DATs and NUMC fields .

As DATS and NUMC are represented as character fields, this should not be the reason.

I'd rather suspect that the BAPI structure of the download is different from the LSMW structure expected for input. This is very common with BAPIs that the output structures from BAPI...GET_DETAIL are a litle bit different from the input structures. First check the structures!

You may give us more details on structure names and/or fields.

Regards,

Clemens