‎2007 Dec 29 1:53 PM
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
‎2007 Dec 29 3:49 PM
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
‎2007 Dec 29 4:40 PM
>
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
‎2007 Dec 29 5:03 PM
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
‎2007 Dec 29 11:00 PM
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
‎2007 Dec 30 12:18 AM
Hi Sohail,
probably the structure i_data_tab contains non-character fields. Please give more details.
Regards,
Clemens
‎2007 Dec 30 12:27 AM
Hello Clemens,
It does contain DATs and NUMC fields .
Regards,
Sohail
‎2007 Dec 30 10:46 AM
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