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

FAA_FILE_UPLOAD_EXCEL

former_member182371
Active Contributor
0 Likes
798

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
496

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

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

1 REPLY 1
Read only

Former Member
0 Likes
497

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