2010 Apr 20 8:53 AM
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
2010 Apr 20 9:01 AM
Hi,
Use OPEN DATASET l_file FOR INPUT IN TEXT MODE. The ALV will display the text and not the binary values.
Regards,
Jayesh
2010 Apr 20 9:06 AM
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
2010 Apr 20 9:09 AM
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.
2010 Apr 20 9:13 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |