BSP 첨부파일 체크로직
– BSP 화면
SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000; background:
#FFFFFF; } .L3S33 { color: #009300; } .L3S50 { color: #00008B; } .L3S51 { color:
#8B0000; } <htmlb:form id = “default_form”
action = “default.htm”
encodingType = “multipart/form-data” >
SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000;
background: #FFFFFF; } .L1S32 { color: #3399FF; } .L1S33 { color: #4DA619; }
.L1S52 { color: #0000FF; } .L3S33 { color: #009300; } .L3S50 { color: #00008B; }
.L3S51 { color: #8B0000; } .L3S52 { font-weight: bold; } .L3S53 { color:
#FF0000; background: #F2FFF9; } .L3S56 { font-style: italic; color: #666666; }
<%
FIELD-SYMBOLS: <fs> TYPE any.
DATA: lv_cnt(1) TYPE n.
DATA: lv_field TYPE string.
DATA: lv_file TYPE string.
DO 3 TIMES.
lv_cnt = sy-index.
CONCATENATE ‘GS_HEADER-ATTCH’ lv_cnt INTO lv_field.
CONCATENATE ‘GS_FILE_INFO’ lv_cnt ‘-NAME’ INTO lv_file.
ASSIGN (lv_file) TO <fs>.
%>
<tr>
<!– 번호 –>
<td align=‘center’ class = “cbo_table_content”>
<htmlb:textView text=“<%= lv_cnt %>” />
</td>
<td align=‘left’ class = “cbo_table_content”>
<!– 첨부문서 –>
<htmlb:fileUpload id = “<%= lv_field %>”
size = “20” />
<htmlb:button text = “<%= otr(ZAVOTR/TXT_UPLOAD) %>”
onClientClick = “get_attach_line(‘<%= lv_cnt %>’)”
disabled = “<%= gv_edit_flag %>”
onClick = “UPLOAD_FILE” />
<%
IF lv_field IS NOT INITIAL.
%>
<htmlb:link id = “<%= lv_file %>”
text = “<%= <fs> %>”
onClientClick = “get_attach_line(‘<%= lv_cnt %>’)”
onClick = “ATTCH” />
<%
ENDIF.
%>
</td>
<td align=‘center’ class = “cbo_table_content”>
<%
IF gv_edit_flag NE ‘true’.
%>
<htmlb:image id = “temp”
src = “../PUBLIC/BC/BSP/Icons/s_b_dele.gif”
onClick = “LINE_DEL”
onClientClick = “del_etc_file(‘<%= lv_cnt %>’,htmlbevent)” />
<%
ENDIF.
%>
</td>
</tr>
<%
ENDDO.
%>
– BSP : Outputprocessing
SPAN { font-family: “Courier New“; font-size: 10pt; color: #000000; background:
#FFFFFF; } .L1S31 { font-style: italic; color: #FF0000; } .L1S32 { color:
#3399FF; } .L1S33 { color: #4DA619; } .L1S52 { color: #0000FF; } * 파일정보 읽어오기
DEFINE manage_doc.
application->get_file_from_htmbfileupload(
exporting
request = request
htmlb_id = &1
receiving file_info = ls_file_tmp
exceptions
file_size_over = 1
others = 2 ).
if ls_file_tmp-name is not initial.
&2 = ls_file_tmp.
else.
page->messages->add_message(
condition = zcl_aveps_app_common=>msg_alert
message = ‘파일정보가 없습니다.’
severity = cl_bsp_messages=>co_severity_error ).
exit.
endif.
* Create Guid
application->create_guid( importing ev_guid = &3 ).
END–OF–DEFINITION.
SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000;
background: #FFFFFF; } .L1S33 { color: #4DA619; } manage_doc ‘GS_HEADER-ATTCH1’ gs_file_info1 lv_guid.
SPAN { font-family: “Courier New”; font-size: 10pt; color: #000000;
background: #FFFFFF; } .L1S31 { font-style: italic; color: #FF0000; } .L1S33 {
color: #4DA619; } .L1S52 { color: #0000FF; } READ TABLE application->gt_file INTO application->gs_file INDEX gv_index.
* 한글문서 저장시 깨짐 방지
SPLIT application->gs_file-name AT ‘.’ INTO: lv_fname_01 lv_fname_02.
lv_fname_01 = cl_http_utility=>escape_url( unescaped = lv_fname_01 ).
REPLACE ALL OCCURRENCES OF ‘+’ IN lv_fname_01 WITH ‘_’ IGNORING CASE.
CONCATENATE ‘attachment;filename=’ lv_fname_01 ‘.’ lv_fname_02 INTO application->gs_file-name.
CALL METHOD cl_bsp_utility=>download
EXPORTING
object_s = application->gs_file-content
content_disposition = application->gs_file-name
response = runtime->server->response
navigation = navigation.