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

FILER SERVER TO INTERNAL TABLE

Former Member
0 Likes
882

Hi Experts!!

How I can download a file server and store it in an internal table for display in an ALV?

Try this function:

CALL FUNCTION 'ARCHIVFILE_SERVER_TO_TABLE'

EXPORTING

sourcepath = l_file --> TYPE SAPB-SAPPFAD

  • WITHOUT_DELETE = ' '

  • IMPORTING

  • LENGTH =

tables

archivobject = t_fichero " --> t_fichero like docs OCCURS 0 WITH HEADER LINE

But I think the standard is wrong:

assign archivobject-lines(length) to <f1>.

I'm triyin with OPEN DATASET l_file FOR INPUT IN BINARY MODE, but in the ALV show ascii code

Can someone please help me, PLEASE

Hi Experts!!

How I can download a file server and store it in an internal table for display in an ALV?

Try this function:

CALL FUNCTION 'ARCHIVFILE_SERVER_TO_TABLE'

EXPORTING

sourcepath = l_file --> TYPE SAPB-SAPPFAD

  • WITHOUT_DELETE = ' '

  • IMPORTING

  • LENGTH =

tables

archivobject = t_fichero " --> t_fichero like docs OCCURS 0 WITH HEADER LINE

But I think the standard is wrong:

assign archivobject-lines(length) to <f1>.

I'm triyin with OPEN DATASET l_file FOR INPUT IN BINARY MODE, but in the ALV show ascii code

Can someone please help me, PLEASE

4 REPLIES 4
Read only

jayesh_gupta
Active Participant
0 Likes
755

Hi,

Use OPEN DATASET l_file FOR INPUT IN TEXT MODE. The ALV will display the text and not the binary values.

Regards,

Jayesh

Read only

0 Likes
755

I used too in TEXT MODE, but when I try read a file.txt or file .pdf, anyone different of .csv --> DUMP

OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

ELSE.

DO.

CLEAR wa_fichero.

READ DATASET l_file INTO wa_fichero.

IF sy-subrc NE 0.

EXIT.

ENDIF.

APPEND wa_fichero TO t_fichero.

ENDDO.

CLOSE DATASET l_file.

CALL SCREEN '1004'.

ENDIF. " IF sy-subrc NE 0.

DUMP:

At the conversion of a text from codepage '4110' to codepage '4102':

- a character was found that cannot be displayed in one of the two

codepages;

- or it was detected that this conversion is not supported

The running ABAP program 'Z_MONI_ETL' had to be terminated as the conversion

would have produced incorrect data.

The number of characters that could not be displayed (and therefore not

be converted), is 1. If this number is 0, the second error case, as

mentioned above, has occurred.

Edited by: Ivan R on Apr 20, 2010 10:08 AM

Read only

0 Likes
755

Check with the file structure. .csv are basically comma separated file and that works pretty well.

May be you need to use SPLIT the special characters in the file uploaded.

You can even debug and see the internal table data hold structure.

Read only

jayesh_gupta
Active Participant
0 Likes
755

Hi,

For .doc and .pdf files, you will have to use Binary mode only. So, go ahead with the code you were using and then convert the binary data to text using the Function module SCMS_BINARY_TO_TEXT.

Hope this helps.

Regards,

Jayesh