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: 

How to download .DBF file from SAP to PC?

Former Member
0 Kudos

Hi Guys,

I have a problem with alpha accent characters when I have tried to download the file in .DBF file format.

I have done a little code that explain the wrong situation.

   TYPES: BEGIN OF S_FILE,
       TEXT(100) TYPE C,
       END OF S_FILE.


DATA:FILE TYPE STANDARD TABLE OF S_FILE WITH HEADER LINE.

FILE-TEXT = 'OPERACIÓN PRUEBA1'.
APPEND FILE.
FILE-TEXT = 'operación prueba2'.
APPEND FILE.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
  EXPORTING
    FILENAME = 'd:\PRUEBA\PRUEBA1.DBF'
    FILETYPE = 'DBF'
  CHANGING
    DATA_TAB = FILE[]
  EXCEPTIONS
    OTHERS   = 1.

IF SY-SUBRC IS NOT INITIAL.

  MESSAGE 'ERROR' TYPE 'I'.
ELSE.
  MESSAGE 'OK' TYPE 'I'.
ENDIF.

The wrong result is PRUEBA1.DBF

OPERACIàN PRUEBA1

operaci¢n prueba2

Thanks in advance.

Best regards .

Ana.

6 REPLIES 6

arindam_m
Active Contributor
0 Kudos

Hi,

Check if the file type = 'ASC' helps as .DBF are essentially ASCII encoding so may be its misinterpreting the ASCII encoded characters.

Cheers,

Arindam

Former Member
0 Kudos

Hi Arindam Mondal,

if I put the file type = 'ASC' then I can't open the file in .DBF format.

Thanks.

arindam_m
Active Contributor
0 Kudos

Hi,

Can you try doing the same with

cl_gui_frontend_services=>gui_download

Also, how do you view the DBF file any viewer your using or excel.

Cheers,

Arindam

Former Member
0 Kudos

Hi Ana,

Check this Note : 702772 - Support for DBF file format added to gui_download .

Note : What is your SAP Release Number ?

Regard's

Smruti

0 Kudos

Hi Smruti Ranjan Mohanty,

My SAP_BASIS is SAPKB73104 so the SAP note 702772 is not solving the problem.

Thanks.

Best regards.

Ana.

0 Kudos

Hi Ana Mari,

Pass Code Page into "CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD" as per your language required , i hope this is "Spanish Language " text which you download .

Note 1088209 - Help for troubleshooting: Code page display problems

Note 73606     - Supported Languages and Code Pages

Regard's

Smruti