Beruflich Dokumente
Kultur Dokumente
rlgrap-filename,
string,
string,
i,
if cancel eq true.
exit.
endif.
perform init_file_line using dir
file.
perform init.
perform upload changing rc.
if rc = 1.
perform bd_textbox_err(rstxpdft) using 80
'Error in Upload'(003).
else.
perform bd_textbox_msg(rstxpdft) using 80
'The upload of Wordtemplate is done'(001).
endif.
form init.
* init for 2003 Upload
* release
rel = sy-saprl.
rel_i = rel(2).
if
rel_i
l_doc_id =
elseif rel_i
l_doc_id =
elseif rel_i
l_doc_id =
else.
exit.
endif.
ge 70.
doc_id_700.
eq 64.
doc_id_640.
eq 62.
doc_id_620.
endform.
form init_file_line using dir type string
file type string.
* BDS file line
data: file_up type string.
clear l_files_line.
file_up = file.
translate file_up to upper case.
clear l_files_line.
* l_files_line-comp_id = 'WORDTEMPLATE.DOT'.
l_files_line-comp_id = 'Word2007template.dotm'.
l_files_line-directory = dir.
l_files_line-filename = file_up.
l_files_line-mimetype = 'APPLICATION/MSWORD'.
clear l_files[].
append l_files_line to l_files[].
endform.
form check_data.
if rel_i ge 70.
perform delete_rel using 62.
perform delete_rel using 64.
elseif rel_i eq 64.
perform delete_rel
perform delete_rel
elseif rel_i eq 62.
perform delete_rel
perform delete_rel
else.
exit.
endif.
endform.
using 62.
using 70.
using 64.
using 70.
p_rel eq 62.
move: doc_id_620 to signature_line-doc_id.
elseif p_rel eq 64.
move: doc_id_640 to signature_line-doc_id.
elseif p_rel eq 70.
move: doc_id_700 to signature_line-doc_id.
else.
exit.
endif.
append signature_line to signature[].
call function 'BDS_BUSINESSDOCUMENT_GET_INFO'
exporting
classname
= bds_classname
classtype
= bds_classtype
object_key
= bds_objectkey
tables
signature
= signature
exceptions
nothing_found
= 1
parameter_error
= 2
not_allowed
= 3
error_kpro
= 4
internal_error
= 5
not_authorized
= 6
others
= 9.
if sy-subrc eq 0.
call function 'POPUP_TO_CONFIRM_STEP'
exporting
titel
= 'Template delete'
textline1
=
'The system contains Wordtemplate.dot from old Basis release.'
textline2
= 'Do you want to delete this Object?'
defaultoption = pp_no
importing
answer
= pp_leave.
if pp_leave = pp_yes.
like rlgrap-filename
like ext
p_dir
p_file
p_cancel
data: name
filetable
filter
rc
uact
result
l_res
l_str
l_res2
l_find
l_name
type
type
type
type
type
type
type
type
type
like
type
type string
type string
type c.
string,
filetable,
string,
i,
i,
tdbool,
i,
i,
i,
sy-subrc,
string.
l_name = name.
l_str = strlen( name ).
while l_find eq 0 and
l_res2 lt l_str.
l_name = l_name+l_res.
find '\' in l_name match offset l_res.
l_find = sy-subrc.
if l_find eq 0.
l_res = l_res + 1.
l_res2 = l_res2 + l_res.
endif.
endwhile.
if l_res2 eq 0.
p_cancel = 'X'.
exit.
endif.
p_file = name+l_res2.
p_dir = name(l_res2).
p_filename = name.
else.
exit.
endif.
endform.