엑셀 업로드 시 덤프가 나는데요.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 100
i_end_row = 65536
TABLES
intern = gt_xls.
요 펑션을 탈 때 덤프가 나구요.
덤프 내용은 파일 첨부하였습니다 ..
어디서 오류난건지 모르겠네요.. ㅠ
댓글 3
-
썬바바
2007.12.11 22:40
-
노름마치
2007.12.12 01:52
전 이렇게 하니까루 잘 되는디요
REPORT y_upload_xls.
DATA : it_xls LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
werks TYPE werks_d,
lgort TYPE lgort_d,
END OF itab.
PARAMETERS p_file LIKE rlgrap-filename DEFAULT 'C:TEMP.XLS' OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_filename USING p_file.
*&---------------------------------------------------------------------*
*& Form get_filename
*&---------------------------------------------------------------------*
FORM get_filename USING p_p_file.
DATA : v_file TYPE dynfieldvalue.
CALL FUNCTION 'FM_FYC_DYNPRO_VALUE_READ'
EXPORTING
i_repid = sy-repid
i_dynnr = '1000'
i_fieldname = 'P_FILE'
IMPORTING
e_fieldvalue = v_file.
p_file = v_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = p_file
mask = ',*.*,*.*.'
mode = 'O'
title = text-011
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc NE 0.
CLEAR p_file.
ENDIF.
ENDFORM. "get_filename
START-OF-SELECTION.
CLEAR it_xls[].
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_end_col = 2
i_begin_row = 1
i_end_row = 20000
TABLES
intern = it_xls
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
CHECK sy-subrc IS INITIAL.
CLEAR itab[].
LOOP AT it_xls.
CASE it_xls-col.
WHEN '0001'.
itab-werks = it_xls-value.
WHEN '0002'.
itab-lgort = it_xls-value.
ENDCASE.
AT END OF row.
APPEND itab.
CLEAR itab.
ENDAT.
ENDLOOP.
CHECK NOT itab[] IS INITIAL.
SORT itab BY werks lgort.
DELETE ADJACENT DUPLICATES FROM itab COMPARING werks lgort.
BREAK-POINT.
-
mean
2007.12.13 01:45
답변 감사합니다.
해결은 제 pc에서는 잘되는데 한분 pc에서 안되서 sap도 다시깔고 패치도 다시해보니 해결되었습니다.
답변덕분에 빠져있던 exception처리도 넣었구요^^ check sy-subrc is initial도 넣었습니다. ^^
함수의 exception구문이 빠져 있다는 내용인듯 싶은데요..