Application Development 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: 

BDC

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

hi,

Try this function module ALSM_EXCEL_TO_INTERNAL_TABLE. You can specify the rows and columns there.

Sushil.

Former Member
0 Kudos

can u explin clearly wt is ur problem...

ramesh.

0 Kudos

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

0 Kudos

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.

former_member223537
Active Contributor
0 Kudos

Hi,

Please refer this thread for upload using BDC :

Direct upload :

/people/kathirvel.balakrishnan2/blog/2006/05/08/data-upload-into-sap-from-microsoft-excel-150-abap-part

Best regards,

Prashant