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

Read DBF file from application server to internal table - background mode

Former Member
0 Likes
1,200

Hello everyone,

I think I read all the posts and no clear answer was given at this topic. I have a DBF file on the application server and I have to fill an internal table with the data from the file.

I tried using GUI_DOWNLOAD, but it seems it does not work in background. WS_DOWLOAD is obsolete.

ALSM_EXCEL_TO_INTERNAL_TABLE returns sy-subrc 2, I am not sure if it does not support download from application server or it does not understand DBF files.

Has anyone found a solution to this problem?

Thanks and regards,

Efren

1 ACCEPTED SOLUTION
Read only

edgar_nagasaki
Contributor
0 Likes
1,004

Hi Efren,

Yes, you will not be able to use GUI_DOWNLOAD in background mode (once it needs an active frontend) so, as Azeem suggested above, will need to use OPEN/READ DATASET instead.

But I did some research about your dbf reading question and I'm affraid you can't read it directly though OPEN/READ and would need to first convert it to a flat text file.

Regards,

Edgar

Hello everyone,

I think I read all the posts and no clear answer was given at this topic. I have a DBF file on the application server and I have to fill an internal table with the data from the file.

I tried using GUI_DOWNLOAD, but it seems it does not work in background. WS_DOWLOAD is obsolete.

ALSM_EXCEL_TO_INTERNAL_TABLE returns sy-subrc 2, I am not sure if it does not support download from application server or it does not understand DBF files.

Has anyone found a solution to this problem?

Thanks and regards,

Efren

5 REPLIES 5
Read only

Azeemquadri
Contributor
0 Likes
1,004

Please use :

Open dataset to open file.

Read dataset to read the file.

http://help.sap.com/saphelp_40b/helpdata/en/34/55cad198482bc0e10000009b38f91f/content.htm

Read only

edgar_nagasaki
Contributor
0 Likes
1,005

Hi Efren,

Yes, you will not be able to use GUI_DOWNLOAD in background mode (once it needs an active frontend) so, as Azeem suggested above, will need to use OPEN/READ DATASET instead.

But I did some research about your dbf reading question and I'm affraid you can't read it directly though OPEN/READ and would need to first convert it to a flat text file.

Regards,

Edgar

Read only

0 Likes
1,004

Hi Edgar,

Thanks for your answer. I forgot to say that I tried also open/read dataset. First, I got an error with the codepage(# is not an accepted character). After I used binary legacy mode and it worked. The problem is that only the first line from the file is being read and even this line is not read completely. The target is a string or a char with 1024 characters, but only a part of the first line is read, and the other lines are not.

The conversion can be done by ABAP coding or are you reffering to external conversion? I need to do it in ABAP...

Regards,

Efren

Read only

0 Likes
1,004

Hi,

Solved:

CALL METHOD cl_rsan_ut_appserv_file_reader=>appserver_file_read

EXPORTING

i_filename   = lv_file_name"dbf file on server

CHANGING

c_data_tab   = lt_file_table.

Regards,

Efren

Read only

0 Likes
1,004

Hi Efren,

Sorry for delay in reply, having a bit busy day today...

Good to know you could solve that and, better, will keep your solution in my mind for future reference.

Regards,

Edgar