2008 Nov 21 8:15 AM
Hi,
i receive an XLS file with fm FAA_FILE_UPLOAD_EXCEL thus:
CALL FUNCTION 'FAA_FILE_UPLOAD_EXCEL'
EXPORTING
i_filename = file
i_delimiter = '|'
TABLES
et_filecontent = t_nat
EXCEPTIONS
error_accessing_file = 1
OTHERS = 2.
Next i do:
LOOP AT t_nat.
SPLIT t_nat AT '|' INTO
t_fields-fied1 t_fields-field2
t_fields-field3 t_fields-field4
t_fields-field5 t_fields-field6
t_fields-field7.
.............
ENDLOOP.
the question is:
if the first cell of the excel file is empty then the split shifts left and i get the wrong values.
e.g. excel file
1st row -> value1 value2 value3 value4 value5 value6 value7
2nd row -> value2 value3 value4 value5 value6 value7
as you can see the first cell of the second excel row is empty.
after the split the resulting internal table would be
1st row ->
t_fields-field1 = value1
t_fields-field2 = value2
t_fields-field3 = value3
t_fields-field4 = value4
t_fields-field5 = value5
t_fields-field6 = value6
t_fields-field7 = value7
2nd row ->
t_fields-field1 = value2
t_fields-field2 = value3
t_fields-field3 = value4
t_fields-field4 = value5
t_fields-field5 = value6
t_fields-field6 = value7
t_fields-field7 =
What do i need to do to get the correct values if the first cell is empty?
Best regards
2008 Nov 21 8:52 AM
Hi
LOOP AT t_nat.
SPLIT t_nat AT '|' INTO
t_fields-fied1 t_fields-field2
t_fields-field3 t_fields-field4
t_fields-field5 t_fields-field6
t_fields-field7.
*Check if t_fields-field7 is initial at this point ,if it is intial then you can figure out that first cell is empty
ENDLOOP.
Trythis.
Regards
Neha
Hi,
i receive an XLS file with fm FAA_FILE_UPLOAD_EXCEL thus:
CALL FUNCTION 'FAA_FILE_UPLOAD_EXCEL'
EXPORTING
i_filename = file
i_delimiter = '|'
TABLES
et_filecontent = t_nat
EXCEPTIONS
error_accessing_file = 1
OTHERS = 2.
Next i do:
LOOP AT t_nat.
SPLIT t_nat AT '|' INTO
t_fields-fied1 t_fields-field2
t_fields-field3 t_fields-field4
t_fields-field5 t_fields-field6
t_fields-field7.
.............
ENDLOOP.
the question is:
if the first cell of the excel file is empty then the split shifts left and i get the wrong values.
e.g. excel file
1st row -> value1 value2 value3 value4 value5 value6 value7
2nd row -> value2 value3 value4 value5 value6 value7
as you can see the first cell of the second excel row is empty.
after the split the resulting internal table would be
1st row ->
t_fields-field1 = value1
t_fields-field2 = value2
t_fields-field3 = value3
t_fields-field4 = value4
t_fields-field5 = value5
t_fields-field6 = value6
t_fields-field7 = value7
2nd row ->
t_fields-field1 = value2
t_fields-field2 = value3
t_fields-field3 = value4
t_fields-field4 = value5
t_fields-field5 = value6
t_fields-field6 = value7
t_fields-field7 =
What do i need to do to get the correct values if the first cell is empty?
Best regards
2008 Nov 21 8:52 AM
Hi
LOOP AT t_nat.
SPLIT t_nat AT '|' INTO
t_fields-fied1 t_fields-field2
t_fields-field3 t_fields-field4
t_fields-field5 t_fields-field6
t_fields-field7.
*Check if t_fields-field7 is initial at this point ,if it is intial then you can figure out that first cell is empty
ENDLOOP.
Trythis.
Regards
Neha
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |