*&---------------------------------------------------------------------*
*& Report ZSOFTCOPY_MAKE *
*& *
*&---------------------------------------------------------------------*
*& *
*& This program is free software: you can redistribute it and/or *
*& modify it under the terms of the GNU General Public License as *
*& published by the Free Software Foundation, either version 3 of the *
*& License, or any later version. *
*& *
*& This program is distributed in the hope that it will be useful, *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
*& See the GNU General Public License for more details. *
*& *
*& You should have received a copy of the GNU General Public License *
*& along with this program. If not, see .*
*& *
*&---------------------------------------------------------------------*
*& *
*& Author: Ruediger von Creytz ruediger.creytz@globalbit.net *
*& Copyright: globalBIT, LLC http://www.globalbit.net *
*& Version: 20210302 *
*& *
*&---------------------------------------------------------------------*
REPORT zsoftcopy_make.
*&---------------------------------------------------------------------*
*& Include ZSOFTCOPY_TYPES *
*& *
*&---------------------------------------------------------------------*
*& *
*& This file is part of ZSOFTCOPY. *
*& *
*& ZSOFTCOPY is free software: you can redistribute it and/or modify *
*& it under the terms of the GNU General Public License as published *
*& by the Free Software Foundation, either version 3 of the License, *
*& or any later version. *
*& *
*& ZSOFTCOPY is distributed in the hope that it will be useful, *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
*& GNU General Public License for more details. *
*& *
*& You should have received a copy of the GNU General Public License *
*& along with ZDOWNLOAD. If not, see . *
*& *
*&---------------------------------------------------------------------*
*& *
*& Author: Ruediger von Creytz ruediger.creytz@globalbit.net *
*& Copyright: globalBIT, LLC http://www.globalbit.net *
*& *
*&---------------------------------------------------------------------*
TYPE-POOLS:
abap.
TYPES:
it_abapsource TYPE STANDARD TABLE OF abapsource,
BEGIN OF st_abaptxt255,
line(255) TYPE c,
END OF st_abaptxt255,
it_abaptxt255 TYPE STANDARD TABLE OF st_abaptxt255,
BEGIN OF st_access,
checked TYPE flag,
ddtext TYPE string,
sub TYPE n,
END OF st_access,
it_access TYPE STANDARD TABLE OF st_access,
BEGIN OF st_attributes,
descript TYPE string,
space_after_descript TYPE flag,
person_responsible TYPE as4user,
person_responsible_text TYPE ad_namtext,
author TYPE bname,
author_text TYPE ad_namtext,
date_created TYPE string,
bname TYPE bname,
name_text TYPE ad_namtext,
date_last_changed TYPE string,
time_last_changed TYPE string,
date_last_generation TYPE string,
time_last_generation TYPE string,
devclass TYPE devclass,
devclass_descr TYPE as4text,
laiso TYPE laiso,
sptxt TYPE sptxt,
display_appview TYPE flag,
appview TYPE string,
is_bsp_appl TYPE flag,
internal_name TYPE string,
initial_bsp TYPE string,
application_class TYPE string,
theme TYPE string,
stateful TYPE flag,
supports_portal_integration TYPE flag,
display_rfcenable TYPE flag,
rfcenable TYPE flag,
application_component TYPE akhkompo,
END OF st_attributes,
BEGIN OF st_component,
component TYPE dlvunit,
release TYPE saprelease,
level TYPE num4,
high_package TYPE patch,
desc_text TYPE comp_desc,
END OF st_component,
it_component TYPE STANDARD TABLE OF st_component,
BEGIN OF st_contflag_range,
sign(1) TYPE c,
option(2) TYPE c,
low TYPE contflag,
high TYPE contflag,
END OF st_contflag_range,
it_contflag_range TYPE STANDARD TABLE OF st_contflag_range,
it_d021s TYPE STANDARD TABLE OF d021s,
BEGIN OF st_data_type,
domname TYPE domname,
domdescr TYPE as4text,
datatype TYPE datatype_d,
datadescr TYPE val_text,
dataleng TYPE ddleng,
datadeci TYPE decimals,
refkind TYPE typekind,
reftype(1) TYPE c,
END OF st_data_type,
BEGIN OF st_definition_1,
datatype TYPE datatype_d,
datadescr TYPE string,
dataleng TYPE ddleng,
datadeci TYPE decimals,
outputlen TYPE outputlen,
convexit TYPE convexit,
signflag TYPE signflag,
lowercase TYPE lowercase,
END OF st_definition_1,
BEGIN OF st_definition_2,
selmethod TYPE selmethod,
texttab TYPE selmethtxt,
dialogtype TYPE ddshdiatyp,
hotkey TYPE ddshhotkey,
selmexit TYPE ddshselext,
END OF st_definition_2,
BEGIN OF st_deliv_maint,
display_cont TYPE flag,
contflag TYPE contflag,
contflag_text TYPE string,
display_main TYPE flag,
mainflag_text TYPE string,
sqltab TYPE sqlappdtab,
END OF st_deliv_maint,
BEGIN OF st_dom_value,
text TYPE val_text,
value TYPE domvalue_l,
END OF st_dom_value,
it_dom_value TYPE STANDARD TABLE OF st_dom_value,
BEGIN OF st_dynpro_function_new, "since version 4.01
type(1) TYPE c,
code TYPE tcode,
END OF st_dynpro_function_new,
BEGIN OF st_dynpro_function_old, "till version 4.00
code(4) TYPE c,
type(1) TYPE c,
END OF st_dynpro_function_old,
BEGIN OF st_dynpro_name,
prog LIKE d020s-prog,
dnum LIKE d020s-dnum,
END OF st_dynpro_name,
BEGIN OF st_dynpro_release,
rel(1) TYPE c,
dot(1) TYPE c,
version(2) TYPE c,
END OF st_dynpro_release,
it_feld TYPE STANDARD TABLE OF feld,
BEGIN OF st_feld_redef,
dropdown TYPE string,
fobl TYPE string,
END OF st_feld_redef,
it_feld_redef TYPE STANDARD TABLE OF st_feld_redef,
BEGIN OF st_field_label,
scrlen_s TYPE scrlen_s,
scrtext_s TYPE scrtext_s,
scrlen_m TYPE scrlen_m,
scrtext_m TYPE scrtext_m,
scrlen_l TYPE scrlen_l,
scrtext_l TYPE scrtext_l,
headlen TYPE headlen,
reptext TYPE reptext,
END OF st_field_label,
BEGIN OF st_further_char,
shlpname TYPE shlpname,
shlpfield TYPE shlpfield,
memoryid TYPE memoryid,
deffdname TYPE deffdname,
logflag TYPE logflag,
END OF st_further_char,
st_guid(32) TYPE c,
it_guid TYPE STANDARD TABLE OF st_guid,
BEGIN OF st_init_access,
info1 TYPE string,
info2 TYPE string,
occurs(5) TYPE n,
unknown TYPE flag,
END OF st_init_access,
BEGIN OF st_join_conditions,
tabname_l TYPE tabname,
fieldname_l TYPE fieldname,
operator TYPE string,
tabname_r TYPE tabname,
fieldname_r TYPE fieldname,
END OF st_join_conditions,
it_join_conditions TYPE STANDARD TABLE OF st_join_conditions,
BEGIN OF st_key,
info TYPE string,
END OF st_key,
BEGIN OF st_last_logon,
date TYPE sydatum,
time TYPE syuzeit,
date_now TYPE sydatum,
time_now TYPE syuzeit,
END OF st_last_logon,
BEGIN OF st_line,
line(255) TYPE c,
END OF st_line,
it_line TYPE STANDARD TABLE OF st_line,
BEGIN OF st_line_type,
info TYPE string,
rowkind TYPE string,
rowtype TYPE string,
rowdescr TYPE string,
datatype TYPE datatype_d,
dataleng TYPE ddleng,
datadeci TYPE decimals,
reftype(1) TYPE c,
refdescr TYPE string,
range_ctyp TYPE string,
ctdatatype TYPE datatype_d,
ctleng TYPE ddleng,
ctdecimals TYPE decimals,
END OF st_line_type,
BEGIN OF st_link,
descript TYPE as4text,
title TYPE string,
href TYPE string,
onclick TYPE string,
END OF st_link,
it_link TYPE STANDARD TABLE OF st_link,
BEGIN OF st_mime,
key(4096) TYPE c,
name(4096) TYPE c,
mimetype(128) TYPE c,
mimetype_descript(64) TYPE c,
objtype TYPE c,
class(10) TYPE c,
objid(32) TYPE c,
END OF st_mime,
it_mime TYPE STANDARD TABLE OF st_mime,
BEGIN OF st_o2class_filter,
re_class(10) TYPE c,
prtn_class(10) TYPE c,
END OF st_o2class_filter,
it_o2class_filter TYPE STANDARD TABLE OF st_o2class_filter,
BEGIN OF st_o2content_ascii,
line TYPE sdok_sdat,
END OF st_o2content_ascii,
it_o2content_ascii TYPE STANDARD TABLE OF st_o2content_ascii,
BEGIN OF st_o2content_binary,
line TYPE sdok_sdatx,
END OF st_o2content_binary,
it_o2content_binary TYPE STANDARD TABLE OF st_o2content_binary,
BEGIN OF st_o2file_info,
file_size(12) TYPE n,
binary_flg(1) TYPE c,
first_line(12) TYPE n,
last_line(12) TYPE n,
file_name(255) TYPE c,
mimetype(128) TYPE c,
property(4) TYPE c,
END OF st_o2file_info,
it_o2file_info TYPE STANDARD TABLE OF st_o2file_info,
BEGIN OF st_o2navigation,
start(70) TYPE c,
navrequest(30) TYPE c,
target(70) TYPE c,
END OF st_o2navigation,
it_o2navigation TYPE STANDARD TABLE OF st_o2navigation,
BEGIN OF st_o2pageattr,
aliasname(30) TYPE c,
pardecltyp(1) TYPE n,
typtype(1) TYPE n,
type TYPE rs38l_typ,
text(60) TYPE c,
pardecltyp_flag TYPE flag,
typtype_txt TYPE string,
END OF st_o2pageattr,
it_o2pageattr TYPE STANDARD TABLE OF st_o2pageattr,
BEGIN OF st_o2pageline,
line TYPE char255,
END OF st_o2pageline,
it_o2pageline TYPE STANDARD TABLE OF st_o2pageline,
BEGIN OF st_o2pagpars,
applname(30) TYPE c,
pagekey(70) TYPE c,
compname(30) TYPE c,
version TYPE r3state,
pardecltyp(1) TYPE n,
typtype(1) TYPE n,
type(132) TYPE c,
aliasname(30) TYPE c,
parvalue(132) TYPE c,
text(60) TYPE c,
mark TYPE c,
END OF st_o2pagpars,
it_o2pagpars TYPE STANDARD TABLE OF st_o2pagpars,
BEGIN OF st_o2relation,
objtype(1) TYPE c,
reio_id(32) TYPE c,
re_class(10) TYPE c,
prtn_id(32) TYPE c,
prtn_class(10) TYPE c,
END OF st_o2relation,
it_o2relation TYPE STANDARD TABLE OF st_o2relation,
BEGIN OF st_o2tagatt,
attid(30) TYPE c,
required TYPE flag,
rtexpr TYPE flag,
byref TYPE flag,
typtype_txt TYPE string,
type(132) TYPE c,
defval(30) TYPE c,
bindable TYPE flag,
descript(60) TYPE c,
END OF st_o2tagatt,
it_o2tagatt TYPE STANDARD TABLE OF st_o2tagatt,
BEGIN OF st_pack_intf,
intf_name TYPE scomifnam,
forsys TYPE as4text,
descript TYPE as4text,
END OF st_pack_intf,
it_pack_intf TYPE STANDARD TABLE OF st_pack_intf,
BEGIN OF st_pack_perm,
pack_name TYPE packname,
intf_name TYPE scomifnam,
err_sever TYPE as4text,
END OF st_pack_perm,
it_pack_perm TYPE STANDARD TABLE OF st_pack_perm,
BEGIN OF st_pack_sub,
devclass TYPE packname,
ctext TYPE as4text,
END OF st_pack_sub,
it_pack_sub TYPE STANDARD TABLE OF st_pack_sub,
BEGIN OF st_parameter,
name TYPE string,
typing TYPE string,
structure TYPE string,
defvalue TYPE string,
optional TYPE flag,
passvalue TYPE flag,
stext TYPE string,
ltext TYPE string,
ltext_onclick TYPE string,
ltext_doku_obj TYPE doku_obj,
END OF st_parameter,
it_parameter TYPE STANDARD TABLE OF st_parameter,
BEGIN OF st_prop,
name(5) TYPE c,
value(40) TYPE c,
END OF st_prop,
it_prop TYPE STANDARD TABLE OF st_prop,
BEGIN OF st_properties,
superclass TYPE seoclsref,
check_model_inh TYPE seostatf1c,
descript TYPE seodescr,
creatable TYPE ddtext,
clsfinal TYPE seofinal,
END OF st_properties,
BEGIN OF st_ref_seoalias,
cpdname TYPE seocpdname,
cmptype TYPE seocmptype,
type TYPE string,
refcmpname TYPE seocmpname,
exposure TYPE string,
owner TYPE seoclsname,
END OF st_ref_seoalias,
it_ref_seoalias TYPE STANDARD TABLE OF st_ref_seoalias,
BEGIN OF st_ref_seoattrib,
cpdname TYPE seocpdname,
inherited TYPE flag,
exposure TYPE string,
check_model TYPE flag,
decltype TYPE string,
attrdonly TYPE seordonly,
typtype TYPE string,
type TYPE rs38l_typ,
onclick TYPE string,
typelink TYPE string,
descript TYPE seodescr,
attvalue TYPE seovalue,
owner TYPE seoclsname,
END OF st_ref_seoattrib,
it_ref_seoattrib TYPE STANDARD TABLE OF st_ref_seoattrib,
BEGIN OF st_ref_seoevent,
cpdname TYPE seocpdname,
inherited TYPE flag,
type TYPE string,
exposure TYPE string,
check_model TYPE flag,
descript TYPE seodescr,
owner TYPE seoclsname,
END OF st_ref_seoevent,
it_ref_seoevent TYPE STANDARD TABLE OF st_ref_seoevent,
BEGIN OF st_ref_seofriends,
refclsname TYPE seoclsname,
check_model TYPE boolean,
descript TYPE seodescr,
END OF st_ref_seofriends,
it_ref_seofriends TYPE STANDARD TABLE OF st_ref_seofriends,
BEGIN OF st_ref_seointerface,
refclsname TYPE seoclsname,
hierlevel TYPE i,
inherited TYPE flag,
impfinal TYPE flag,
impabstrct TYPE flag,
check_model TYPE flag,
descript TYPE seodescr,
owner TYPE seoclsname,
END OF st_ref_seointerface,
it_ref_seointerface TYPE STANDARD TABLE OF st_ref_seointerface,
BEGIN OF st_ref_seomethod,
cpdname TYPE seocpdname,
inherited TYPE flag,
active TYPE string,
onclick TYPE string,
redefin TYPE flag,
type TYPE string,
exposure TYPE string,
check_model TYPE flag,
methodtype TYPE string,
descript TYPE seodescr,
owner TYPE seoclsname,
END OF st_ref_seomethod,
it_ref_seomethod TYPE STANDARD TABLE OF st_ref_seomethod,
BEGIN OF st_ref_seosignature,
declaration TYPE string,
parameter TYPE string,
type TYPE string,
descript TYPE string,
END OF st_ref_seosignature,
it_ref_seosignature TYPE STANDARD TABLE OF st_ref_seosignature,
BEGIN OF st_ref_seotype,
cpdname TYPE seocpdname,
inherited TYPE flag,
typtype TYPE string,
type TYPE rs38l_typ,
exposure TYPE string,
check_model TYPE flag,
onclick TYPE string,
typelink TYPE string,
descript TYPE seodescr,
owner TYPE seoclsname,
END OF st_ref_seotype,
it_ref_seotype TYPE STANDARD TABLE OF st_ref_seotype,
BEGIN OF st_seo_super_class,
clsname TYPE seoclsname,
hierlevel TYPE i,
END OF st_seo_super_class,
it_seo_super_class TYPE STANDARD TABLE OF st_seo_super_class,
BEGIN OF st_skwf_error,
id(20) TYPE c,
type TYPE c,
no(3) TYPE n,
v1(50) TYPE c,
v2(50) TYPE c,
v3(50) TYPE c,
v4(50) TYPE c,
END OF st_skwf_error,
BEGIN OF st_skwf_io,
objtype TYPE c,
class(10) TYPE c,
objid(32) TYPE c,
END OF st_skwf_io,
it_skwf_io TYPE STANDARD TABLE OF st_skwf_io,
it_string TYPE STANDARD TABLE OF string,
BEGIN OF st_t100ext,
name TYPE syuname,
name_text TYPE ad_namtext,
datum TYPE sydatum,
datum_text TYPE string,
object_name TYPE doku_obj,
selfdef TYPE doku_selfd,
no_docu TYPE flag,
ltext TYPE string,
ltext_onclick TYPE string,
END OF st_t100ext,
it_t100ext TYPE STANDARD TABLE OF st_t100ext,
BEGIN OF st_table_structure,
id TYPE char10,
row_nr(3) TYPE n,
fieldname TYPE fieldname,
title_elem TYPE fieldname,
link_row TYPE fieldname,
row_def TYPE char1,
colored_row TYPE fieldname,
comparator TYPE char2,
comp_value TYPE char30,
title TYPE as4text,
END OF st_table_structure,
it_table_structure TYPE STANDARD TABLE OF st_table_structure,
BEGIN OF st_tables,
primary TYPE flag,
tabname TYPE tabname,
enqmode TYPE string,
END OF st_tables,
it_tables TYPE STANDARD TABLE OF st_tables,
BEGIN OF st_tabname,
tabname TYPE tabname,
END OF st_tabname,
it_tabname TYPE STANDARD TABLE OF st_tabname,
BEGIN OF st_tabstrip,
form TYPE fieldname,
id(100) TYPE c,
parent_id(100) TYPE c,
tab_nr(2) TYPE n,
firstrow TYPE flag,
active_order(1) TYPE n,
text_elem TYPE char30,
comparator TYPE char2,
comp_value TYPE char30,
active TYPE flag,
disabled TYPE flag,
hidden TYPE flag,
empty TYPE flag,
text TYPE as4text,
END OF st_tabstrip,
it_tabstrip TYPE STANDARD TABLE OF st_tabstrip,
BEGIN OF st_text_element,
fieldname TYPE fieldname,
txt_prefix TYPE char30,
dtel_rollname TYPE rollname,
dtel_field TYPE c,
domname TYPE char30,
domvalue(10) TYPE c,
icon_id TYPE icon_d,
icon_field TYPE c,
conc_v1 TYPE fieldname,
conc_copula(20) TYPE c,
conc_v2 TYPE fieldname,
conc_sep_space TYPE flag,
msg_id(20) TYPE c,
msg_nr(3) TYPE n,
msg_v1 TYPE fieldname,
msg_v2 TYPE fieldname,
msg_v3 TYPE fieldname,
msg_v4 TYPE fieldname,
is_set TYPE flag,
END OF st_text_element,
it_text_element TYPE STANDARD TABLE OF st_text_element,
BEGIN OF st_text_element_t,
fieldname TYPE fieldname,
spras TYPE spras,
text TYPE as4text,
END OF st_text_element_t,
it_text_element_t TYPE STANDARD TABLE OF st_text_element_t,
BEGIN OF st_textinput,
space TYPE flag,
name TYPE string,
name_suffix TYPE string,
no_name TYPE flag,
value TYPE string,
value_text TYPE string,
value_double_length TYPE flag,
value_ext TYPE string,
value_ext_space TYPE flag,
value_ext_text TYPE string,
description TYPE string,
flag TYPE flag,
input TYPE flag,
has_value_ext TYPE flag,
flag_col TYPE i,
END OF st_textinput,
it_textinput TYPE STANDARD TABLE OF st_textinput,
it_textpool TYPE STANDARD TABLE OF textpool,
BEGIN OF st_textpool_addons,
entry TYPE textpooltx,
strlen TYPE i,
dict_ref TYPE flag,
END OF st_textpool_addons,
it_textpool_addons TYPE STANDARD TABLE OF st_textpool_addons,
it_seotypepls TYPE STANDARD TABLE OF seotypepls,
BEGIN OF st_transaction,
ttype TYPE c,
ttext TYPE ttext_stct,
classname TYPE seoclsname,
method TYPE seocpdname,
pgmna TYPE program_id,
dypno TYPE dynpronr,
repo_vari TYPE raldb_vari,
objct TYPE xuobject,
trframe TYPE eusel_frm,
local TYPE eusel_loc,
ind_vari TYPE tv_flag_ci,
trans_var TYPE eu_trans_v,
def_call_tcode TYPE tcode,
def_skip_1 TYPE eusel_skip,
clf_inhe TYPE s_gui_inhe,
clf_ewt TYPE s_ewt,
clf_profi TYPE s_prof,
clf_pervas TYPE s_pervas,
clf_service TYPE iacservic_,
variant TYPE tcvariant,
END OF st_transaction,
BEGIN OF st_transaction_para,
para_field TYPE eu_para_fn,
para_value TYPE eu_para_vl,
END OF st_transaction_para,
it_transaction_para TYPE STANDARD TABLE OF st_transaction_para,
BEGIN OF st_value_range,
domvalue_l TYPE domvalue_l,
domvalue_h TYPE domvalue_h,
ddtext TYPE ddtext,
END OF st_value_range,
it_value_range TYPE STANDARD TABLE OF st_value_range,
BEGIN OF st_varid,
report TYPE vari_reprt,
vari TYPE variant,
END OF st_varid,
it_varid TYPE STANDARD TABLE OF st_varid,
BEGIN OF st_variant,
program TYPE syrepid,
variant TYPE syslset,
selname TYPE rsscr_name,
text TYPE sychar30,
kind TYPE string,
sign TYPE string,
option TYPE string,
low TYPE tvarv_val,
high TYPE tvarv_val,
END OF st_variant,
it_variant TYPE STANDARD TABLE OF st_variant,
BEGIN OF st_version_info,
type(21) TYPE c,
value(59) TYPE c,
END OF st_version_info,
it_version_info TYPE TABLE OF st_version_info,
BEGIN OF st_zdd03p_ext,
shlporigin_f TYPE flag,
shlporigin_p TYPE flag,
shlporigin_ddtext TYPE string,
END OF st_zdd03p_ext,
it_zdd03p_ext TYPE STANDARD TABLE OF st_zdd03p_ext,
BEGIN OF st_zseomethod,
pgmid TYPE pgmid,
object TYPE trobjtype,
devclass TYPE devclass,
clsname TYPE seoclsname,
cpdname TYPE seocpdname,
active TYPE string,
downloaded TYPE flag,
subrc TYPE sysubrc,
END OF st_zseomethod,
it_zseomethod TYPE STANDARD TABLE OF st_zseomethod,
BEGIN OF st_ztadir,
pgmid TYPE pgmid,
object TYPE trobjtype,
subc TYPE subc,
obj_name TYPE sobj_name,
devclass TYPE devclass,
progname TYPE progname,
futype TYPE char1,
funcname TYPE rs38l_fnam,
o2type TYPE char1,
o2name TYPE string,
o2pagekey TYPE string,
o2pagename TYPE string,
mime_objtype TYPE c,
mime_class(10) TYPE c,
mime_objid(32) TYPE c,
dynpronr TYPE dynpronr,
descript TYPE string,
tabclass TYPE tabclass,
aggtype TYPE aggtype,
masterlang TYPE masterlang,
downloaded TYPE flag,
subrc TYPE sysubrc,
END OF st_ztadir,
it_ztadir TYPE STANDARD TABLE OF st_ztadir.
DATA:
gt_src TYPE it_abapsource.
CONSTANTS:
gc_separator TYPE c VALUE ';',
gc_include_csv_name TYPE progname VALUE 'ZSOFTCOPY_CSV',
gc_include_csv_title TYPE repti VALUE 'SoftCopy - CSV',
gc_include_txt_name TYPE progname VALUE 'ZSOFTCOPY_TEXT',
gc_include_txt_title TYPE repti VALUE 'SoftCopy - TEXT'.
PERFORM make.
*&---------------------------------------------------------------------*
*& Include ZUTIL_CONVERT_TEXT *
*& *
*&---------------------------------------------------------------------*
*& *
*& This file is part of ZUTIL. *
*& *
*& ZUTIL is free software: you can redistribute it and/or modify *
*& it under the terms of the GNU General Public License as published *
*& by the Free Software Foundation, either version 3 of the License, *
*& or any later version. *
*& *
*& ZUTIL is distributed in the hope that it will be useful, *
*& but WITHOUT ANY WARRANTY; without even the implied warranty of *
*& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
*& GNU General Public License for more details. *
*& *
*& You should have received a copy of the GNU General Public License *
*& along with ZUTIL. If not, see . *
*& *
*&---------------------------------------------------------------------*
*& *
*& Author: Ruediger von Creytz ruediger.creytz@globalbit.net *
*& Copyright: globalBIT, LLC http://www.globalbit.net *
*& *
*&---------------------------------------------------------------------*
*-----------------------------------------------------------------------
* decode_html
*-----------------------------------------------------------------------
FORM decode_html
CHANGING
c_txt TYPE any.
DATA:
l_xstr TYPE xstring,
l_hex TYPE string,
l_xpos TYPE i,
l_str TYPE string,
l_fdpos TYPE i,
l_strlen TYPE i,
l_out TYPE string,
l_outlen TYPE i,
l_char TYPE string.
CHECK NOT c_txt IS INITIAL.
CHECK c_txt CS ''.
l_str = c_txt.
DO.
IF l_str CS ''.
l_fdpos = sy-fdpos.
IF l_fdpos > 0.
CONCATENATE l_out+0(l_outlen) l_str+0(l_fdpos) INTO l_out.
l_outlen = l_outlen + l_fdpos.
ENDIF.
l_xpos = l_fdpos + 3.
l_strlen = strlen( l_str ).
l_strlen = l_strlen - l_xpos.
l_str = l_str+l_xpos(l_strlen).
SPLIT l_str AT ';' INTO l_hex l_str.
l_xstr = l_hex.
CALL FUNCTION 'NLS_STRING_CONVERT_TO_SYS'
EXPORTING
lang_used = sy-langu
SOURCE = l_xstr
IMPORTING
RESULT = l_char
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
CONCATENATE l_out+0(l_outlen) l_char+0(1) INTO l_out.
ELSE.
CONCATENATE l_out+0(l_outlen) '#' INTO l_out.
ENDIF.
l_outlen = l_outlen + 1.
ELSE.
EXIT.
ENDIF.
ENDDO.
l_strlen = strlen( l_str ).
CONCATENATE l_out+0(l_outlen) l_str+0(l_strlen) INTO l_out.
c_txt = l_out.
ENDFORM. "decode_html
*-----------------------------------------------------------------------
* decode_html_io
*-----------------------------------------------------------------------
FORM decode_html_io
USING
i_html TYPE string
CHANGING
c_txt TYPE any.
c_txt = i_html.
PERFORM decode_html
CHANGING
c_txt.
ENDFORM. "decode_html_io
*-----------------------------------------------------------------------
* encode_html
*-----------------------------------------------------------------------
FORM encode_html
CHANGING
c_txt TYPE string.
CHECK NOT c_txt IS INITIAL.
CHECK c_txt NS ''.
PERFORM encode_html_force
CHANGING c_txt.
ENDFORM. "encode_html
*-----------------------------------------------------------------------
* encode_html_force
*-----------------------------------------------------------------------
FORM encode_html_force
CHANGING
c_txt TYPE string.
DATA:
l_xstr TYPE xstring,
l_hex TYPE string,
l_hexlen TYPE i,
l_xlen TYPE i,
l_xpos TYPE i,
l_str TYPE string,
l_strlen TYPE i,
l_out TYPE string,
l_outlen TYPE i,
l_pos TYPE i,
l_chars(255) TYPE c,
l_xchar(4) TYPE c.
CHECK NOT c_txt IS INITIAL.
CONCATENATE "characters not to encode
' :;,./()-_+*#='
'0123456789'
'abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
INTO l_chars.
l_str = c_txt.
CALL FUNCTION 'NLS_STRING_CONVERT_FROM_SYS'
EXPORTING
lang_used = sy-langu
SOURCE = l_str
IMPORTING
RESULT = l_xstr.
l_hex = l_xstr.
l_hexlen = strlen( l_hex ).
l_strlen = strlen( l_str ).
l_xlen = l_hexlen / l_strlen.
DO.
l_xpos = l_pos * l_xlen.
l_xchar = l_hex+l_xpos(l_xlen).
IF l_chars NA l_str+l_pos(1)
AND NOT l_xchar = '23'.
IF l_outlen = 0.
CONCATENATE '' l_xchar ';' INTO l_out.
ELSE.
CONCATENATE l_out+0(l_outlen) '' l_xchar ';'
INTO l_out.
ENDIF.
l_outlen = l_outlen + 4 + l_xlen.
ELSE.
IF l_outlen = 0.
l_out = l_str+l_pos(1).
ELSE.
CONCATENATE l_out+0(l_outlen) l_str+l_pos(1) INTO l_out.
ENDIF.
l_outlen = l_outlen + 1.
ENDIF.
l_pos = l_pos + 1.
l_strlen = strlen( l_str ).
IF l_pos = l_strlen.
EXIT.
ENDIF.
ENDDO.
c_txt = l_out.
ENDFORM. "encode_html_force
*-----------------------------------------------------------------------
* form: encode_uri
*-----------------------------------------------------------------------
FORM encode_uri
CHANGING
c_url TYPE string.
DATA:
l_prot TYPE string,
l_url TYPE string,
l_params TYPE string,
lt_param TYPE it_string,
l_key TYPE string,
l_value TYPE string,
l_len TYPE i.
FIELD-SYMBOLS:
TYPE string.
CHECK NOT c_url IS INITIAL.
IF c_url CA '?' OR c_url NA '='.
SPLIT c_url AT '?' INTO l_url l_params.
IF l_url CA ':'.
SPLIT l_url AT ':' INTO l_prot l_url.
ENDIF.
PERFORM encode_uri_link CHANGING l_url.
IF NOT l_prot IS INITIAL.
CONCATENATE l_prot ':' l_url INTO l_url.
ENDIF.
CONCATENATE l_url '?' INTO l_url.
ELSEIF c_url CA '='.
l_params = c_url.
ENDIF.
SPLIT l_params AT '&' INTO TABLE lt_param.
LOOP AT lt_param ASSIGNING .
CLEAR: l_key, l_value.
SPLIT AT '=' INTO l_key l_value.
PERFORM encode_uri_value CHANGING l_value.
CONCATENATE l_url l_key '=' l_value '&' INTO l_url.
ENDLOOP.
l_len = strlen( l_url ).
l_len = l_len - 1. "remove last '&'
c_url = l_url+0(l_len).
ENDFORM. "encode_uri
*-----------------------------------------------------------------------
* form: encode_uri_link
*-----------------------------------------------------------------------
FORM encode_uri_link
CHANGING
c_value TYPE string.
DATA:
l_chars(66) TYPE c.
CHECK NOT c_value IS INITIAL.
CONCATENATE "characters not to encode
'/_-.'
'0123456789'
'abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
INTO l_chars.
PERFORM encode_uri_string
USING l_chars
CHANGING c_value.
ENDFORM. "encode_uri_link
*-----------------------------------------------------------------------
* form: encode_uri_string
*-----------------------------------------------------------------------
FORM encode_uri_string
USING
value(i_chars)
CHANGING
c_value TYPE string.
DATA:
l_xstr TYPE xstring,
l_hex TYPE string,
l_hexlen TYPE i,
l_chex TYPE string,
l_chex_pos TYPE i,
l_xlen TYPE i,
l_xpos TYPE i,
l_str TYPE string,
l_strlen TYPE i,
l_out TYPE string,
l_outlen TYPE i,
l_pos TYPE i.
CHECK NOT c_value IS INITIAL.
l_str = c_value.
CALL FUNCTION 'NLS_STRING_CONVERT_FROM_SYS'
EXPORTING
lang_used = sy-langu
SOURCE = l_str
IMPORTING
RESULT = l_xstr.
l_hex = l_xstr.
l_hexlen = strlen( l_hex ).
l_strlen = strlen( l_str ).
l_xlen = l_hexlen / l_strlen.
DO.
IF i_chars NA l_str+l_pos(1).
l_xpos = l_pos * l_xlen.
l_chex = l_hex+l_xpos(l_xlen).
l_chex_pos = strlen( l_chex ).
l_chex_pos = l_chex_pos - 2.
l_chex = l_chex+l_chex_pos(2).
IF l_outlen = 0.
CONCATENATE '%' l_chex INTO l_out.
ELSE.
CONCATENATE l_out+0(l_outlen) '%' l_chex
INTO l_out.
ENDIF.
l_outlen = l_outlen + 3.
ELSE.
IF l_outlen = 0.
l_out = l_str+l_pos(1).
ELSE.
CONCATENATE l_out+0(l_outlen) l_str+l_pos(1) INTO l_out.
ENDIF.
l_outlen = l_outlen + 1.
ENDIF.
l_pos = l_pos + 1.
l_strlen = strlen( l_str ).
IF l_pos = l_strlen.
EXIT.
ENDIF.
ENDDO.
c_value = l_out.
ENDFORM. "encode_uri_string
*-----------------------------------------------------------------------
* form: encode_uri_value
*-----------------------------------------------------------------------
FORM encode_uri_value
CHANGING
c_value TYPE string.
DATA:
l_chars(62) TYPE c.
CHECK NOT c_value IS INITIAL.
CONCATENATE "characters not to encode
'0123456789'
'abcdefghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
INTO l_chars.
PERFORM encode_uri_string
USING l_chars
CHANGING c_value.
ENDFORM. "encode_uri_value
*-----------------------------------------------------------------------
* make
*-----------------------------------------------------------------------
FORM make.
DATA:
l_subrc_csv TYPE string,
l_subrc_txt TYPE string,
l_infoline(80) TYPE c.
PERFORM add_report_begin
USING gc_include_csv_name
CHANGING gt_src.
PERFORM csv_table_structure.
PERFORM csv_tabstrip.
PERFORM csv_text_elements
CHANGING
l_subrc_txt.
PERFORM csv_varid_broken.
PERFORM add_report_end
CHANGING gt_src.
PERFORM save
USING
gc_include_csv_name
gc_include_txt_title
gt_src
CHANGING
l_subrc_csv.
IF l_subrc_csv = 0 AND l_subrc_txt = 0.
CONCATENATE
'created ZSOFTCOPY_CSV'
' and ZSOFTCOPY_TEXT successfully'
INTO l_infoline.
ELSE.
CONCATENATE
'created ZSOFTCOPY_CSV with subrc=' l_subrc_csv
' and ZSOFTCOPY_TXT with subrc=' l_subrc_txt
INTO l_infoline.
ENDIF.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = l_infoline.
WAIT UP TO 5 SECONDS.
ENDFORM. "make
*-----------------------------------------------------------------------
* add_csv_line
*-----------------------------------------------------------------------
FORM add_csv_line
USING
value(i_str)
CHANGING
c_counter TYPE i.
DATA:
ls_src TYPE abapsource,
l_length TYPE i,
l_str TYPE string,
l_strlen TYPE i,
l_cnt TYPE i VALUE 0.
CONSTANTS:
lc_length_content TYPE i VALUE 68.
IF c_counter = 100.
PERFORM add_form_middle.
c_counter = 0.
ENDIF.
l_strlen = strlen( i_str ).
IF l_strlen > lc_length_content.
CONCATENATE '''' i_str+0(lc_length_content) ''''
INTO ls_src-line.
APPEND ls_src TO gt_src.
l_length = strlen( i_str ) - lc_length_content.
l_str = i_str+lc_length_content(l_length).
PERFORM add_csv_line
USING l_str
CHANGING l_cnt.
ELSE.
CONCATENATE '''' i_str '|''' INTO ls_src-line.
APPEND ls_src TO gt_src.
ENDIF.
c_counter = c_counter + 1.
ENDFORM. "add_csv_line
*-----------------------------------------------------------------------
* add_form_begin
*-----------------------------------------------------------------------
FORM add_form_begin
USING
value(i_name).
DATA:
ls_src TYPE abapsource.
CONCATENATE 'form' i_name
INTO ls_src-line SEPARATED BY space.
APPEND ls_src TO gt_src.
ls_src-line = 'changing ct_csv type it_string.'.
APPEND ls_src TO gt_src.
ls_src-line = 'refresh ct_csv.'.
APPEND ls_src TO gt_src.
ls_src-line = 'data ls_csv type string.'.
APPEND ls_src TO gt_src.
ls_src-line = 'concatenate'.
APPEND ls_src TO gt_src.
ENDFORM. "add_form_begin
*-----------------------------------------------------------------------
* add_form_end
*-----------------------------------------------------------------------
FORM add_form_end
USING
value(i_name).
DATA:
ls_src TYPE abapsource.
ls_src-line = 'space into ls_csv.'.
APPEND ls_src TO gt_src.
ls_src-line = 'append ls_csv to ct_csv.'.
APPEND ls_src TO gt_src.
CONCATENATE 'endform. "' i_name INTO ls_src-line.
APPEND ls_src TO gt_src.
ENDFORM. "add_form_end
*-----------------------------------------------------------------------
* add_form_middle
*-----------------------------------------------------------------------
FORM add_form_middle.
DATA:
ls_src TYPE abapsource.
ls_src-line = 'space into ls_csv.'.
APPEND ls_src TO gt_src.
ls_src-line = 'append ls_csv to ct_csv.'.
APPEND ls_src TO gt_src.
ls_src-line = 'concatenate'.
APPEND ls_src TO gt_src.
ENDFORM. "add_form_end
*-----------------------------------------------------------------------
* add_report_begin
*-----------------------------------------------------------------------
FORM add_report_begin
USING
value(i_name) TYPE progname
CHANGING
ct_src TYPE it_abapsource.
DATA:
ls_src TYPE abapsource.
REFRESH ct_src.
CONCATENATE
'*&-----------------------------'
'----------------------------------------*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
CLEAR ls_src.
ls_src-line+0(11) = '*& Include'.
ls_src-line+21(30) = i_name.
ls_src-line+71(1) = '*'.
APPEND ls_src TO ct_src.
CONCATENATE
'*&-----------------------------'
'----------------------------------------*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
CONCATENATE
'*&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
CONCATENATE
'*&!!!!!!!!!!! generated by ZSOFT'
'COPY_MAKE !!!!! do not edit !!!!!!!!!!!*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
CONCATENATE
'*&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
CONCATENATE
'*&------------------------------'
'---------------------------------------*'
INTO ls_src-line.
APPEND ls_src TO ct_src.
ENDFORM. "add_report_begin
*-----------------------------------------------------------------------
* add_report_end
*-----------------------------------------------------------------------
FORM add_report_end
CHANGING
ct_src TYPE it_abapsource.
* nothing to do
ENDFORM. "add_report_end
*-----------------------------------------------------------------------
* csv_table_structure
*-----------------------------------------------------------------------
FORM csv_table_structure.
DATA:
lt_table TYPE STANDARD TABLE OF zsoftcopy_table,
l_line TYPE string,
l_cnt TYPE i VALUE 0.
FIELD-SYMBOLS:
TYPE zsoftcopy_table.
CONSTANTS:
lc_name TYPE fieldname VALUE 'csv_table_structure'.
PERFORM add_form_begin USING lc_name.
SELECT * FROM zsoftcopy_table INTO TABLE lt_table
ORDER BY id column_nr.
LOOP AT lt_table ASSIGNING .
CONCATENATE
-id gc_separator
-column_nr gc_separator
-fieldname gc_separator
-title_elem gc_separator
-link_column gc_separator
-column_def gc_separator
-colored_column gc_separator
-comparator gc_separator
-comp_value
INTO l_line.
PERFORM add_csv_line
USING l_line
CHANGING l_cnt.
ENDLOOP.
PERFORM add_form_end USING lc_name.
ENDFORM. "csv_table_structure
*-----------------------------------------------------------------------
* csv_tabstrip
*-----------------------------------------------------------------------
FORM csv_tabstrip.
DATA:
lt_strip TYPE STANDARD TABLE OF zsoftcopy_strip,
l_line TYPE string,
l_cnt TYPE i VALUE 0.
FIELD-SYMBOLS:
TYPE zsoftcopy_strip.
CONSTANTS:
lc_name TYPE fieldname VALUE 'csv_tabstrip'.
PERFORM add_form_begin USING lc_name.
SELECT * FROM zsoftcopy_strip INTO TABLE lt_strip
ORDER BY form tab_nr.
LOOP AT lt_strip ASSIGNING .
CONCATENATE
-form gc_separator
-id gc_separator
-parent_id gc_separator
-tab_nr gc_separator
-firstrow gc_separator
-active_order gc_separator
-text_elem gc_separator
-comparator gc_separator
-comp_value
INTO l_line.
PERFORM add_csv_line
USING l_line
CHANGING l_cnt.
ENDLOOP.
PERFORM add_form_end USING lc_name.
ENDFORM. "csv_table_structure
*-----------------------------------------------------------------------
* csv_text_elements
*-----------------------------------------------------------------------
FORM csv_text_elements
CHANGING
c_subrc TYPE string.
DATA:
lt_txt TYPE STANDARD TABLE OF zsoftcopy_text,
lt_txtt TYPE STANDARD TABLE OF zsoftcopy_textt,
l_line TYPE string,
l_text TYPE string,
ls_src TYPE abapsource,
lt_src_txt TYPE it_abapsource,
l_cnt TYPE i VALUE 0.
FIELD-SYMBOLS:
TYPE zsoftcopy_text,
TYPE zsoftcopy_textt.
CONSTANTS:
lc_name_1 TYPE fieldname VALUE 'csv_text_elements_1',
lc_name_2 TYPE fieldname VALUE 'csv_text_elements_2'.
*txt
l_cnt = 0.
PERFORM add_form_begin USING lc_name_1.
SELECT * FROM zsoftcopy_text INTO TABLE lt_txt
ORDER BY fieldname.
LOOP AT lt_txt ASSIGNING .
CONCATENATE
-fieldname gc_separator
-text_prefix gc_separator
-dtel_rollname gc_separator
-dtel_field gc_separator
-domname gc_separator
-domvalue gc_separator
-icon_id gc_separator
-icon_field gc_separator
-conc_v1 gc_separator
-conc_copula gc_separator
-conc_v2 gc_separator
-conc_sep_space gc_separator
-msg_id gc_separator
-msg_nr gc_separator
-msg_v1 gc_separator
-msg_v2 gc_separator
-msg_v3 gc_separator
-msg_v4 gc_separator
INTO l_line.
PERFORM add_csv_line
USING l_line
CHANGING l_cnt.
ENDLOOP.
PERFORM add_form_end USING lc_name_1.
*txtt
l_cnt = 0.
PERFORM add_form_begin USING lc_name_2.
SELECT * FROM zsoftcopy_textt INTO TABLE lt_txtt
ORDER BY fieldname.
LOOP AT lt_txtt ASSIGNING .
l_text = -text.
PERFORM encode_html CHANGING l_text.
CONCATENATE
-fieldname gc_separator
-spras gc_separator
l_text
INTO l_line.
PERFORM add_csv_line
USING l_line
CHANGING l_cnt.
ENDLOOP.
PERFORM add_form_end USING lc_name_2.
*params
PERFORM add_report_begin
USING gc_include_txt_name
CHANGING lt_src_txt.
* constants
CONCATENATE 'constants gc_version type sydatum value '''
sy-datum '''.'
INTO ls_src-line.
APPEND ls_src TO lt_src_txt.
* texts
LOOP AT lt_txt ASSIGNING .
AT FIRST.
ls_src-line = 'data:'.
APPEND ls_src TO lt_src_txt.
ENDAT.
CONCATENATE -fieldname 'type string'
INTO ls_src-line SEPARATED BY space.
AT LAST.
CONCATENATE ls_src-line '.' INTO ls_src-line.
APPEND ls_src TO lt_src_txt.
EXIT.
ENDAT.
CONCATENATE ls_src-line ',' INTO ls_src-line.
APPEND ls_src TO lt_src_txt.
ENDLOOP.
PERFORM add_report_end
CHANGING lt_src_txt.
PERFORM save
USING
gc_include_txt_name
gc_include_txt_title
lt_src_txt
CHANGING
c_subrc.
ENDFORM. "csv_text_elements
*-----------------------------------------------------------------------
* csv_varid_broken
*-----------------------------------------------------------------------
FORM csv_varid_broken.
DATA:
lt_varid TYPE STANDARD TABLE OF zsoftcopy_varid,
l_line TYPE string,
l_cnt TYPE i VALUE 0.
FIELD-SYMBOLS:
TYPE zsoftcopy_varid.
CONSTANTS:
l_c_name TYPE fieldname VALUE 'csv_varid_broken'.
PERFORM add_form_begin USING l_c_name.
SELECT * FROM zsoftcopy_varid INTO TABLE lt_varid.
LOOP AT lt_varid ASSIGNING .
CONCATENATE
-report gc_separator
-vari
INTO l_line.
PERFORM add_csv_line
USING l_line
CHANGING l_cnt.
ENDLOOP.
PERFORM add_form_end USING l_c_name.
ENDFORM. "csv_varid_broken
*-----------------------------------------------------------------------
* save
*-----------------------------------------------------------------------
FORM save
USING
value(i_progname) TYPE progname
value(i_title) TYPE repti
i_it_abapsource TYPE it_abapsource
CHANGING
c_subrc TYPE string.
CALL FUNCTION 'BC_PR_INSERT'
EXPORTING
program_name = i_progname
program_type = 'I'
title_string = i_title
TABLES
SOURCE = i_it_abapsource
EXCEPTIONS
already_exists = 1
cancelled = 2
name_not_allowed = 3
permission_error = 4
OTHERS = 5.
IF sy-subrc = 1.
CALL FUNCTION 'BC_PR_UPDATE'
EXPORTING
program_name = i_progname
TABLES
SOURCE = i_it_abapsource
EXCEPTIONS
not_exists = 6
cancelled = 7
name_not_allowed = 8
permission_error = 9
object_is_inactive = 10
wrong_user = 11
OTHERS = 12.
ENDIF.
c_subrc = sy-subrc.
ENDFORM. "save