Tuesday, December 21, 2010
REPORT ztest_notepad.
TYPES: BEGIN OF ty_table,
field1 TYPE string,
field2 TYPE string,
END OF ty_table.

DATA: t_intern TYPE STANDARD TABLE OF alsmex_tabline,
t_table TYPE STANDARD TABLE OF ty_table WITH HEADER LINE.

FIELD-SYMBOLS:  LIKE LINE OF t_intern,
.

DATA: v_index TYPE i.
"ALSM_EXCEL_TO_INTERNAL_TABLE
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename                = 'C:\File.xls'
i_begin_col             = '1'
i_begin_row             = '1'
i_end_col               = '256'
i_end_row               = '65536'
TABLES
intern                  = t_intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole              = 2
OTHERS                  = 3.

DELETE t_intern WHERE row EQ '0001'.

SORT t_intern BY row col.
LOOP AT t_intern ASSIGNING .
MOVE -col TO v_index.
ASSIGN COMPONENT v_index OF STRUCTURE t_table TO .
MOVE -value TO .
AT END OF row.
APPEND t_table.
CLEAR t_table.
ENDAT.
ENDLOOP.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.