‎2006 Sep 05 10:40 AM
Hi all,
How do I get/upload the data from an excel sheet which has the values spread in different columns and rows.i.e how to fetch data from one row/column here and one row/column there (not in a sequential order of rows and coulmns)from the excel sheet.
pl help...
answers r sure rewarded
thanks
‎2006 Sep 05 10:42 AM
hi,
Try this function module ALSM_EXCEL_TO_INTERNAL_TABLE. You can specify the rows and columns there.
Sushil.
‎2006 Sep 05 10:43 AM
‎2006 Sep 05 10:54 AM
In excel, The fields to be uploaded are not one below the other, like One field is in suppose 'A2' cell,the other value is in b3 and so on...
How do i get it into the internal table in such case....
thanks, bye
‎2006 Sep 05 11:14 AM
hi,
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_infl
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = 8
I_END_ROW = 1000
TABLES
INTERN = T_DATA
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
T_FINAL-RESOURCE = 'Resource'.
T_FINAL-DATE = 'Date'.
T_FINAL-DURATION = 'Duration'.
T_FINAL-ACTIVITY = 'Activity'.
T_FINAL-B_NBILL = 'Billable'.
APPEND T_FINAL.
SORT T_DATA BY ROW COL.
LOOP AT T_DATA.
CASE T_DATA-COL.
WHEN 3.
T_DATA1-RESOURCE = T_DATA-VALUE.
WHEN 4.
T_DATA1-DATE = T_DATA-VALUE.
WHEN 5.
T_DATA1-DURATION = T_DATA-VALUE.
WHEN 6.
t_data1-activity = t_data-value.
WHEN 7.
T_DATA1-B_NBILL = T_DATA-VALUE.
ENDCASE.
AT END OF ROW.
COLLECT T_DATA1.
ENDAT.
ENDLOOP.
LOOP AT T_DATA1.
T_FINAL-RESOURCE = T_DATA1-RESOURCE.
T_FINAL-DATE = T_DATA1-DATE.
T_FINAL-DURATION = T_DATA1-DURATION.
T_FINAL-ACTIVITY = T_DATA1-ACTIVITY.
T_FINAL-B_NBILL = T_DATA1-B_NBILL.
APPEND T_FINAL.
ENDLOOP.
hope this helps,
do reward if it helps,
priya.
‎2006 Sep 05 10:45 AM