Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Excel to internal table upload 'ALSM_EXCEL_TO_INTERNAL_TABLE' issue

I am using ALSM_EXCEL_TO_INTERNAL_TABLE function module to upload the excel into an internal table. In case there is a column with no data. This function module is still populating the previous row data into the internal table

Ex. if the Excel has data like the below 3 rows and 3 columns

1 10 5.0

20

2 6.0

The internal table is posting data like this

1 10 5.0

1 20 5.0

2 20 6.0

Please tell me if i am missing something to be added in the below snip of code

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = p_file

I_BEGIN_COL = B1

I_BEGIN_ROW = C1

I_END_COL = B2

I_END_ROW = C2

TABLES

INTERN = IT_upload

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3.

IF SY-SUBRC = 0.

ENDIF.

LOOP AT IT_upload.

CASE IT_Upload-COL.

WHEN 1.

IT_Excel-BILLCO = IT_Upload-VALUE.

WHEN 2.

IT_Excel-PONUM = IT_Upload-VALUE.

WHEN 3.

CLEAR v_upload.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = IT_upload-value

IMPORTING

OUTPUT = v_upload.

IT_Excel-STORENUM = v_upload.

WHEN 4.

IT_Excel-VINVNUM = IT_Upload-VALUE.

WHEN 5.

IT_Excel-LINEITNUM = IT_Upload-VALUE.

WHEN 6.

IT_Excel-LINEITAMT = IT_upload-VALUE.

WHEN 7.

IT_Excel-TAXAMT = IT_upload-VALUE.

WHEN 8.

IT_Excel-TOTAL = IT_upload-VALUE.

ENDCASE.

AT END OF ROW.

APPEND IT_Excel.

ENDAT.

ENDLOOP.

Former Member
replied

Hi,

Please check below link. surely it will help u.

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=60655105

Thanks

Jitendra

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question