2018 Jul 25 4:35 PM
Dear Experts
I am trying to achieve dynamic reading of file from presentation server. The file structure will be know only at run time. i tried to do it but i am getting # between every column. Please find the code below.

SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
PARAMETERS: p_tabnam TYPE tabname,
p_selfl1 TYPE edpline,
p_value TYPE edpline,
p_where1 TYPE edpline.
PARAMETERS: p_file TYPE ibipparms-path.
DATA: file TYPE string.
DATA: it_tab TYPE TABLE OF zfile,
wa_tab TYPE zfile.
DATA: lt_where TYPE TABLE OF edpline,
lt_sel_list TYPE TABLE OF edpline,
l_wa_name TYPE string,
ls_where TYPE edpline,
l_having TYPE string,
dref TYPE REF TO data,
itab_type TYPE REF TO cl_abap_tabledescr,
struct_type TYPE REF TO cl_abap_structdescr,
elem_type TYPE REF TO cl_abap_elemdescr,
comp_tab TYPE cl_abap_structdescr=>component_table,
comp_fld TYPE cl_abap_structdescr=>component.
TYPES: f_count TYPE i.
FIELD-SYMBOLS : <lt_outtab> TYPE ANY TABLE,
"* <ls_outtab> TYPE ANY,
<l_fld> TYPE any.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
file = p_file.
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file
filetype = 'ASC'
has_field_separator = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = it_tab.
In the IT_TAB i am getting the fields name with #. Even i tried to replace the # with blank for all occurrence but its not working.
How to remove this. Since the structure is declared as char 999. I am getting like this. Please let me know how to achieve this.
Thanks and Regards
Vijay
Same question i asked to Neenu below: how could this solve the issue to generate a dynamic table from a file with undefined structure?
2018 Jul 25 5:32 PM
Hi,
Consider below parameter or FM ALSM_EXCEL_TO_INTERNAL_TABLE
has_field_separator = 'X' "file is TAB delimited
Regards,
2018 Jul 25 5:37 PM
Hi,
Consider below parameter or FM ALSM_EXCEL_TO_INTERNAL_TABLE
has_field_separator = 'X' "file is TAB delimited
Regards,
2018 Jul 26 4:20 AM
Hi Roberto
If i use has_field_seperator = 'X' only first field getting populated. I am using tab delimited txt file.
Thanks and Regards
vijay
2018 Jul 26 1:47 AM
i think # is present for horizion tab which is CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB in abap. can you try like this:
REPLACE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB IN ls_tab WITH SPACE.
2018 Jul 26 3:18 PM
Same question i asked to Neenu below: how could this solve the issue to generate a dynamic table from a file with undefined structure?
2018 Jul 27 3:10 AM
So you should read the question more carefully, he asked about how to resolve the replace of # characters when upload file to abap, above is my suggestion to achive it. Clearly, as we see his code, he going to use RTTS to do dynamic table.
2018 Jul 26 7:28 AM
When you post code, please use right-click "paste as plain text".
2018 Jul 26 12:19 PM
The upload has correctly uploaded the file as you gave it no clues of not doing so.
NB: Also replace FM gui_upload by method cl_gui_frontend_services=>gui_upload.
2018 Jul 26 3:16 PM
Why do you suggest this?
The request is to create a dynamic table based on a variable file structure.
How could your suggestion to solve such issue?
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |