엑셀을 인터널테이블 업로드할때 필드의 자리수가 100자 이상 올릴수 있는 펑션이 있나요?
현재
ALSM_EXCEL_TO_INTERNAL_TABLE 펑션을 사용하는데
50자리까지가 한계라 업로드에 불편함이 많습니다.
답변 부탁드립니다.
댓글 4
-
Risky
2009.11.27 12:24
-
찬호사랑
2009.11.27 13:36
이거 사용하십시요.이 펑션 굿입니다.
i_end_col = '80'
여기를 100이상으로 설정하심 될거 같은데요..
전 80만 해바서요..
100이상해보고 잘되는지 연락주세요.
data : l_itab type standard table of kcde_intern_struc
with header line.
data : l_index like sy-tabix.
field-symbols <fs>.
clear l_itab.
call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
exporting
filename = p_infile
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '80'
i_end_row = '20000'
tables
intern = l_itab.
if sy-subrc ne 0.
message s208(00) with 'File upload failed !'.
stop.
endif.
check not l_itab[] is initial.
data : pattern value ','.
data : repl_string value ' '.
sort l_itab by row col.
clear inp. refresh inp.
clear u_tab. refresh u_tab.
loop at l_itab.
*- Exclude header text
check l_itab-row > 2.
move : l_itab-col to l_index.
assign component l_index of structure u_tab to <fs>.
move : l_itab-value to <fs>.
at end of row.
append u_tab.
clear u_tab.
endat.
endloop. -
요요
2009.11.27 14:09
찬호사랑님 처럼 다른 펑션 사용하시는 것이 좋을 것 같네요.
보통은 function group을 통째로 카피해서 구조만 바꿔서 사용합니다만
업그레이드시 관련 패치가 있다면 적용못받는다는 단점이 있어서
웬만하면 다른 펑션을 찾아서 씁니다. 엑셀 업로드하는 펑션은 찾아보면 많이 있을 거예요.
-
사니아
2009.11.30 17:52
types: t_100 type char100.
types: begin of t_xlist,
bukrs type t_100,
proj_id type t_100,
wrkst type t_100,
grp_no type t_100,
loss_qty type t_100,
meins type t_100,
end of t_xlist.
data: gs_xlist type t_xlist,
gt_xlist type standard table of t_xlist.
clear gf_answer.
types truxs_t_text_data(4096) type c occurs 0.
data: lv_table_name like feld-name,
lv_lines type i,
lv_fname type string,
v_data type truxs_t_text_data,
lv_xls$(5) type c value '.XLS$'.
move pv_fname to lv_fname.
translate lv_fname to upper case. "대문자로
condense lv_fname no-gaps. "공백제거
find regex lv_xls$ in lv_fname.
if sy-subrc = 0.
call function 'TEXT_CONVERT_XLS_TO_SAP'
exporting
* i_field_seperator =
i_line_header = 'X'
i_tab_raw_data = v_data
i_filename = pv_fname
tables
i_tab_converted_data = gt_xlist
exceptions
conversion_failed = 1
others = 2.
if sy-subrc <> 0.
message s303 with 'Error occurs while file upload!'(000)
display like 'E'.
gf_answer = zgmmz_true.
exit.
else.
* delete gt_xlist INDEX 1. "필요없음.(헤어라인 제거 해서 옴.)
if gt_xlist[] is initial.
message s303 with 'Checking File Plz.. NO DATA.!'(000)
display like c_e.
move c_x to gf_answer.
exit.
endif.
endif.
else.
message s303 with 'You Can Upload Only EXCEL FILE!'(000)
display like c_e.
move c_x to gf_answer.
exit.
endif.
endform. " get_excel
ALSM_EXCEL_TO_INTERNAL_TABLE not working properly
https://forums.sdn.sap.com/message.jspa?messageID=7649299