2012 Dec 05 10:02 AM
Hi,
I have used WS_DOWNLOAD and GUI_DOWNLOAD but when i download file i have a file with one more record:
for example : if in my internal table i have 5 records i will have a file with 6 records.
this is my code:
PARAMETERS: p_filel LIKE rlgrap-filename.
TYPES: BEGIN OF typ_stru_dchar,
line(3000) TYPE c,
END OF typ_stru_dchar.
TYPES: typ_tab_dchar TYPE STANDARD TABLE OF typ_stru_dchar.
DATA wa_dchar TYPE typ_stru_dchar.
DATA tb_dchar TYPE typ_tab_dchar.
wa_dchar-line = ' fist test'.
append wa_dchar to tb_dchar.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = p_filel
filetype = 'ASC'
TABLES
data_tab = tb_dchar[]
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
Why i have this problem??...i don't understand
Thanks
2012 Dec 05 10:23 AM
In GUI_DOWNLOAD- set these parameters to remove that extra line....
TRUNC_TRAILING_BLANKS = 'X'
TRUNC_TRAILING_BLANKS_EOL = 'X'
WRITE_LF_AFTER_LAST_LINE = ABAP_FALSE
Hi,
I have used WS_DOWNLOAD and GUI_DOWNLOAD but when i download file i have a file with one more record:
for example : if in my internal table i have 5 records i will have a file with 6 records.
this is my code:
PARAMETERS: p_filel LIKE rlgrap-filename.
TYPES: BEGIN OF typ_stru_dchar,
line(3000) TYPE c,
END OF typ_stru_dchar.
TYPES: typ_tab_dchar TYPE STANDARD TABLE OF typ_stru_dchar.
DATA wa_dchar TYPE typ_stru_dchar.
DATA tb_dchar TYPE typ_tab_dchar.
wa_dchar-line = ' fist test'.
append wa_dchar to tb_dchar.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = p_filel
filetype = 'ASC'
TABLES
data_tab = tb_dchar[]
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
Why i have this problem??...i don't understand
Thanks
2012 Dec 05 10:23 AM
In GUI_DOWNLOAD- set these parameters to remove that extra line....
TRUNC_TRAILING_BLANKS = 'X'
TRUNC_TRAILING_BLANKS_EOL = 'X'
WRITE_LF_AFTER_LAST_LINE = ABAP_FALSE
2012 Dec 05 10:36 AM
2012 Dec 05 10:38 AM
2012 Dec 05 11:04 AM
I'm solved ...i'm wrong to set WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE but the correct value is ABAP_FALSE.
thanks
2012 Dec 05 10:40 AM
Hi,
Please chekc this code.
wa_dchar-line = ' fist test'.
CONDENSE wa_dchar-line .
append wa_dchar to tb_dchar.
wa_dchar-line = ' Second test'.
CONDENSE wa_dchar-line .
append wa_dchar to tb_dchar.
Regard's
Smruti
2012 Dec 05 10:54 AM
Check if it happens using this method:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = p_filel
filetype = 'ASC'
CHANGING
data_tab = tb_dchar[]
EXCEPTIONS
OTHERS = 1.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |