Posted: Sun Dec 30, 2007 12:08 am Post subject: SAP R/3 ABAP/DDIC down-and upload program in XML
1. Download Classes, Interfaces, Functiongroups, Programs, DDIC into PC files in XML-Format
2. Upload a single XML file or the file file_index.xml
The index file file_index.xml contains a list of XML-Files
*$*$ ******** Please do not remove this copyright notice, thank you ****
*$*$ Shareware program by
*$*$ Ulrich Streit (c) 2006
*$*$ Multisoft GmbH
*$*$ Talainstr. 1
*$*$ D-97267 Himmelstadt, Germany
*$*$ email: [email protected]
*$*$ http://www.multisoft-expert.de
*$*$
*$*$ and
*$*$
*$*$ Axel Angeli (c) 2006
*$*$ Logos! Informatik GmbH
*$*$ Bruehler Strasse 21
*$*$ D-68782 Bruehl, Germany
*$*$ email: [email protected]
*$*$ http://idocs.de and http://logosworld.com
*$*$
************************************************************************
*$*$ Down- and Upload program
************************************************************************
*$*$*
*$*$* The program is only tested on SAP Web AS 6.2
*$*$* Upload of classes does not work in newer/older versions of the
*$*$* ABAP Workbench
*$*$* Function modules must have line size 72
*$*$*
*$*$* Beta Version
*$*$*
*$*$* 1. Download Classes, Interfaces, Functiongroups, Programs, DDIC
*$*$* into PC files in XML-Format
*$*$* 2. Upload a single XML file or the file file_index.xml
*$*$* The index file file_index.xml contains a list of XML-Files
*$*$*
*$*$* Upload: - Parameter postfix is ignored for DDIC objects.
*$*$*
*$*$* Download: - Please activate before downloading.
*$*$* - Maximum size of a single XML-File: 7MB
*$*$* ( constant c_size_max_xml )
*$*$* - if you download in several XML-files, the file
*$*$* file_index.xml is created automatically
*$*$* You can upload a single XML-File or the file
*$*$* file_index.xml
*$*$*
************************************************************************
REPORT ZLOMU_DOWN_UP_ABAP_X001 line-size 1023.
* Types zum Up- und Download von Klassen
Types: begin of TYMETHOD,
CMPKEY type SEOCMPKEY,
METHOD type line of SEOO_METHODS_R,
METHOD_DETAILS type SEOO_METHOD_DETAILS,
PARAMETERS type SEOS_PARAMETERS_R,
EXCEPTIONS type SEOS_EXCEPTIONS_R,
INCNAME type PROGRAM,
SOURCE type SEOP_SOURCE,
end of TYMETHOD.
types: begin of TIMPLMETHOD,
method TYPE VSEOMETHOD,
ALIAS TYPE line of SEO_ALIASES,
include type line of SEOP_METHODS_W_INCLUDE,
SOURCE type SEOP_SOURCE,
end of TIMPLMETHOD.
types: begin of TREDEFINITION,
method TYPE VSEOMETHOD,
include type line of SEOP_METHODS_W_INCLUDE,
SOURCE type SEOP_SOURCE,
end of TREDEFINITION.
types: begin of tsection,
LIMU TYPE TROBJTYPE,
INCNAME type PROGRAM,
source type seop_source,
end of tsection.
types: begin of ttypes,
TYPES type SEOO_TYPES_R,
TYPE_SOURCE type seop_source,
end of ttypes.
types: begin of TIMPLEMENTINGS,
IMPLEMENTINGS TYPE SEOR_IMPLEMENTINGS_R,
IMPL_DETAILS TYPE SEO_REDEFINITIONS,
end of TIMPLEMENTINGS.
types: begin of tLocal,
name(3),
source_locals type seop_source,
end of tLocal.
types tlocals type standard table of tLocal WITH NON-UNIQUE DEFAULT KEY.
* Klasse
types: begin of tCLASS,
CIFKEY type SEOCLSKEY,
CLASS type vseoclass,
ATTRIBUTES type SEOO_ATTRIBUTES_R,
sections type standard table of tsection
WITH NON-UNIQUE DEFAULT KEY,
METHODS type standard table of TYMETHOD
WITH NON-UNIQUE DEFAULT KEY,
TYPES type ttypes,
TYPEPUSAGES TYPE SEOT_TYPEPUSAGES_R,
EVENTS TYPE SEOO_EVENTS_R,
Friends TYPE SEOF_FRIENDSHIPS_R,
ALIASES TYPE SEO_ALIASES,
implementings type timplementings,
METHODS_IMPL type standard table of TIMPLMETHOD
WITH NON-UNIQUE DEFAULT KEY,
INHERITANCE TYPE SEOR_INHERITANCE_R,
EXPLORE_INHERITANCE TYPE standard table of vseoclass
WITH NON-UNIQUE DEFAULT KEY,
REDEFINITIONS TYPE SEOR_REDEFINITIONS_R,
METHODS_REDEF type standard table of TREDEFINITION
WITH NON-UNIQUE DEFAULT KEY,
CLASSDEFERREDS TYPE SEOT_CLSDEFERRDS_R,
INTERFACEDEFERREDS TYPE SEOT_INTDEFERRDS_R,
LOCALS type tLocals,
end of tCLASS.
* Interface
types: begin of tinter,
INTKEY TYPE SEOCLSKEY,
INTERFACE TYPE VSEOINTERF,
ATTRIBUTES TYPE SEOO_ATTRIBUTES_R,
METHODS TYPE SEOO_METHODS_R,
EVENTS TYPE SEOO_EVENTS_R,
PARAMETERS TYPE SEOS_PARAMETERS_R,
EXCEPS TYPE SEOS_EXCEPTIONS_R,
COMPRISINGS TYPE SEOR_COMPRISINGS_R,
TYPEPUSAGES TYPE SEOT_TYPEPUSAGES_R,
CLSDEFERRDS TYPE SEOT_CLSDEFERRDS_R,
INTDEFERRDS TYPE SEOT_INTDEFERRDS_R,
EXPLORE_COMPRISINGS TYPE SEOK_INT_TYPEINFOS,
ALIASES TYPE SEOO_ALIASES_R,
end of tinter.
* Dynpros
types: begin of tdynpro,
PROGNAME TYPE D020S-PROG,
DYNNR TYPE D020S-DNUM,
HEADER TYPE RPY_DYHEAD,
CONTAINERS type DYCATT_TAB,
FIELDS_TO_CONTAINERS type DYFATC_TAB,
FLOW_LOGIC type standard table of RPY_DYFLOW
WITH NON-UNIQUE DEFAULT KEY,
PARAMS type standard table of RPY_DYPARA
WITH NON-UNIQUE DEFAULT KEY,
end of tdynpro.
types: tdynpros type standard table of tdynpro
WITH NON-UNIQUE DEFAULT KEY.
* Funktionsgruppen
types: begin of tfmodule,
funcname type enlfdir-funcname,
area type enlfdir-area,
GLOBAL_FLAG type RS38L-GLOBAL,
REMOTE_CALL type RS38L-REMOTE,
UPDATE_TASK type RS38L-UTASK,
SHORT_TEXT type TFTIT-STEXT,
t_import type standard table of rsimp
WITH NON-UNIQUE DEFAULT KEY,
t_change type standard table of rscha
WITH NON-UNIQUE DEFAULT KEY,
t_export type standard table of rsexp
WITH NON-UNIQUE DEFAULT KEY,
t_tables type standard table of rstbl
WITH NON-UNIQUE DEFAULT KEY,
t_except type standard table of rsexc
WITH NON-UNIQUE DEFAULT KEY,
source type seop_source,
end of tfmodule.
types: tfmodules type standard table of tfmodule
WITH NON-UNIQUE DEFAULT KEY.
types: begin of tinclude,
include type rseuinc-include,
source type seop_source,
end of tinclude.
types: tincludes type standard table of tinclude
WITH NON-UNIQUE DEFAULT KEY.
types: begin of tfgroup,
area type enlfdir-area,
includes type tincludes,
fmodules type tfmodules,
dynpros type tdynpros,
end of tfgroup.
types: begin of ttextpool,
langu type sy-langu,
textpool type standard table of textpool
WITH NON-UNIQUE DEFAULT KEY,
end of ttextpool.
types: begin of tprogram,
name type trdir-name,
subc type trdir-subc,
title type RGLIF-TITLE,
textpool type ttextpool,
PROG_INF TYPE RPY_PROG,
source type seop_source,
dynpros type tdynpros,
end of tprogram.
types: begin of tdomain,
NAME TYPE DDOBJNAME,
GOTSTATE TYPE DDGOTSTATE,
DD01V_WA TYPE DD01V,
DD07V_TAB type standard table of DD07V
WITH NON-UNIQUE DEFAULT KEY,
end of tdomain.
types: begin of tdataelement,
NAME TYPE DDOBJNAME,
GOTSTATE TYPE DDGOTSTATE,
DD04V_WA TYPE DD04V,
TPARA_WA TYPE TPARA,
end of tdataelement.
types: begin of ttable,
name TYPE DDOBJNAME,
tabclass type dd02l-tabclass,
GOTSTATE TYPE DDGOTSTATE,
DD02V_WA TYPE DD02V,
DD09L_WA TYPE DD09V,
DD03P_TAB type standard table of DD03P
WITH NON-UNIQUE DEFAULT KEY,
DD05M_TAB type standard table of DD05M
WITH NON-UNIQUE DEFAULT KEY,
DD08V_TAB type standard table of DD08V
WITH NON-UNIQUE DEFAULT KEY,
DD12V_TAB type standard table of DD12V
WITH NON-UNIQUE DEFAULT KEY,
DD17V_TAB type standard table of DD17V
WITH NON-UNIQUE DEFAULT KEY,
DD35V_TAB type standard table of DD35V
WITH NON-UNIQUE DEFAULT KEY,
DD36M_TAB type standard table of DD36M
WITH NON-UNIQUE DEFAULT KEY,
end of ttable.
types: begin of tview,
name TYPE DDOBJNAME,
GOTSTATE TYPE DDGOTSTATE,
DD25V_WA TYPE DD25V,
DD09L_WA TYPE DD09V,
DD26V_TAB TYPE STANDARD TABLE OF DD26V
WITH NON-UNIQUE DEFAULT KEY,
DD27P_TAB TYPE STANDARD TABLE OF DD27P
WITH NON-UNIQUE DEFAULT KEY,
DD28J_TAB TYPE STANDARD TABLE OF DD28J
WITH NON-UNIQUE DEFAULT KEY,
DD28V_TAB TYPE STANDARD TABLE OF DD28V
WITH NON-UNIQUE DEFAULT KEY,
end of tview.
types: begin of ttabletype,
NAME TYPE DDOBJNAME,
GOTSTATE TYPE DDGOTSTATE,
DD40V_WA TYPE DD40V,
DD42V_TAB TYPE STANDARD TABLE OF DD42V
WITH NON-UNIQUE DEFAULT KEY,
end of ttabletype.
types: begin of tshlp,
NAME TYPE DDOBJNAME,
GOTSTATE TYPE DDGOTSTATE,
DD30V_WA TYPE DD30V,
DD31V_TAB type standard table of DD31V
WITH NON-UNIQUE DEFAULT KEY,
DD32P_TAB type standard table of DD32P
WITH NON-UNIQUE DEFAULT KEY,
DD33V_TAB type standard table of DD33V
WITH NON-UNIQUE DEFAULT KEY,
end of tshlp.
types: begin of ttypegroup,
name type trdir-name,
texts type standard table of DDTYPET
WITH NON-UNIQUE DEFAULT KEY,
source type standard table of abapsource
WITH NON-UNIQUE DEFAULT KEY,
end of ttypegroup.
types: tclasses type standard table of tclass,
tinters type standard table of tinter,
tfgroups type standard table of tfgroup,
tprograms type standard table of tprogram,
tdomains type standard table of tdomain,
ttables type standard table of ttable,
tviews type standard table of tview,
ttabletypes type standard table of ttabletype,
tshlps type standard table of tshlp,
ttypegroups type standard table of ttypegroup.
* Names
types: begin of tdynproname,
PROGNAME TYPE D020S-PROG,
DYNNR TYPE D020S-DNUM,
end of tdynproname.
types: tdynpronames type standard table of tdynproname.
types: begin of TABAP_GLREFS_TAG,
name type string,
GLREF type line of SCR_GLREFS,
tag type SCR_TAG,
end of TABAP_GLREFS_TAG.
types: TABAP_GLREFS_TAGS type standard table of TABAP_GLREFS_TAG.
types: ttadir_table type standard table of tadir.
types: begin of tp,
classes type table of TCLASS
WITH NON-UNIQUE DEFAULT KEY,
inters type table of tinter
WITH NON-UNIQUE DEFAULT KEY,
fgroups type table of tfgroup
WITH NON-UNIQUE DEFAULT KEY,
programs type table of tprogram
WITH NON-UNIQUE DEFAULT KEY,
typegroups type table of ttypegroup
WITH NON-UNIQUE DEFAULT KEY,
tables type table of ttable
WITH NON-UNIQUE DEFAULT KEY,
views type table of tview
WITH NON-UNIQUE DEFAULT KEY,
tabletypes type table of ttabletype
WITH NON-UNIQUE DEFAULT KEY,
searchhelps type table of tshlp
WITH NON-UNIQUE DEFAULT KEY,
dataelements type table of tdataelement
WITH NON-UNIQUE DEFAULT KEY,
domains type table of tdomain
WITH NON-UNIQUE DEFAULT KEY,
end of tp.
* Typdeklaration index-Datei
Types: begin of tindex,
type type seocmpkey-cmpname,
name type SEOCMPKEY-cmpname,
file type localfile,
end of tindex.
* Typdeklaration index-Datei
Types: tindex_table type standard table of tindex.
constants:
C_ch_Class type SEOCMPKEY-cmpname value 'Class',
c_ch_Interface type SEOCMPKEY-cmpname value 'Interface',
c_ch_Fgroup type SEOCMPKEY-cmpname value 'Area',
c_ch_include type SEOCMPKEY-cmpname value 'Include',
c_ch_program type SEOCMPKEY-cmpname value 'Program',
c_ch_domain type SEOCMPKEY-cmpname value 'Domain',
c_ch_delement type SEOCMPKEY-cmpname value 'Dataelement',
c_ch_table type SEOCMPKEY-cmpname value 'Table',
c_ch_viewname type SEOCMPKEY-cmpname value 'View',
c_ch_tabletype type SEOCMPKEY-cmpname value 'Tabletype',
c_ch_searchelp type SEOCMPKEY-cmpname value 'Searchhelp',
c_ch_typegroup type SEOCMPKEY-cmpname value 'Typegroup'.
* TXT-Dateinamen (Source .txt Dateien)
constants: C_ch_Class_method
type SEOCMPKEY-cmpname value 'Class_Method',
C_ch_Class_section
type SEOCMPKEY-cmpname value 'Class_Section',
C_ch_Class_redef
type SEOCMPKEY-cmpname value 'Class_Redef',
C_ch_Class_impl
type SEOCMPKEY-cmpname value 'Class_Impl',
C_ch_Class_locals
type SEOCMPKEY-cmpname value 'Class_Locals',
C_ch_Area_fmodule
type SEOCMPKEY-cmpname value 'Area_Fmodule',
C_ch_Area_Include
type SEOCMPKEY-cmpname value 'Area_Include',
C_ch_Area_Dynpro
type SEOCMPKEY-cmpname value 'Area_Dynpro',
c_ch_Program_Dynpro
type SEOCMPKEY-cmpname value 'Program_Dynpro'.
* Sonstige Konstanten
constants: c_sapl(4) value 'SAPL',
c_z(1) value 'Z',
c_y(1) value 'Y',
c_z%(2) value 'Z%',
c_y%(2) value 'Y%'.
* Konstanten Tadir
constants: c_ta_R3TR(4) value 'R3TR',
c_ta_DOMA(4) value 'DOMA',
c_ta_DTEL(4) value 'DTEL',
c_ta_INTTAB(6) value 'INTTAB',
c_ta_TRANSP(6) value 'TRANSP',
c_ta_APPEND(6) value 'APPEND',
c_ta_tabl(4) value 'TABL',
c_ta_view(4) value 'VIEW',
c_ta_TTYP(4) value 'TTYP',
c_ta_SHLP(4) value 'SHLP',
c_ta_CLAS(4) value 'CLAS',
c_ta_intf(4) value 'INTF',
c_ta_fugr(4) value 'FUGR',
c_ta_prog(4) value 'PROG',
c_ta_type(4) value 'TYPE'.
* XML-Dokument Encoding
constants: c_xml_encoding_utf8 type string value 'UTF-8'.
* Maximale Groesse XML-Datei
constants: c_size_max_xml type sytabix value '7000000'. "7MB
* Index-Datei
constants: c_file_index_xml type localfile value 'FILE_INDEX.XML'.
* Stop the Upload Prcessing
data: gv_flg_stop_upload_processing.
* Makro ERROR
define ERROR.
IF &3 &2 SY-SUBRC.
new-line.
WRITE: 'Error:' color col_negative, '&1.' color col_negative.
ENDIF.
end-of-definition.
* Makro ERROR_MESSAGE
data: error_text1 type sy-msgv1,
error_text2 type sy-msgv2,
length type i.
define ERROR_MESSAGE.
new-line.
WRITE: 'Error:' color col_negative, &1 color col_negative.
clear: error_text1, error_text2.
length = strlen( &1 ).
if length > 0.
length = length / 2.
move error_text(length) to error_text1.
move error_text+length to error_text2.
endif.
if not SY-MSGID is initial.
new-line.
WRITE: 'SY-MSGID' color col_negative,
SY-MSGID color col_negative,
'SY-MSGNO' color col_negative,
SY-MSGNO color col_negative.
if not SY-MSGV1 is initial.
new-line.
write: 'SY-MSGV1' color col_negative,
SY-MSGV1 color col_negative.
endif.
if not SY-MSGV2 is initial.
new-line.
write: 'SY-MSGV2' color col_negative,
SY-MSGV2 color col_negative.
endif.
if not SY-MSGV3 is initial.
new-line.
write: 'SY-MSGV3' color col_negative,
SY-MSGV3 color col_negative.
endif.
if not SY-MSGV4 is initial.
new-line.
write: 'SY-MSGV4' color col_negative,
SY-MSGV4 color col_negative.
endif.
MESSAGE ID SY-MSGID TYPE &2 NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
message ID '38' type &2 NUMBER '000' with error_text1 error_text2.
endif.
skip 1.
end-of-definition.
* Makro result message
define result_message.
* Ausgabe Ergebnis
if &3 eq '0'.
write: &1 color col_positive,
&2 color col_positive,
'created' color col_positive.
new-line.
else.
write: &1 color col_negative,
&2 color col_negative,
'ERROR' color col_negative.
new-line.
endif.
end-of-definition.
* Makro download message
define download_message.
write: &1 color col_positive,
at 25 &2 color col_positive,
at 65 'read successfully' color col_positive.
new-line.
end-of-definition.
**********************************************************************
* Parameter/select-options
**********************************************************************
parameters: download radiobutton group r1 default 'X'.
selection-screen begin of block b with frame.
selection-screen comment 1(23) cdown.
selection-screen uline.
selection-screen begin of line.
selection-screen comment 1(26) csfiles.
parameters: sfiles radiobutton group r2.
selection-screen comment 32(17) cpath.
parameters: path type LOCALFILE.
selection-screen end of line.
selection-screen uline.
selection-screen begin of line.
selection-screen comment 1(26) csave.
parameters: SAVE radiobutton group r2 default 'X'.
selection-screen comment 32(17) cfile.
parameters: PCFILE type LOCALFILE default '.xml'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(11) cdisplay.
parameters: DISPLAY as checkbox default 'X'.
selection-screen comment 22(21) cedit.
parameters: CALLEDIT as checkbox.
selection-screen comment 53(12) dispon.
parameters: DISP_ONL as checkbox.
selection-screen end of line.
selection-screen uline.
selection-screen begin of line.
selection-screen comment 1(26) ctxtfile.
parameters: ctxt as checkbox.
selection-screen comment 32(17) cpath1.
parameters: path1 type LOCALFILE.
selection-screen end of line.
selection-screen uline.
selection-screen begin of line.
selection-screen comment 1(26) ccdata.
parameters: cdata as checkbox default 'X'.
selection-screen end of line.
selection-screen begin of block a with frame title comment.
selection-screen begin of line.
selection-screen comment 1(8) cComp.
parameters: complete radiobutton group c1.
selection-screen comment 18(8) cnosour.
parameters: nosource radiobutton group c1 default 'X'.
selection-screen comment 38(10) cnocr.
parameters: nocross radiobutton group c1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(19) cgrade.
parameters: grade type SCR_GRADE.
selection-screen end of line.
selection-screen end of block a.
select-options: package for tadir-devclass. " memory id lib.
select-options: intname for vseointerf-clsname.
select-options: clsname for SEOCLSKEY-CLSNAME.
parameters: friends as checkbox default 'X'.
select-options: funcarea for tlibg-area.
select-options: program for trdir-name.
parameters: dynpro as checkbox default 'X'.
select-options: table for dd02l-tabname.
select-options: view for dd02l-tabname.
select-options: tabletyp for DD40L-TYPENAME.
select-options: searchlp for DD30L-shlpname.
select-options: domain for dd01l-DOMNAME.
select-options: delement for dd04l-rollname.
select-options: typgroup for DDTYPET-TYPEGROUP.
selection-screen end of block b.
parameters: upload radiobutton group r1.
selection-screen begin of block c with frame.
selection-screen comment 1(25) cup.
selection-screen begin of line.
selection-screen comment 1(30) cup_sing.
parameters: up_sing radiobutton group j1 default 'X'.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(30) cup_ind.
parameters: up_index radiobutton group j1.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment 1(25) cfile_up.
parameters: PCFILE1 type localfile default '.xml'.
selection-screen end of line.
parameters postfix(1).
selection-screen end of block c.
************************************************************************
* Initialization
************************************************************************
initialization.
move 'Store in single XML file' to csave.
move 'Display XML' to cdisplay.
move 'Display XML in Editor' to cedit.
move 'Store Source in CDATA' to ccdata.
move 'Crossreference' to comment.
move 'Complete' to ccomp.
move 'NoSource' to cnosour.
move 'NoCrossref' to cnocr.
move 'Grade of Sourcescan' to cgrade.
move 'Store in several XML-files' to csfiles.
move 'Path' to cpath.
move 'Path' to cpath1.
move 'Path and Filename' to cfile.
move 'Store Source in txt files' to ctxtfile.
move 'Parameters for Download' to cdown.
move 'Parameters for Upload' to cup.
move 'Path and filename of XML file' to cfile_up.
move 'Upload single XML-File' to cup_sing.
move 'Upload file FILE_INDEX.XML' to cup_ind.
move 'Display only' to dispon.
************************************************************************
* At selection-screen
************************************************************************
at selection-screen.
perform check_selection.
***********************************************************************
* At selection-screen on value request
***********************************************************************
at selection-screen on value-request for pcfile1.
perform on_value_request_pcfile1.
public section.
class-methods: error_question
importing error_text type string
exporting ev_flg_stop_upload_processing type as4flag,
commit_work importing wait type as4flag optional,
rollback_work.
endclass. "error_handling DEFINITION
*---------------------------------------------------------------------*
* CLASS error_handling IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class error_handling implementation.
method error_question.
**************************************
* Lokale Datendeklaration
**************************************
data: eq_text1 type string,
eq_text2 type string.
data: eq_answer.
data: eq_msgid type sy-msgid,
eq_msgno type sy-msgno,
eq_msgv1 type sy-msgv1,
eq_msgv2 type sy-msgv2,
eq_msgv3 type sy-msgv3,
eq_msgv4 type sy-msgv4.
*************************************
* Systemnachricht
*************************************
move sy-msgid to eq_msgid.
move sy-msgno to eq_msgno.
move sy-msgv1 to eq_msgv1.
move sy-msgv2 to eq_msgv2.
move sy-msgv3 to eq_msgv3.
move sy-msgv4 to eq_msgv4.
* Error ausgeben
new-line.
WRITE: 'Error:' color col_negative, error_text color col_negative.
* Error message
if not EQ_MSGID is initial.
new-line.
WRITE: 'SY-MSGID' color col_negative,
EQ_MSGID color col_negative,
'SY-MSGNO' color col_negative,
EQ_MSGNO color col_negative.
if not EQ_MSGV1 is initial.
new-line.
write: 'SY-MSGV1' color col_negative,
EQ_MSGV1 color col_negative.
endif.
if not EQ_MSGV2 is initial.
new-line.
write: 'SY-MSGV2' color col_negative,
EQ_MSGV2 color col_negative.
endif.
if not EQ_MSGV3 is initial.
new-line.
write: 'SY-MSGV3' color col_negative,
EQ_MSGV3 color col_negative.
endif.
if not EQ_MSGV4 is initial.
new-line.
write: 'SY-MSGV4' color col_negative,
EQ_MSGV4 color col_negative.
endif.
endif.
************************************
* Question
************************************
move 'Do you want to continue upload processing?' to eq_text2.
*****************************************
* Answer
*****************************************
clear: eq_text1, eq_text2.
length = strlen( error_text ).
if length > 0.
length = length / 2.
move error_text(length) to eq_text1.
move error_text+length to eq_text2.
endif.
if eq_answer eq 'N'.
message ID '38' type 'S' NUMBER '000' with eq_text1 eq_text2.
* Upload ganz abbrechen (globale Variable)
move 'X' to gv_flg_stop_upload_processing.
new-line.
write 'Canceled by user' color col_total.
endif.
new-line.
*******************************************
* Rueckgabewert
*******************************************
move gv_flg_stop_upload_processing to ev_flg_stop_upload_processing.
endmethod. "error_question
method commit_work.
if wait eq 'X'.
commit work and wait.
else.
commit work.
endif.
endmethod. "commit_work
method rollback_work.
rollback work.
endmethod. "rollback_work
endclass. "error_handling IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS source_read_and_convert DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class source_convert_and_read definition.
public section.
class-methods read_source importing i_name type PROGNAME
exporting e_source type seop_source
e_lines_truncated type i
e_long type SCRPFLAG
exceptions
error.
endclass. "source_read_and_convert DEFINITION
*---------------------------------------------------------------------*
* CLASS source_read_and_convert IMPLEMENTATION
*---------------------------------------------------------------------*
* Ulrich Streit
*---------------------------------------------------------------------*
class source_convert_and_read implementation.
method read_source.
DATA: ABAP_SOURCE_FORMAT type ref to CL_WB_ABAP_SOURCE_FORMAT.
DATA: target_source type swbse_max_line_tab,
w_target_source like line of target_source.
DATA: w_source type line of seop_source.
DATA: error_text type string.
*---------------------------------------------------------------------*
* CLASS typegroup_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class typegroup_read definition.
public section.
methods read_typegroup
importing typegroup_name TYPE trdir-name
exporting e_typegroup type ttypegroup
exceptions error.
private section.
data: typegroup type ttypegroup.
* Hilfsvariabeln
data error_text type string.
endclass. "typegroup_read DEFINITION
*---------------------------------------------------------------------*
* CLASS typegroup_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class typegroup_read implementation.
method read_typegroup.
free typegroup.
* Name
move typegroup_name to typegroup-name.
* Source
data: name(30) type C.
concatenate '%_C' typegroup-name into name.
read report name into typegroup-source state 'A'.
if sy-subrc ne 0.
concatenate 'Typegroup' typegroup-name 'cant read'
into error_text
separated by space.
error_message error_text 'S'. "Makro
free typegroup.
raise error.
endif.
* Texte
select * from DDTYPET into table typegroup-texts
where typegroup = typegroup-name.
* Rueckgabe
e_typegroup = typegroup.
endmethod. "read_typegroup
endclass. "typegroup_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS domain_read DEFINITION
*---------------------------------------------------------------------*
* Ulrich Streit
*---------------------------------------------------------------------*
class domain_read definition.
public section.
methods read_domain importing DOMA_NAME TYPE RPY_DOMA-DOMANAME
exporting e_domain type tdomain
exceptions error.
private section.
data: domain type tdomain.
* Hilfsvariabeln
data error_text type string.
endclass. "domain_read DEFINITION
*---------------------------------------------------------------------*
* CLASS domain_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class domain_read implementation.
* Rueckgabe
if not domain-gotstate is initial.
e_domain = domain.
else.
free e_domain.
endif.
endmethod. "read_domain
endclass. "domain_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS dataelement_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class dataelement_read definition.
public section.
methods read_dataelement
importing DATAELEMENT_NAME TYPE RPY_DTEL-DTELNAME
exporting e_dataelement type tdataelement
exceptions error.
private section.
data: dataelement type tdataelement.
* Hilfsvariabeln
data error_text type string.
endclass. "domain_read DEFINITION
*---------------------------------------------------------------------*
* CLASS dataelement_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class dataelement_read implementation.
* Rueckgabe
if not dataelement-gotstate is initial.
e_dataelement = dataelement.
else.
free e_dataelement.
endif.
endmethod. "read_domain
endclass. "dataelement_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS table_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class table_read definition.
public section.
methods read_table
importing TABLE_NAME TYPE RPY_TABL-TABLNAME
exporting e_table type ttable
exceptions error.
private section.
data: table type ttable.
* Hilfsvariabeln
data error_text type string.
endclass. "domain_read DEFINITION
*---------------------------------------------------------------------*
* CLASS table_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class table_read implementation.
* Tableclass
select tabclass up to 1 rows
from dd02l
into table-tabclass
where TABNAME eq table-name.
endselect.
* Rueckgabe
if not table-GOTSTATE is initial.
e_table = table.
else.
free e_table.
endif.
endmethod. "read_domain
endclass. "table_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS view_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class view_read definition.
public section.
methods read_view
importing VIEW_NAME TYPE DDOBJNAME
exporting e_view type tview
exceptions error.
private section.
data: view type tview.
* Hilfsvariabeln
data error_text type string.
endclass. "view_read DEFINITION
*---------------------------------------------------------------------*
* CLASS view_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class view_read implementation.
* Rueckgabe
if not view-GOTSTATE is initial.
e_view = view.
else.
free e_view.
endif.
endmethod. "read_view
endclass. "view_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS tabletype_read DEFINITION
*---------------------------------------------------------------------*
* Ulrich Streit
*---------------------------------------------------------------------*
class tabletype_read definition.
public section.
methods read_tabletype
importing tabletype_name TYPE DDOBJNAME
exporting e_tabletype type ttabletype
exceptions error.
private section.
data: tabletype type ttabletype.
* Hilfsvariabeln
data error_text type string.
endclass. "tabletype_read DEFINITION
*---------------------------------------------------------------------*
* CLASS tabletype_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class tabletype_read implementation.
* Rueckgabe
if not tabletype-GOTSTATE is initial.
e_tabletype = tabletype.
else.
free e_tabletype.
endif.
endmethod. "read_tabletype
endclass. "tabletype_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS shlp_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class shlp_read definition.
public section.
methods read_shlp
importing shlp_name TYPE DDOBJNAME
exporting e_shlp type tshlp
exceptions error.
private section.
data: shlp type tshlp.
* Hilfsvariabeln
data error_text type string.
endclass. "shlp_read DEFINITION
*---------------------------------------------------------------------*
* CLASS shlp_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class shlp_read implementation.
* Rueckgabe
if not shlp-GOTSTATE is initial.
e_shlp = shlp.
else.
free e_shlp.
endif.
endmethod. "read_shlp
endclass. "shlp_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS class_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class class_read definition.
public section.
methods:
READ_CLASS importing i_cifkey type SEOCLSKEY
exporting e_class type tclass
exceptions error.
private section.
* Attribute
data: class type tclass.
data: clskey type SEOCLSKEY.
data: CIFKEY type SEOCLSKEY.
* Hilfsvariabeln
data error_text type string.
* Methoden
methods:
READ_METHODS changing methods TYPE SEOO_METHODS_R
exceptions error,
READ_METHOD_PARAMS
importing METHOD type SEOO_METHOD_R
exporting PARAMETERS type SEOS_PARAMETERS_R
exceptions error,
READ_METHOD_DETAIL
importing METHOD type SEOO_METHOD_R
changing METHOD_DETAILS type SEOO_METHOD_DETAILS
exceptions error,
READ_METHOD_EXCEPTIONS
importing method type tymethod
changing METHOD_EXCEPTIONS type SEOS_EXCEPTIONS_R
exceptions error,
READ_METHOD_SOURCE
importing METHOD type SEOO_METHOD_R
exporting SOURCE type SEOP_SOURCE
changing INCNAME type PROGRAM
exceptions error,
error_method_source
importing mtdkey type SEOCPDKEY,
READ_IMPL_METHODS
exceptions error,
READ_REDEF_METHODS
exceptions error,
READ_LOCALS
exceptions error,
ERROR_INCLUDE_SOURCE
exceptions error,
error_method_includes
exceptions error,
READ_TYPE_SOURCE
exceptions error,
READ_SECTIONS
exceptions error.
endclass. "class DEFINITION
*---------------------------------------------------------------------*
* CLASS class IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class class_read implementation.
***** private ******
method READ_CLASS.
data: explore TYPE SEOK_CLS_TYPEINFOS,
w_explore type line of SEOK_CLS_TYPEINFOS,
methods type SEOO_METHODS_R.
move i_cifkey to cifkey.
move-corresponding i_cifkey to clskey.
data: begin of SEO_METHOD_GET_DETAIL.
data: CPDKEY type SEOCPDKEY.
data: METHOD type VSEOMETHOD.
data: METHOD_DETAILS type SEOO_METHOD_DETAILS.
data: end of SEO_METHOD_GET_DETAIL.
* refresh
free method_details.
SEO_METHOD_GET_DETAIL-CPDKEY-CLSNAME = METHOD-CLSNAME.
SEO_METHOD_GET_DETAIL-CPDKEY-CPDNAME = METHOD-CMPNAME.
*
call function 'SEO_METHOD_GET_DETAIL'
EXPORTING
CPDKEY = SEO_METHOD_GET_DETAIL-CPDKEY
IMPORTING
METHOD = SEO_METHOD_GET_DETAIL-METHOD
METHOD_DETAILS = METHOD_DETAILS
EXCEPTIONS
NOT_EXISTING = 1
NO_METHOD = 2
others = 3.
if SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ERROR SEO_METHOD_GET_DETAIL_NOT_EXISTING = 1.
ERROR SEO_METHOD_GET_DETAIL_NO_METHOD = 2.
ERROR SEO_METHOD_GET_DETAIL_OTHERS = 3.
concatenate 'Class' SEO_METHOD_GET_DETAIL-CPDKEY
'Cant get Methoddetail' '(Fb. SEO_METHOD_GET_DETAIL)'
into error_text separated by space.
error_message error_text 'S'. "Makro
raise error.
endif.
data: begin of SEO_METHOD_GET_SOURCE.
data: MTDKEY type SEOCPDKEY.
data: SOURCE type SEOP_SOURCE.
data: INCNAME type PROGRAM.
data: end of SEO_METHOD_GET_SOURCE.
data: includes type SEOP_METHODS_W_INCLUDE,
w_include like line of includes.
data: method_impl like line of class-methods_impl.
data: MTDKEY TYPE SEOCPDKEY,
MTDKEY1 TYPE SEOCMPKEY.
data: w_alias like method_impl-alias.
move-corresponding cifkey to clskey.
* Includes lesen
CALL FUNCTION 'SEO_CLASS_GET_METHOD_INCLUDES'
EXPORTING
CLSKEY = clskey
IMPORTING
INCLUDES = includes
EXCEPTIONS
_INTERNAL_CLASS_NOT_EXISTING = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
call method error_method_includes.
raise error.
ELSE.
loop at includes into w_include.
* refresh
free: method_impl, MTDKEY, MTDKEY1.
read table class-methods
transporting no fields
with key method-cmpname = w_include-cpdkey-cpdname.
if sy-subrc ne 0.
* Includename
move w_include to method_impl-include.
* Method
if w_include-cpdkey-cpdname ca '~'.
* Iterface
split w_include-cpdkey-cpdname at '~'
into MTDKEY1-CLSNAME MTDKEY1-CMPNAME.
else.
* Redefinition
continue.
endif.
IF SY-SUBRC <> 0.
call method error_method_source
EXPORTING
mtdkey = MTDKEY.
raise error.
ELSE.
* Alias
clear w_alias.
read table class-aliases into w_alias
with key
REFCLSNAME = MTDKEY1-CLSNAME
REFCMPNAME = MTDKEY1-CMPNAME.
if sy-subrc eq 0.
move w_alias to method_impl-alias.
else.
clear method_impl-alias.
endif.
append method_impl to class-methods_impl.
endif.
endif.
free method_impl.
endif.
endloop.
ENDIF.
endmethod. "read_impl_methods
method error_method_includes.
error _INTERNAL_CLASS_NOT_EXISTING = 1.
error OTHERS = 2.
concatenate 'Class' clskey
'Cant get Method Includes'
'(Fb. SEO_CLASS_GET_METHOD_INCLUDES)'
into error_text separated by space.
error_message error_text 'S'. "Makro
endmethod. "error_method_includes
method read_redef_methods.
data: includes type SEOP_METHODS_W_INCLUDE,
w_include like line of includes.
data: w_redefinition like line of class-redefinitions.
data: method_redef like line of class-methods_redef.
data: MTDKEY TYPE SEOCPDKEY,
MTDKEY1 TYPE SEOCMPKEY.
data: explore like line of class-explore_inheritance.
clear clskey.
move-corresponding cifkey to clskey.
CALL FUNCTION 'SEO_CLASS_GET_METHOD_INCLUDES'
EXPORTING
CLSKEY = clskey
IMPORTING
INCLUDES = includes
EXCEPTIONS
_INTERNAL_CLASS_NOT_EXISTING = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
call method error_method_includes.
raise error.
ELSE.
loop at includes into w_include.
* refresh
free method_redef.
read table class-methods
transporting no fields
with key method-cmpname = w_include-cpdkey-cpdname.
if sy-subrc ne 0.
* Includename
move w_include to method_redef-include.
* Method
if w_include-cpdkey-cpdname ca '~'.
continue.
endif.
clear w_redefinition.
read table class-redefinitions
into w_redefinition
with key
mtdname = w_include-cpdkey-cpdname.
if sy-subrc eq 0.
loop at class-explore_inheritance into explore.
* refresh
free: method_redef-method, mtdkey1.
move explore-clsname to MTDKEY1-CLSNAME.
move w_redefinition-mtdname to MTDKEY1-CMPNAME.
IF SY-SUBRC <> 0.
call method error_include_source.
raise error.
ENDIF.
move 'MAC' to local-name.
move source to local-source_locals.
append local to class-locals.
endmethod. "READ_locals
method error_include_source.
error _INTERNAL_CLASS_NOT_EXISTING = 1.
error NOT_EXISTING = 2.
error OTHERS = 3.
concatenate 'Class' clskey
'Cant get Includesource'
'(Fb. SEO_CLASS_GET_INCLUDE_SOURCE)'
into error_text separated by space.
error_message error_text 'S'. "Makro
endmethod. "error_include_source
method READ_TYPE_SOURCE.
*********************
* Typesource
*********************
DATA: TYPKEY TYPE SEOCMPKEY.
DATA: w_type like line of class-types-types.
DATA: t_source type seop_source.
loop at class-types-types into w_type.
refresh t_source.
move-corresponding w_type to typkey.
IF SY-SUBRC <> 0.
if sy-subrc ne 3.
error _INTERNAL_CLASS_NOT_EXISTING = 1.
error NOT_EXISTING = 2.
error NOT_EDITED = 3.
error OTHERS = 4.
concatenate 'Class' typkey-clsname 'Cant get type source'
'(Fb. SEO_CLASS_GET_TYPE_SOURCE)' into error_text
separated by space.
error_message error_text 'S'.
refresh t_source.
raise error.
endif.
ENDIF.
append lines of t_source to class-types-type_source.
refresh t_source.
endloop.
endmethod. "READ_TYPES
method READ_sections.
DATA: SECTION like line of class-sections.
do 3 times.
* refresh
free section.
case sy-index.
when 1.
move seok_limu_public to section-LIMU.
when 2.
move seok_limu_private to section-LIMU.
when 3.
move seok_limu_protected to section-LIMU.
endcase.
* >>>> Beginn geaendert US20060112 XYXY
if sy-saprl >= 640.
data: ls_seo_section_source(255),
lt_seo_section_source like standard table of
ls_seo_section_source.
CALL FUNCTION 'SEO_SECTION_GET_SOURCE'
EXPORTING
CIFKEY = class-cifkey
LIMU = section-limu
* STATE =
IMPORTING
SOURCE = lt_seo_section_source
INCNAME = section-incname
EXCEPTIONS
CLASS_NOT_EXISTING = 1
VERSION_NOT_EXISTING = 2
OTHERS = 3
.
Loop at lt_seo_section_source into ls_seo_section_source.
append ls_seo_section_source(72) to section-source.
Endloop.
else.
* >>>> Ende geaendert US20060112 XYXY
CALL FUNCTION 'SEO_SECTION_GET_SOURCE'
EXPORTING
CIFKEY = class-cifkey
LIMU = section-limu
* STATE =
IMPORTING
SOURCE = section-source
INCNAME = section-incname
EXCEPTIONS
CLASS_NOT_EXISTING = 1
VERSION_NOT_EXISTING = 2
OTHERS = 3
.
endif.
IF SY-SUBRC <> 0.
error CLASS_NOT_EXISTING = 1.
error VERSION_NOT_EXISTING = 2.
error OTHERS = 3.
concatenate 'Class' class-cifkey-clsname
'Cant get Sectionsource' '(Fb. SEO_SECTION_GET_SOURCE)'
into error_text separated by space.
error_message error_text 'S'. "Makro
raise error.
else.
append section to class-sections.
ENDIF.
enddo.
endmethod. "READ_sections
endclass. "class IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS interface_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class interface_read definition.
public section.
methods: read_interface importing i_intkey type SEOCLSKEY
exporting e_inter type tinter
exceptions error.
private section.
* Klassenattribute
data: inter type tinter.
* Hilfsvariabeln
data: error_text type string.
endclass. "interface_read DEFINITION
*---------------------------------------------------------------------*
* CLASS interface_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class interface_read implementation.
if not postfix is initial.
concatenate inter-intkey-clsname postfix into clsname_new.
* INTKEY
move clsname_new to inter-intkey-clsname.
* INTERFACE
move clsname_new to inter-interface-clsname.
* ATTRIBUTES
data: w_attribute like line of inter-attributes.
loop at inter-attributes into w_attribute.
move clsname_new to w_attribute-clsname.
modify inter-attributes from w_attribute.
endloop.
* METHODS
data: w_method like line of inter-methods.
loop at inter-methods into w_method.
move clsname_new to w_method-clsname.
modify inter-methods from w_method.
endloop.
* EVENTS
data: w_event like line of inter-events.
loop at inter-events into w_event.
move clsname_new to w_event-clsname.
modify inter-events from w_event.
endloop.
* PARAMETERS
data: w_parameter like line of inter-parameters.
loop at inter-parameters into w_parameter.
move clsname_new to w_parameter-clsname.
modify inter-parameters from w_parameter.
endloop.
* EXCEPS
data: w_excep like line of inter-exceps.
loop at inter-exceps into w_excep.
move clsname_new to w_excep-clsname.
modify inter-exceps from w_excep.
endloop.
* COMPRISINGS
data: w_COMPRISING like line of inter-COMPRISINGs.
loop at inter-COMPRISINGs into w_COMPRISING.
move clsname_new to w_COMPRISING-clsname.
modify inter-COMPRISINGs from w_COMPRISING.
endloop.
* TYPEPUSAGES
data: w_TYPEPUSAGE like line of inter-TYPEPUSAGES.
loop at inter-TYPEPUSAGES into w_TYPEPUSAGE.
move clsname_new to w_TYPEPUSAGE-clsname.
modify inter-TYPEPUSAGES from w_TYPEPUSAGE.
endloop.
* CLSDEFERRDS
data: w_CLSDEFERRD like line of inter-CLSDEFERRDS.
loop at inter-CLSDEFERRDS into w_CLSDEFERRD.
move clsname_new to w_CLSDEFERRD-clsname.
modify inter-CLSDEFERRDS from w_CLSDEFERRD.
endloop.
* INTDEFERRDS
data: w_INTDEFERRD like line of inter-INTDEFERRDS.
loop at inter-INTDEFERRDS into w_INTDEFERRD.
move clsname_new to w_INTDEFERRD-clsname.
modify inter-INTDEFERRDS from w_INTDEFERRD.
endloop.
* EXPLORE_COMPRISINGS
* ALIASES
data: w_ALIAS like line of inter-ALIASES.
loop at inter-ALIASES into w_ALIAS.
move clsname_new to w_ALIAS-clsname.
modify inter-ALIASES from w_ALIAS.
endloop.
endif.
endmethod. "postfix
endclass. "interface_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS interfaces_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class interfaces_upload definition.
public section.
methods:
constructor,
interfaces_create.
private section.
DATA: interface_upload type ref to interface_upload.
methods:
determine_sequence_interfaces.
endclass. "interfaces_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS interfaces_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class interfaces_upload implementation.
*&---------------------------------------------------------------------*
*& Form determine_sequence_interfaces
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_INTERS text
*----------------------------------------------------------------------*
METHOD determine_sequence_interfaces.
data: w_inters type standard table of tinter-intkey-clsname,
w_inters1 type standard table of tinter-intkey-clsname,
inter1 type tinter,
inter2 type tinter.
data: w_comprising type line of tinter-comprisings.
* Sortieren
loop at p-inters into inter1.
loop at inter1-comprisings into w_comprising.
loop at p-inters into inter2
where intkey-clsname = w_comprising-refclsname.
insert inter2-intkey-clsname into w_inters1 index 1.
endloop.
endloop.
insert inter1-intkey-clsname into w_inters1 index 1.
loop at w_inters1 into inter2-intkey-clsname.
insert inter2-intkey-clsname into w_inters index 1.
delete w_inters1.
endloop.
endloop.
* doppelte Eintraege
data: index type i.
loop at w_inters into inter1-intkey-clsname.
move 0 to index.
loop at w_inters into inter2-intkey-clsname
where table_line = inter1-intkey-clsname.
index = index + 1.
if index > 1.
delete w_inters.
endif.
endloop.
endloop.
* Uebergeben
loop at w_inters into inter1-intkey-clsname.
read table p-inters into inter2
with key intkey-clsname = inter1-intkey-clsname.
delete p-inters index sy-tabix.
append inter2 to p-inters.
endloop.
ENDMETHOD. " determine_sequence_interfaces
endclass. "interfaces_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS class_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class class_upload definition.
public section.
methods create_class importing i_class type tclass
exceptions error.
private section.
* Attribute
data: class type tclass.
data: clskey type SEOCLSKEY.
data: clsname type SEOCLSKEY-CLSNAME.
data: error_text type string.
*---------------------------------------------------------------------*
* CLASS class_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class class_upload implementation.
method create_class_types.
data: w_class like class.
data: clsname_temp like class-cifkey-clsname.
data: w_inter type tinter.
****************************
* Klassenattribute
****************************
if not clsname is initial.
move clsname to class-class-clsname.
move clsname to class-cifkey-clsname.
endif.
***************************
* Methoden und Parameter
***************************
DATA: T_SEOO_METHOD_R TYPE STANDARD TABLE OF SEOO_METHOD_R
WITH KEY CLSNAME CMPNAME VERSION LANGU,
W_SEOO_METHOD_R TYPE SEOO_METHOD_R.
DATA: t_seos_parameters_r TYPE STANDARD TABLE OF seos_parameter_r
WITH KEY clsname cmpname sconame version langu,
w_seos_parameters_r TYPE seos_parameter_r.
field-symbols: <METHOD> type TYMETHOD,
<parameters> type line of tymethod-parameters.
loop at class-methods assigning <method>.
* Unerwuenschte Methoden
if not <method>-method-REFCLSNAME is initial.
delete class-methods.
continue.
endif.
* Methoden
if not clsname is initial.
move clsname to <method>-method-clsname.
endif.
move <method>-method to W_SEOO_METHOD_R.
append W_SEOO_METHOD_R to T_SEOO_METHOD_R.
* Parameter
loop at <method>-parameters assigning <parameters>.
if not clsname is initial.
move clsname to <parameters>-clsname.
endif.
move <parameters> to w_seos_parameters_r.
append w_seos_parameters_r to t_seos_parameters_r.
endloop.
endloop.
********************************************************************
* Ausnahmen
********************************************************************
data: t_exceptions type tymethod-exceptions,
w_exceptions type line of tymethod-exceptions.
loop at class-methods assigning <method>.
loop at <method>-exceptions into w_exceptions.
if not clsname is initial.
move clsname to w_exceptions-clsname.
endif.
append w_exceptions to t_exceptions.
modify <method>-exceptions from w_exceptions.
endloop.
endloop.
*********************************************************************
* Attribute
*********************************************************************
field-symbols: <attribute> type line of SEOO_ATTRIBUTES_R.
loop at class-attributes assigning <attribute>.
if not clsname is initial.
move clsname to <attribute>-clsname.
if not <attribute>-REFCLSNAME is initial.
delete class-attributes.
endif.
endif.
endloop.
********************************************************************
* Events
********************************************************************
field-symbols <event> like line of class-events.
loop at class-events assigning <event>.
if not clsname is initial.
move clsname to <event>-clsname.
endif.
endloop.
********************************************************************
* Friends
********************************************************************
data: friend like line of class-friends.
loop at class-friends into friend.
if not clsname is initial.
move clsname to friend-clsname.
endif.
if not postfix is initial.
concatenate friend-REFCLSNAME postfix into clsname_temp.
loop at p-classes into w_class.
if w_class-cifkey-clsname eq friend-refclsname
or w_class-cifkey-clsname eq clsname_temp.
concatenate friend-REFCLSNAME postfix into friend-REFCLSNAME
.
exit.
endif.
endloop.
endif.
modify class-friends from friend.
endloop.
********************************************************************
* Types
********************************************************************
field-symbols: <type> like line of class-types-types.
loop at class-types-types assigning <type>.
if not clsname is initial.
move clsname to <type>-clsname.
endif.
endloop.
********************************************************************
* Inheritance
********************************************************************
if not class-inheritance is initial.
if not clsname is initial.
move clsname to class-inheritance-clsname.
if class-inheritance-REFCLSNAME(1) eq c_z
or class-inheritance-REFCLSNAME(1) eq c_y.
if not postfix is initial.
concatenate class-inheritance-REFCLSNAME postfix
into clsname_temp.
loop at p-classes into w_class.
if w_class-cifkey-clsname eq class-inheritance-REFCLSNAME
or w_class-cifkey-clsname eq clsname_temp.
concatenate class-inheritance-REFCLSNAME postfix
into class-inheritance-REFCLSNAME.
exit.
endif.
endloop.
endif.
endif.
endif.
endif.
*********************************************************************
* Redefinitions
*********************************************************************
data: redefinitions like line of class-redefinitions.
loop at class-redefinitions into redefinitions.
if not clsname is initial.
move clsname to redefinitions-clsname.
if redefinitions-REFCLSNAME(1) eq c_z
or redefinitions-REFCLSNAME(1) eq c_y.
if not postfix is initial.
concatenate redefinitions-REFCLSNAME postfix
into clsname_temp.
loop at p-classes into w_class.
if w_class-cifkey-clsname eq redefinitions-REFCLSNAME
or w_class-cifkey-clsname eq clsname_temp.
concatenate redefinitions-REFCLSNAME postfix
into redefinitions-REFCLSNAME.
exit.
endif.
endloop.
endif.
endif.
endif.
modify class-redefinitions from redefinitions.
endloop.
*********************************************************************
* Aliases
*********************************************************************
data: aliases like line of class-aliases.
data: aliases_r type SEOO_ALIASES_R,
w_aliases_r like line of aliases_r.
loop at class-aliases into aliases.
if not clsname is initial.
move clsname to aliases-clsname.
if aliases-REFCLSNAME(1) eq c_z
or aliases-REFCLSNAME(1) eq c_y.
if not postfix is initial.
concatenate aliases-REFCLSNAME postfix
into clsname_temp.
loop at p-classes into w_class.
if w_class-cifkey-clsname eq aliases-REFCLSNAME
or w_class-cifkey-clsname eq clsname_temp.
concatenate aliases-REFCLSNAME postfix
into aliases-REFCLSNAME.
exit.
endif.
endloop.
endif.
endif.
endif.
move-corresponding aliases to w_aliases_r.
append w_aliases_r to aliases_r.
modify class-aliases from aliases.
endloop.
*********************************************************************
* Implementings
*********************************************************************
data: implementing like line of class-implementings-implementings,
impl_details like line of class-implementings-impl_details.
loop at class-implementings-implementings into implementing.
if not clsname is initial.
move clsname to implementing-clsname.
if not postfix is initial.
concatenate implementing-REFCLSNAME postfix
into clsname_temp.
loop at p-inters into w_inter.
if w_inter-intkey-clsname eq implementing-REFCLSNAME
or w_inter-intkey-clsname eq clsname_temp.
concatenate implementing-REFCLSNAME postfix
into implementing-REFCLSNAME.
exit.
endif.
endloop.
endif.
endif.
modify class-implementings-implementings from implementing.
endloop.
loop at class-implementings-impl_details into impl_details.
if not clsname is initial.
move clsname to impl_details-clsname.
if not postfix is initial.
concatenate impl_details-REFCLSNAME postfix
into clsname_temp.
loop at p-inters into w_inter.
if w_inter-intkey-clsname eq impl_details-REFCLSNAME
or w_inter-intkey-clsname eq clsname_temp.
concatenate impl_details-REFCLSNAME postfix
into impl_details-REFCLSNAME.
exit.
endif.
endloop.
endif.
endif.
modify class-implementings-impl_details from impl_details.
endloop.
*********************************************************************
* CLSDEFERRDS
*********************************************************************
field-symbols <classdeferreds> like line of class-classdeferreds.
loop at class-classdeferreds assigning <classdeferreds>.
if not clsname is initial.
move clsname to <classdeferreds>-clsname.
endif.
endloop.
*********************************************************************
* INTDEFERRDS
*********************************************************************
field-symbols: <INTerfaceDEFERREDS>
like line of class-INTerfaceDEFERREDS.
loop at class-INTerfaceDEFERREDS
assigning <INTerfaceDEFERREDS>.
if not clsname is initial.
move clsname to <INTerfaceDEFERREDS>-clsname.
endif.
endloop.
DATA: seop_methods like line of t_seop_method_w_source.
DATA: w_seop_source
type line of seop_method_w_source-source.
DATA: w_source type line of seop_source,
w_source1 type line of seop_source.
* Methoden
move cpdname to seop_methods-cpdname.
loop at source into w_source.
move w_source to w_source1.
condense w_source1.
if w_source1 NP 'METHOD*'
and w_source1 NP 'ENDMETHOD*'.
move w_source to w_seop_source.
append w_seop_source to seop_methods-source.
endif.
endloop.
append seop_methods to t_seop_method_w_source.
endmethod. "create_source_fb
method create_source_methods_redef.
data: method_redef like line of class-methods_redef.
data: cpdname type seop_method_w_source-cpdname.
data: t_seop_method_w_source type seop_methods_w_source.
field-symbols: <seop_method_w_source>
type line of seop_methods_w_source.
* Methoden
loop at class-methods_redef into method_redef.
move method_redef-include-cpdkey-CPDNAME to cpdname.
if <local>-name eq 'DEF'.
move <local>-source_locals to source_locals_def.
endif.
if <local>-name eq 'MAC'.
move <local>-source_locals to source_locals_mac.
endif.
if <local>-name eq 'IMP'.
move <local>-source_locals to source_locals_imp.
endif.
endloop.
if not t_seop_method_w_source[] is initial
or not source_locals_def[] is initial
or not source_locals_imp[] is initial
or not source_locals_mac[] is initial.
********************************************
* Wertuebergabe
********************************************
class = i_class.
********************************************
* classname, clskey
********************************************
move-corresponding class-cifkey to clskey.
* classname
if postfix is initial.
move clskey-clsname to clsname.
else.
concatenate clskey-clsname postfix into clsname.
move clsname to class-cifkey-clsname.
move clsname to clskey-clsname.
endif.
********************************************
* Auf Kundenklasse beschraenken
********************************************
if clsname(1) ne c_z
and clsname(1) ne c_y.
concatenate 'class' clskey 'does not begin with Z or Y'
'Classname check' into error_text
separated by space.
call method error_handling=>error_question
EXPORTING
error_text = error_text.
* error_message error_text 'E'. "Makro
raise error.
endif.
data: w_classes type standard table of tclass-cifkey-clsname,
w_classes1 type standard table of tclass-cifkey-clsname,
class1 type tclass,
class2 type tclass.
data: w_expl_inheritance type line of tclass-explore_inheritance.
* Sortieren
loop at p-classes into class1.
loop at class1-explore_inheritance into w_expl_inheritance.
loop at p-classes into class2
where cifkey-clsname = w_expl_inheritance-clsname.
insert class2-cifkey-clsname into w_classes1 index 1.
endloop.
endloop.
insert class1-cifkey-clsname into w_classes1 index 1.
loop at w_classes1 into class2-cifkey-clsname.
insert class2-cifkey-clsname into w_classes index 1.
delete w_classes1.
endloop.
endloop.
* doppelte Eintraege
data: index type i.
loop at w_classes into class1-cifkey-clsname.
move 0 to index.
loop at w_classes into class2-cifkey-clsname
where table_line eq class1-cifkey-clsname.
index = index + 1.
if index > 1.
delete w_classes.
endif.
endloop.
endloop.
* Uebergeben
loop at w_classes into class1-cifkey-clsname.
read table p-classes into class2
with key cifkey-clsname = class1-cifkey-clsname.
delete p-classes index sy-tabix.
append class2 to p-classes.
endloop.
ENDMETHOD. " determine_sequence_classes
endclass. "classes_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS fmodule_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fmodule_read definition.
public section.
methods: read_fmodule importing i_funcname type tfdir-funcname
exceptions error,
get_fmodule exporting e_fmodule type tfmodule.
private section.
* Attribute
DATA: fmodule type tfmodule,
funcname type tfdir-funcname,
error_text type string.
methods read_fmodule_wo_rpy
exporting ev_long type SCRPFLAG
exceptions error.
endclass. "fmodule_read DEFINITION
*---------------------------------------------------------------------*
* CLASS fmodule_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fmodule_read implementation.
method read_fmodule.
* refresh
free fmodule. " refresh
* funcname
funcname = i_funcname.
* funcname uebergeben
move funcname to fmodule-funcname.
* Name Funktionsgruppe
select area up to 1 rows
from enlfdir into fmodule-area
where funcname = fmodule-funcname.
endselect.
if sy-subrc ne 0.
concatenate 'Fmodule' fmodule-funcname 'error Cant read enlfdir'
into error_text
separated by space.
error_message error_text 'S'. "Makro
free fmodule.
raise error.
endif.
* Ist die Zeilenlaenge > 72
DATA: lv_long type SCRPFLAG.
call method read_fmodule_wo_rpy
IMPORTING
ev_long = lv_long
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
raise error.
endif.
if lv_long eq 'X'.
concatenate 'Fmodule' fmodule-funcname 'error'
'Zeilenlaenge > 72.' into error_text
separated by space.
error_message error_text 'S'. "Makro
free fmodule.
raise error.
endif.
* RPY_FUNCTIONMODULE_READ ist wahrscheinlich veraltet
DATA: p_param_docu type standard table of RSFDO.
free: fmodule-global_flag,
fmodule-remote_call,
fmodule-update_task,
fmodule-short_text,
fmodule-t_import,
fmodule-t_change,
fmodule-t_export,
fmodule-t_tables,
fmodule-t_except,
fmodule-source.
* Source lesen und ueberpruefen, ob Zeilenlaenge > 72
DATA: lv_lines_truncated type i.
DATA: lv_progname type progname.
DATA: ls_tfdir type tfdir.
select single * from tfdir into ls_tfdir
where funcname = fmodule-funcname.
if sy-subrc ne 0.
* Error
free fmodule.
concatenate 'Fmodule' fmodule-funcname 'error'
'(select tfdir)' into error_text
separated by space.
error_message error_text 'S'. "Makro
raise error.
endif.
concatenate 'L' fmodule-area 'U' ls_tfdir-include into lv_progname.
call method source_convert_and_read=>read_source
EXPORTING
i_name = lv_progname
IMPORTING
e_source = fmodule-source
e_lines_truncated = lv_lines_truncated
e_long = ev_long
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
free fmodule.
raise error.
endif.
endmethod. "read_fmodule_wo_rpy
method get_fmodule.
e_fmodule = fmodule.
endmethod. "get_fmodule
endclass. "fmodule_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS fgroup_read DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fgroup_read definition.
public section.
methods: constructor,
read_fgroup
importing i_area type enlfdir-area
exporting e_fgroup type tfgroup
exceptions error.
private section.
* Attribute
data: area type enlfdir-area,
fgroup type tfgroup,
fmodule_read type ref to fmodule_read,
dynpro_read type ref to dynpro_read,
error_text type string.
methods: collect_fmodules exceptions error,
collect_funcarea exceptions error,
read_dynpros.
endclass. "fgroup_read DEFINITION
*---------------------------------------------------------------------*
* CLASS fgroup_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fgroup_read implementation.
data: w_fmodule type tfmodule,
t_enlfdir type standard table of enlfdir,
w_enlfdir like line of t_enlfdir.
select * from enlfdir into table t_enlfdir
where area eq fgroup-area.
loop at t_enlfdir into w_enlfdir.
call method fmodule_read->read_fmodule
EXPORTING
i_funcname = w_enlfdir-funcname
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
raise error.
endif.
* refresh
free w_fmodule.
call method fmodule_read->get_fmodule
IMPORTING
e_fmodule = w_fmodule.
if not w_fmodule is initial.
append w_fmodule to fgroup-fmodules.
endif.
endloop.
endmethod. "collect_fmodules
method collect_funcarea.
data: t_includes type standard table of tinclude-include,
w_include like line of t_includes,
PROGRAM LIKE SY-REPID,
FUGR_IS_FUNCTIONMODULE_NAME.
DATA: lv_progname type progname,
oasis type tinclude.
concatenate C_SAPL fgroup-area into program.
CALL FUNCTION 'RS_GET_ALL_INCLUDES'
EXPORTING
PROGRAM = program
* WITH_INACTIVE_INCLS = ' '
* WITH_RESERVED_INCLUDES =
TABLES
INCLUDETAB = t_includes
EXCEPTIONS
NOT_EXISTENT = 1
NO_PROGRAM = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
free fgroup.
error NOT_EXISTENT = 1.
error NO_PROGRAM = 2.
error OTHERS = 3.
concatenate 'Fmodule' program 'error'
'(Fb. RS_GET_ALL_INCLUDES)' into error_text
separated by space.
error_message error_text 'S'. "Makro
raise error.
ELSE.
if FUGR_IS_FUNCTIONMODULE_NAME eq 'X'.
* Funktionsbaustein
delete t_includes.
continue.
ENDIF.
move w_include to lv_progname.
free oasis-source.
call method source_convert_and_read=>read_source
EXPORTING
i_name = lv_progname
IMPORTING
e_source = oasis-source
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
free oasis.
raise error.
endif.
move w_include to oasis-include.
append oasis to fgroup-includes.
free oasis.
endloop.
endif.
endmethod. "collect_funcarea
method read_dynpros.
data: dynpro type tdynpro,
dynproname type tdynproname,
dynpronames type tdynpronames.
* Dynpros zu Funktionsgruppen lesen
data: name type string.
concatenate C_SAPL area into name.
select PROG DNUM from D020S
into (dynproname-progname, dynproname-dynnr)
where prog eq name.
append dynproname to dynpronames.
endselect.
* Dynpros selektieren
loop at dynpronames into dynproname.
free dynpro.
call method dynpro_read->read_dynpro
EXPORTING
i_dynproname = dynproname
IMPORTING
e_dynpro = dynpro.
if not dynpro is initial.
append dynpro to fgroup-dynpros.
endif.
endloop.
endmethod. "read_dynpros
endclass. "fgroup_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS program_read DEFINITION
*---------------------------------------------------------------------*
* Ulrich Streit
*---------------------------------------------------------------------*
class program_read definition.
public section.
methods: constructor,
read_program
importing i_progname type trdir-name
exporting e_program type tprogram
exceptions error.
private section.
* Attribute
data: program type tprogram,
error_text type string,
dynpro_read type ref to dynpro_read,
dynproname type tdynproname,
dynpronames type tdynpronames,
dynpro type tdynpro.
methods: prog exceptions error,
dynpros.
endclass. "program_read DEFINITION
*---------------------------------------------------------------------*
* CLASS program_read IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class program_read implementation.
method constructor.
create object dynpro_read.
endmethod. "constructor
method prog.
DATA: SOURCE_EXTENDED type standard table of ABAPTXT255.
if program-source is initial.
call method source_convert_and_read=>read_source
EXPORTING
i_name = program-name
IMPORTING
e_source = program-source
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
raise error.
endif.
endif.
endmethod. "program
method dynpros.
* Dynpros vom Programm lesen
free: dynpronames, dynpro.
select PROG DNUM from D020S
into (dynproname-progname, dynproname-dynnr)
where prog eq program-name.
append dynproname to dynpronames.
endselect.
loop at dynpronames into dynproname.
free dynpro.
call method dynpro_read->read_dynpro
EXPORTING
i_dynproname = dynproname
IMPORTING
e_dynpro = dynpro.
if not dynpro is initial.
append dynpro to program-dynpros.
endif.
endloop.
endmethod. "dynpros
method read_program.
* Initialisieren
free program.
move i_progname to program-name.
* program
call method prog
EXCEPTIONS
error = 1.
if sy-subrc ne 0.
raise error.
endif.
* dynpros zum Programm
call method dynpros.
* Sonstige Werte
move program-prog_inf-prog_type to program-subc.
move sy-langu to program-textpool-langu.
* Rueckgabe
e_program = program.
free program.
endmethod. "read_program
endclass. "program_read IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS dynpro_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class dynpro_upload definition.
public section.
methods: set_dynpro importing i_dynpro type tdynpro,
create_dynpro exceptions error.
private section.
DATA: dynpro type tdynpro,
error_text type string.
endclass. "dynpro_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS dynpro_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* Ulrich Streit
*---------------------------------------------------------------------*
class dynpro_upload implementation.
method set_dynpro.
dynpro = i_dynpro.
endmethod. "set_dynpro
method create_dynpro.
if not postfix is initial.
concatenate dynpro-progname postfix into dynpro-header-program.
endif.
*---------------------------------------------------------------------*
* CLASS fmodule_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fmodule_upload definition.
public section.
methods: create_fmodule importing i_fmodule type tfmodule
exceptions error.
private section.
DATA: fmodule type tfmodule,
error_text type string.
endclass. "fmodule_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS fmodule_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class fmodule_upload implementation.
method create_fmodule.
data: rs38l type rs38l.
data: parameter_docu type standard table of rsfdo.
data: source type standard table of RSSOURCE,
w_source type line of tinclude-source,
w_string type string.
if not postfix is initial.
loop at fmodule-source into w_source.
concatenate 'FUNCTION' '*#' into w_string.
concatenate w_string fmodule-funcname into w_string
separated by space.
concatenate w_string '*' into w_string.
if w_source cp w_string.
replace fmodule-funcname in w_source with rs38l-name.
modify fmodule-source from w_source.
exit.
endif.
endloop.
endif.
data: w_include like line of fgroup-includes,
oasis like w_include-include,
w_source like line of w_include-source.
data: praefix type string,
pfix type string,
length type i.
concatenate 'L' fgroup-area into praefix.
length = strlen( praefix ).
loop at fgroup-includes into w_include.
if w_include-include(length) eq praefix(length).
pfix = w_include-include+length.
if not postfix is initial.
concatenate praefix(length) postfix into praefix.
endif.
concatenate praefix pfix into oasis.
else.
move w_include-include to oasis.
endif.
* modify source
if pfix eq 'TOP'.
if not postfix is initial.
loop at w_include-source into w_source.
if w_source CP 'FUNCTION-POOL*'.
clear w_source.
concatenate 'FUNCTION-POOL' fgroup-area
into w_source separated by space.
concatenate w_source postfix '.' into w_source.
delete w_include-source.
insert w_source into w_include-source index 1.
exit.
endif.
endloop.
endif.
endif.
* Insert Include
insert report oasis
from w_include-source
state 'A'
program type 'I'.
* Insert Include in Fgroup
if pfix ne 'TOP'.
if 1 = 1.
* das funktioniert
data: MASTER TYPE TRDIR-NAME,
INCLUDE_NAME TYPE TRDIR-NAME,
NEW_INCLUDE TYPE CHAR1,
INSERT_INCLUDE_STATEMENT TYPE CHAR1,
MASTER_SOURCE TYPE SEDI_SOURCE.
if not postfix is initial.
concatenate C_SAPL fgroup-area postfix into master.
else.
concatenate C_SAPL fgroup-area into master.
endif.
move oasis to include_name.
move 'X' to insert_include_statement.
move 'X' to new_include.
* Include in Fgruppe einfuegen
CALL FUNCTION 'RS_CREATE_NEW_INCLUDE'
EXPORTING
MASTER = master
INCLUDE_NAME = include_name
NEW_INCLUDE = new_include
INSERT_INCLUDE_STATEMENT = insert_include_statement
TABLES
MASTER_SOURCE = master_source
EXCEPTIONS
PROGRAM_ENQUEUED = 1
ERROR_MESSAGE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
error PROGRAM_ENQUEUED = 1.
error ERROR_MESSAGE = 2.
error OTHERS = 3.
concatenate 'funcpool' include_name
'cant insert and create include'
'(Fb. RS_CREATE_NEW_INCLUDE)' into error_text
separated by space.
call method error_handling=>error_question
EXPORTING
error_text = error_text.
* error_message error_text 'E'. "Makro
raise error.
ENDIF.
else.
* das funktioniert ebenfalls
data: TRDIR_RAHMEN type TRDIR,
name type trdir-name,
progdir_prog type progdir.
if not postfix is initial.
concatenate C_SAPL fgroup-area postfix
into name.
else.
concatenate C_SAPL fgroup-area
into name.
endif.
select single * from progdir into progdir_prog
where name = name
and state = 'I'.
if sy-subrc ne 0.
select single * from progdir into progdir_prog
where name = name
and state = 'A'.
endif.
move-corresponding progdir_prog to trdir_rahmen.
CALL FUNCTION 'RS_EDTR_ATTRIBUTE'
EXPORTING
NAME = space
NEW_OR_MODF = 'NEW'
PROGRAM = oasis
REPORT_TITLE = 'GENERATED'
TYPE = 'I'
UPPER_LOWER_CASE = 'X'
TRDIR_RAHMEN = TRDIR_RAHMEN
TYPE_SWITCH_ALLOWED = ' '
* IMPORTING
* NEXT_ACTION =
* NEW_TRDIR =
EXCEPTIONS
NOT_EXECUTED = 1
PROGRAM_ENQUEUED = 2
ERROR_MESSAGE = 3
OTHERS = 4
.
IF SY-SUBRC <> 0.
error NOT_EXECUTED = 1.
error PROGRAM_ENQUEUED = 2.
error ERROR_MESSAGE = 3.
error OTHERS = 4.
concatenate 'funcpool' name
'cant insert and create include'
'(Fb. RS_EDTR_ATTRIBUTE)' into error_text
separated by space.
call method error_handling=>error_question
EXPORTING
error_text = error_text.
* error_message error_text 'E'. "Makro
raise error.
ENDIF.
endif.
endif.
endloop.
endmethod. "create_fgroup_includes
method create_fgroup_fbs.
field-symbols <fmodule> type tfmodule.
data fmodule_upload type ref to fmodule_upload.
create object fmodule_upload.
loop at fgroup-fmodules assigning <fmodule>.
call method fmodule_upload->create_fmodule
EXPORTING
i_fmodule = <fmodule>
EXCEPTIONS
error = 1
others = 2.
if sy-subrc ne 0.
raise error.
endif.
endloop.
endmethod. "create_fgroup_fbs
method create_fgroup_dynpros.
field-symbols: <dynpro> type tdynpro.
loop at fgroup-dynpros assigning <dynpro>.
call method rdynpro->set_dynpro
EXPORTING
i_dynpro = <dynpro>.
call method rdynpro->create_dynpro
EXCEPTIONS
error = 1
others = 2.
if sy-subrc ne 0.
raise error.
endif.
*---------------------------------------------------------------------*
* CLASS program_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class program_upload definition.
public section.
methods: constructor,
set_program importing i_program type tprogram,
create_program exceptions error.
private section.
DATA: program type tprogram,
rdynpro type ref to dynpro_upload,
error_text type string.
methods: program_insert exceptions error,
textpool_insert,
dynpros_insert exceptions error.
endclass. "program_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS program_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class program_upload implementation.
*---------------------------------------------------------------------*
* CLASS typegroup_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class typegroup_upload definition.
public section.
methods: set_typegroup importing i_typegroup type ttypegroup,
create_typegroup exceptions error.
private section.
DATA: typegroup type ttypegroup,
error_text type string.
endclass. "typegroup_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS typegroup_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class typegroup_upload implementation.
method set_typegroup.
typegroup = i_typegroup.
endmethod. "set_typegroup
method create_typegroup.
data: objname type RSEDD0-TYPEGROUP,
text type DDTYPET.
if not typegroup-texts is initial.
loop at typegroup-texts into text
where ddlanguage eq sy-langu.
endloop.
if sy-subrc ne 0.
read table typegroup-texts into text index 1.
endif.
else.
move 'Oasis' to text-ddtext.
endif.
*****************************************************
* Package zuordnen
*****************************************************
data name type string.
concatenate 'DOMA' domain-name into name.
field-symbols <table> type ttable.
data: ptables type ttables.
* Sortieren wegen Includes und Appends
loop at p-tables assigning <table>.
if <table>-tabclass eq 'TRANSP'.
append <table> to ptables.
else.
insert <table> into ptables index 1.
endif.
endloop.
move ptables to p-tables.
free ptables.
endmethod. "determine_sequence
endclass. "tables_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS view_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class view_upload definition.
public section.
methods: set_view importing i_view type tview,
create_view exceptions error.
private section.
DATA: view type tview,
error_text type string.
endclass. "view_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS view_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class view_upload implementation.
method set_view.
view = i_view.
endmethod. "set_table
method create_view.
select count( * ) from dd02l
where tabname eq view-name
and tabclass eq 'VIEW'.
if sy-subrc eq 0.
concatenate 'View' view-name 'already exists'
into error_text
separated by space.
call method error_handling=>error_question
EXPORTING
error_text = error_text.
* error_message error_text 'E'. "Makro
raise error.
endif.
*---------------------------------------------------------------------*
* CLASS choose_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_upload definition.
public section.
methods choose.
private section.
* Objekte, die zur Auswahl angezeigt werden
DATA: begin of object.
include type SEOCMPKEY.
data: checkbox.
data: end of object.
DATA: objects like standard table of object.
* Methoden
methods: choice,
accept_choice.
endclass. "choose_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS choose_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_upload implementation.
method choose.
* Auswahl treffen
call method choice.
if flag_popup_abg eq space.
* Zuvor wurde ausgewaehlt
call method accept_choice.
else.
free p.
message S000(38) with 'Canceled'.
endif.
endmethod. "choose
method choice.
* Funktionscodes
data: FUNCTIONS type standard table of SVALP,
w_function like line of functions.
field-symbols:
<class> type tclass,
<inter> type tinter,
<fgroup> type tfgroup,
<program> type tprogram,
<domain> type tdomain,
<dataelement> type tdataelement,
<table> type ttable,
<tabletype> type ttabletype,
<shlp> type tshlp,
<view> type tview,
<typegroup> type ttypegroup.
move 'OK' to w_function-func_name.
move sy-cprog to w_function-prog_name.
if download eq 'X'.
move 'AUSWAHL_DOWNLOAD' to w_function-form_name.
elseif upload eq 'X'.
move 'AUSWAHL_UPLOAD' to w_function-form_name.
endif.
append w_function to functions.
* Objects fuellen
loop at p-domains assigning <domain>.
move <domain>-name to object-clsname.
move c_ch_domain to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-dataelements assigning <dataelement>.
move <dataelement>-name to object-clsname.
move c_ch_delement to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-searchhelps assigning <shlp>.
move <shlp>-name to object-clsname.
move c_ch_searchelp to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-tables assigning <table>.
move <table>-name to object-clsname.
move c_ch_table to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-views assigning <view>.
move <view>-name to object-clsname.
move c_ch_viewname to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-tabletypes assigning <tabletype>.
move <tabletype>-name to object-clsname.
move c_ch_tabletype to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-typegroups assigning <typegroup>.
move <typegroup>-name to object-clsname.
move c_ch_typegroup to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-inters assigning <inter>.
move <inter>-intkey-clsname to object-clsname.
move c_ch_Interface to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-classes assigning <class>.
move <class>-cifkey-clsname to object-clsname.
move C_ch_Class to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-programs assigning <program>.
move <program>-name to object-clsname.
case <program>-subc.
when 'I'.
move c_ch_include to object-cmpname.
when others.
move c_ch_program to object-cmpname.
endcase.
move 'X' to object-checkbox.
append object to objects.
endloop.
loop at p-fgroups assigning <fgroup>.
move <fgroup>-area to object-clsname.
move c_ch_Fgroup to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
endloop.
* Popup anzeigen
if not objects[] is initial.
move 'X' to flag_POPUP_abg.
CALL FUNCTION 'POPUP_GET_SELECTION_FROM_LIST'
EXPORTING
DISPLAY_ONLY = 'X'
TABLE_NAME = 'SEOCMPKEY'
TITLE_BAR = 'Selection'
TABLES
LIST = objects
FUNCTIONS = functions
EXCEPTIONS
NO_TABLEFIELDS_IN_DICTIONARY = 1
NO_TABLE_STRUCTURE = 2
NO_TITLE_BAR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
endmethod. "choice
method accept_choice.
field-symbols: <class> type tclass,
<inter> type tinter,
<fgroup> type tfgroup,
<program> type tprogram,
<domain> type tdomain,
<dataelement> type tdataelement,
<table> type ttable,
<typegroup> type ttypegroup,
<tabletype> type ttabletype,
<shlp> type tshlp,
<view> type tview.
loop at p-classes assigning <class>.
read table objects into object
with key clsname = <class>-cifkey-clsname
cmpname = c_ch_class
checkbox = space.
if sy-subrc eq 0.
delete p-classes.
endif.
endloop.
loop at p-inters assigning <inter>.
read table objects into object
with key clsname = <inter>-intkey-clsname
cmpname = c_ch_interface
checkbox = space.
if sy-subrc eq 0.
delete p-inters.
endif.
endloop.
loop at p-fgroups assigning <fgroup>.
read table objects into object
with key clsname = <fgroup>-area
cmpname = c_ch_Fgroup
checkbox = space.
if sy-subrc eq 0.
delete p-fgroups.
continue.
endif.
endloop.
loop at p-programs assigning <program>.
read table objects into object
with key clsname = <program>-name
cmpname = c_ch_program
checkbox = space.
if sy-subrc eq 0.
delete p-programs.
else.
read table objects into object
with key clsname = <program>-name
cmpname = c_ch_include
checkbox = space.
if sy-subrc eq 0.
delete p-programs.
continue.
endif.
endif.
endloop.
loop at p-typegroups assigning <typegroup>.
read table objects into object
with key clsname = <typegroup>-name
cmpname = c_ch_typegroup
checkbox = space.
if sy-subrc eq 0.
delete p-typegroups.
continue.
endif.
endloop.
loop at p-domains assigning <domain>.
read table objects into object
with key clsname = <domain>-name
cmpname = c_ch_domain
checkbox = space.
if sy-subrc eq 0.
delete p-domains.
endif.
endloop.
loop at p-dataelements assigning <dataelement>.
read table objects into object
with key clsname = <dataelement>-name
cmpname = c_ch_delement
checkbox = space.
if sy-subrc eq 0.
delete p-dataelements.
endif.
endloop.
loop at p-tables assigning <table>.
read table objects into object
with key clsname = <table>-name
cmpname = c_ch_table
checkbox = space.
if sy-subrc eq 0.
delete p-tables.
endif.
endloop.
loop at p-tabletypes assigning <tabletype>.
read table objects into object
with key clsname = <tabletype>-name
cmpname = c_ch_tabletype
checkbox = space.
if sy-subrc eq 0.
delete p-tabletypes.
endif.
endloop.
loop at p-searchhelps assigning <shlp>.
read table objects into object
with key clsname = <shlp>-name
cmpname = c_ch_searchelp
checkbox = space.
if sy-subrc eq 0.
delete p-searchhelps.
endif.
endloop.
loop at p-views assigning <view>.
read table objects into object
with key clsname = <view>-name
cmpname = c_ch_viewname
checkbox = space.
if sy-subrc eq 0.
delete p-views.
endif.
endloop.
endmethod. "accept_choice
endclass. "choose_upload IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS choose_upload_index DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_upload_index definition.
public section.
methods: choose exporting e_index type tindex_table,
constructor importing i_index type tindex_table,
set_index importing i_index type tindex_table,
get_index exporting e_index type tindex_table.
private section.
* Objekte, die zur Auswahl angezeigt werden
DATA: begin of object.
include type SEOCMPKEY.
data: checkbox.
data: end of object.
DATA: objects like standard table of object.
* Index-Datei
DATA: index type tindex_table,
w_index like line of index.
* Methoden
methods: choice,
accept_choice.
endclass. "choose_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS choose_upload_index IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_upload_index implementation.
method constructor.
index = i_index.
endmethod. "constructor
method set_index.
index = i_index.
endmethod. "set_index
method get_index.
e_index = index.
endmethod. "get_index
method choose.
* Auswahl treffen
call method choice.
if flag_popup_abg eq space.
* Zuvor wurde ausgewaehlt
call method accept_choice.
else.
free index.
message S000(38) with 'Canceled'.
endif.
* Index Tabelle zuordnen
e_index = index.
endmethod. "choose
method choice.
* Funktionscodes
data: FUNCTIONS type standard table of SVALP,
w_function like line of functions.
move 'OK' to w_function-func_name.
move sy-cprog to w_function-prog_name.
if download eq 'X'.
move 'AUSWAHL_DOWNLOAD' to w_function-form_name.
elseif upload eq 'X'.
move 'AUSWAHL_UPLOAD' to w_function-form_name.
endif.
append w_function to functions.
* interne Auswahltabelle fuellen
Loop at index into w_index.
move w_index-name to object-clsname.
move w_index-type to object-cmpname.
move 'X' to object-checkbox.
append object to objects.
Endloop.
* Popup anzeigen
if not objects[] is initial.
move 'X' to flag_POPUP_abg.
CALL FUNCTION 'POPUP_GET_SELECTION_FROM_LIST'
EXPORTING
DISPLAY_ONLY = 'X'
TABLE_NAME = 'SEOCMPKEY'
TITLE_BAR = 'Selection'
TABLES
LIST = objects
FUNCTIONS = functions
EXCEPTIONS
NO_TABLEFIELDS_IN_DICTIONARY = 1
NO_TABLE_STRUCTURE = 2
NO_TITLE_BAR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
endmethod. "choice
method accept_choice.
loop at index into w_index.
read table objects into object
with key clsname = w_index-name
cmpname = w_index-type
checkbox = space.
if sy-subrc eq 0.
delete index.
endif.
endloop.
endmethod. "accept_choice
endclass. "choose_upload_index IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS xml_upload DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class xml_upload definition.
public section.
methods: upload_XML_file
importing filename type localfile
exporting dataobject type any
exceptions error,
constructor.
private section.
data: XMLDOC type ref to CL_XML_DOCUMENT.
data: RETCODE type SY-SUBRC.
endclass. "xml_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS xml_upload IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class xml_upload implementation.
****************************
* XML-Datei lesen
****************************
if filename ne SPACE.
RETCODE = XMLDOC->IMPORT_FROM_FILE( filename ).
if retcode eq 0.
write: / retcode, 'Import from PC File', filename color
col_total.
new-line.
*********************************
* XML-Datei in interne Tabelle
*********************************
call method XMLDOC->GET_DATA
CHANGING
DATAOBJECT = dataobject.
else.
write: / retcode color col_negative,
'Error Cant Import from PC File' color col_negative,
filename color col_negative.
new-line.
raise error.
endif.
else.
raise error.
endif.
*---------------------------------------------------------------------*
* CLASS create DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class create definition.
public section.
methods: create.
private section.
data: domains_upload type ref to domains_upload.
data: delements_upload type ref to delements_upload.
data: tables_upload type ref to tables_upload.
data: views_upload type ref to views_upload.
data: tabletypes_upload type ref to tabletypes_upload.
data: shlps_upload type ref to shlps_upload.
data: typegroups_upload type ref to typegroups_upload.
data: interfaces_upload type ref to interfaces_upload.
data: classes_upload type ref to classes_upload.
data: fgroups_upload type ref to fgroups_upload.
data: programs_upload type ref to programs_upload.
endclass. "create DEFINITION
*---------------------------------------------------------------------*
* CLASS create IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class create implementation.
method create.
* Kommentar: Reihenfolge entscheidend !!
* Domains einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-domains is initial.
if not domains_upload is bound.
create object domains_upload.
endif.
call method domains_upload->domains_create.
free p-domains. " Speicher freigeben
endif.
* Dataelements einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-dataelements is initial.
if not delements_upload is bound.
create object delements_upload.
endif.
call method delements_upload->delements_create.
free p-dataelements. " Speicher freigeben
endif.
* Searchhelps einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-searchhelps is initial.
if not shlps_upload is bound.
create object shlps_upload.
endif.
call method shlps_upload->shlps_create.
free p-searchhelps. " Speicher freigeben
endif.
* Tables einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-tables is initial.
if not tables_upload is bound.
create object tables_upload.
endif.
call method tables_upload->tables_create.
free p-tables. " Speicher freigeben
endif.
* Views einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-views is initial.
if not views_upload is bound.
create object views_upload.
endif.
call method views_upload->views_create.
free p-views. " Speicher freigeben
endif.
* Tabletypes einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-tabletypes is initial.
if not tabletypes_upload is bound.
create object tabletypes_upload.
endif.
call method tabletypes_upload->tabletypes_create.
free p-tabletypes. " Speicher freigeben
endif.
* Typegroups einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-typegroups is initial.
if not typegroups_upload is bound.
create object typegroups_upload.
endif.
call method typegroups_upload->typegroups_create.
free p-typegroups.
endif.
* Interfaces einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-inters is initial.
if not interfaces_upload is bound.
create object interfaces_upload.
endif.
call method interfaces_upload->interfaces_create.
free p-inters. " Speicher freigeben
endif.
* Klassen einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-classes is initial.
if not classes_upload is bound.
create object classes_upload.
endif.
call method classes_upload->classes_create.
free p-classes. " Speicher freigeben
endif.
* Programme einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-programs is initial.
if not programs_upload is bound.
create object programs_upload.
endif.
call method programs_upload->programs_create.
free p-programs.
endif.
* Funktionsgruppen einspielen
check not gv_flg_stop_upload_processing eq 'X'.
if not p-fgroups is initial.
if not fgroups_upload is bound.
create object fgroups_upload.
endif.
call method fgroups_upload->fgroups_create.
free p-fgroups. "Speicher freigeben
endif.
endmethod. "create
endclass. "create IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS start_upload_index DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class start_upload_index definition.
public section.
* Methoden
methods: upload,
constructor
importing i_index type tindex_table
i_rxml_upload type ref to xml_upload,
set_index importing i_index type tindex_table.
private section.
data: rchoose_upload_index type ref to choose_upload_index,
index type tindex_table,
w_index like line of index,
rxml_upload type ref to xml_upload,
rcreate type ref to create.
data: path_oasis type localfile.
endclass. "start_upload DEFINITION
*---------------------------------------------------------------------*
* CLASS start_upload_index IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class start_upload_index implementation.
method constructor.
index = i_index.
* Auswahl Objekt erzeugen
create object rchoose_upload_index
exporting i_index = index.
* xml Upload Objekt
rxml_upload = i_rxml_upload.
* Create Objekt anlegen
create object rcreate.
* Pfad festlegen
move pcfile1 to path_oasis.
SET LOCALE LANGUAGE 'D'.
translate path_oasis to upper case.
SET LOCALE LANGUAGE sy-langu.
replace c_file_index_xml in path_oasis with space.
call method rchoose_upload->choose.
if not p is initial.
call method create.
endif.
endmethod. "UPLOAD
method create.
call method rcreate->create.
endmethod. "create
endclass. "start_upload_single IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS xml_download DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class xml_download definition.
public section.
* Types
types: begin of TNODE,
NAME type STRING,
NODE type ref to IF_IXML_NODE,
NODELIST type ref to IF_IXML_NODE_LIST,
end of TNODE.
* Methods
methods: download_XML,
download_XML_single_file
importing p type tp
filename type LOCALFILE
exceptions error,
download_XML_index_file
importing index type tindex_table
exceptions error,
get_size_of_xml
importing p type tp
exporting size type sytabix
exceptions error,
constructor.
* statische Methoden
class-methods: check_if_file_exists
importing i_filename type localfile
exporting e_flg_file_exists type as4flag.
private section.
* Attribute XML
data: XMLDOC type ref to CL_XML_DOCUMENT.
data: RETCODE type SY-SUBRC.
* private Methoden
methods: TAB2XML importing p type tp,
XML_APPEND_SOURCES_AS_CDATA importing p type tp,
XML_cdata_source_classes
importing p type tp
clsname type tclass-cifkey-clsname
exporting source type seop_source
changing node type tnode,
XML_cdata_source_fgroups
importing p type tp
area type tfgroup-area
exporting source type seop_source
changing node type tnode,
XML_cdata_source_programs
importing p type tp
name type tprogram-name
exporting source type seop_source
changing node type tnode,
XML_cdata_source_typegroups
importing p type tp
tname type ttypegroup-name
exporting source type seop_source
changing node type tnode,
save_xml_file importing i_filename type localfile
exporting retcode type sy-subrc
exceptions
canceled_by_user.
endclass. "xml_download DEFINITION
*---------------------------------------------------------------------*
* CLASS xml_load IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class xml_download implementation.
if flg_file_exists eq 'X'.
* Popup Soll ueberschrieben werden ?
endif.
RETCODE = XMLDOC->EXPORT_TO_FILE( i_filename ).
if retcode eq 0.
write: / retcode, 'Export to PC File', i_filename color col_total.
new-line.
else.
write: / retcode color col_negative,
'Error Cant Export to PC File' color col_negative,
i_filename color col_negative.
new-line.
endif.
if sfiles eq 'X'.
*********************************
* XML DOC erzeugen
*********************************
call method TAB2XML
EXPORTING
p = p.
*********************************
* Method Sorce in CDATA Segment
*********************************
if cdata eq 'X'.
call method XML_APPEND_SOURCES_AS_CDATA
EXPORTING
p = p.
endif.
*********************************
* Encoding zuweisen
*********************************
data: charset type string.
move c_xml_encoding_utf8 to charset.
CALL METHOD XMLDOC->SET_ENCODING
EXPORTING
CHARSET = charset.
*********************************
* XML DOC erzeugen
*********************************
call method TAB2XML
EXPORTING
p = p.
*********************************
* Method Sorce in CDATA Segment
*********************************
if cdata eq 'X'.
call method XML_APPEND_SOURCES_AS_CDATA
EXPORTING
p = p.
endif.
*********************************
* Globales Datenobjekt initialisieren, Speicher sparen
*********************************
free p.
*********************************
* Encoding zuweisen
*********************************
data: charset type string.
move c_xml_encoding_utf8 to charset.
CALL METHOD XMLDOC->SET_ENCODING
EXPORTING
CHARSET = charset.
*********************************
* XML Dokument in File speichern
*********************************
if save eq 'X'.
if disp_onl ne 'X'.
if PCFILE ne SPACE.
call method save_xml_file
EXPORTING
i_filename = pcfile
IMPORTING
retcode = retcode
EXCEPTIONS
canceled_by_user = 1
others = 2.
endif.
endif.
endif.
*********************************
* XML Dokument anzeigen
*********************************
DATA: table type standard table of ABAPTXT255.
if display eq 'X'.
XMLDOC->DISPLAY( ).
endif.
call method XMLDOC->CREATE_WITH_DATA
exporting
* NAME = 'DATA'
DATAOBJECT = p
receiving
RETCODE = RETCODE .
endmethod. "TAB2XML
method XML_APPEND_SOURCES_AS_CDATA.
* Datendeklarationen
data: NODE type tnode.
data: XMLCDATA type ref to IF_IXML_CDATA_SECTION.
data: CDATA type STRING.
DATA: RVAL_ITERATOR type ref to IF_IXML_NODE_ITERATOR.
data: source type seop_source.
* Konstanten
constants:
c_name_clsname type string
value '/DATA/CLASSES/item/CIFKEY',
c_name_area type string
value '/DATA/FGROUPS/item',
c_name_name type string
value '/DATA/PROGRAMS/item',
c_name_tname type string
value '/DATA/TYPEGROUPS/item'.
* Classname
data: clsname type tclass-cifkey-clsname.
* Fgroupname
data: area type tfgroup-area.
* Programmname
data: name type tprogram-name.
* Typegroup
data: tname type ttypegroup-name.
* Iteration ueber das XML Dokument
call method XMLDOC->m_document->IF_IXML_NODE~CREATE_ITERATOR
RECEIVING
rval = rval_iterator.
* Name der Klasse
if node-name eq c_name_clsname.
CLSNAME =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'CLSNAME'
ROOT = NODE-NODE ).
endif.
* Name der Fgruppe
if node-name eq c_name_area.
AREA =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'AREA'
ROOT = NODE-NODE ).
endif.
* Name Programm lesen
if node-name eq c_name_name.
name =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'NAME'
ROOT = NODE-NODE ).
endif.
* Name der Typegroup
if node-name eq c_name_tname.
tname = XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'NAME'
ROOT = NODE-NODE ).
endif.
* Source als CDATA anhaengen
if not source[] is initial.
clear cdata.
call function 'COPY_CTAB_TO_STRING'
* EXPORTING
* DATA_LEN = 0
importing
DATA_OUT = CDATA
tables
DATA_IN = SOURCE.
XMLCDATA = XMLDOC->M_DOCUMENT->CREATE_CDATA_SECTION(
CDATA = CDATA ).
NODE-NODE->APPEND_CHILD( NEW_CHILD = XMLCDATA ).
endif.
else.
* Am Ende angelangt
exit.
endif.
enddo.
endmethod. "XML_APPEND_SOURCES_AS_CDATA
method XML_cdata_source_classes.
CONSTANTS: c_NAME_METHODS type string
value '/DATA/CLASSES/item/METHODS/item',
c_NAME_sections type string
value '/DATA/CLASSES/item/SECTIONS/item',
c_NAME_REDEF type string
value '/DATA/CLASSES/item/METHODS_REDEF/item',
c_NAME_IMPL type string
value '/DATA/CLASSES/item/METHODS_IMPL/item',
c_NAME_LOCALS type string
value '/DATA/CLASSES/item/LOCALS/item'.
field-symbols <class> type tclass.
data: CMPKEY type SEOCMPKEY.
case node-name.
* Source Methoden
when c_NAME_METHODS.
field-symbols <method> type tymethod.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
CMPKEY-CLSNAME =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'CLSNAME'
ROOT = NODE-NODE ).
CMPKEY-CMPNAME =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'CMPNAME'
ROOT = NODE-NODE ).
if not CMPKEY-CLSNAME is initial
and not CMPKEY-CMPNAME is initial.
loop at p-classes assigning <class>
where cifkey-clsname eq cmpkey-clsname.
read table <class>-METHODS assigning <method>
with key CMPKEY-CLSNAME = CMPKEY-CLSNAME
CMPKEY-CMPNAME = CMPKEY-CMPNAME.
if sy-subrc eq 0.
move <method>-source to source.
endif.
endloop.
endif.
* Source Sektionen
when c_NAME_sections.
field-symbols: <sections> type line of tclass-sections.
data: limu type tsection-limu.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
LIMU =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'LIMU'
ROOT = NODE-NODE ).
if not CLSNAME is initial
and not limu is initial.
loop at p-classes assigning <class>
where cifkey-clsname eq clsname.
read table <class>-sections assigning <sections>
with key limu = limu.
if sy-subrc eq 0.
move <sections>-source to source.
endif.
endloop.
endif.
* Source Redef
when c_NAME_REDEF.
field-symbols: <method_redef> type TREDEFINITION.
data: mCMPNAME type TREDEFINITION-method-CMPNAME.
if not CLSNAME is initial
and not mCMPNAME is initial.
loop at p-classes assigning <class>
where cifkey-clsname eq clsname.
read table <class>-METHODS_REDEF
assigning <method_redef>
with key method-cmpname = mCMPNAME.
if sy-subrc eq 0.
move <method_redef>-source to source.
endif.
endloop.
endif.
when c_NAME_IMPL.
field-symbols: <method_impl> type TIMPLMETHOD.
data: iCMPNAME type TIMPLMETHOD-method-CMPNAME.
if not CLSNAME is initial
and not iCMPNAME is initial.
loop at p-classes assigning <class>
where cifkey-clsname eq clsname.
read table <class>-METHODS_IMPL
assigning <method_impl>
with key method-cmpname = iCMPNAME.
if sy-subrc eq 0.
move <method_impl>-source to source.
endif.
endloop.
endif.
* Source Locals
when c_NAME_LOCALS.
field-symbols: <local> type line of tclass-locals.
data: name type tlocal-name.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
name =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'NAME'
ROOT = NODE-NODE ).
if not CLSNAME is initial
and not name is initial.
loop at p-classes assigning <class>
where cifkey-clsname eq clsname.
read table <class>-locals assigning <local>
with key name = name.
if sy-subrc eq 0.
move <local>-source_locals to source.
endif.
endloop.
endif.
endcase.
endmethod. "XML_cdata_source_classes
method XML_cdata_source_fgroups.
CONSTANTS: c_NAME_FMODULES type string
value '/DATA/FGROUPS/item/FMODULES/item',
c_NAME_INCLUDES type string
value '/DATA/FGROUPS/item/INCLUDES/item',
c_NAME_DYNPROS type string
value '/DATA/FGROUPS/item/DYNPROS/item'.
field-symbols <fgroup> type tfgroup.
data: funcname type tfmodule-funcname.
case node-name.
* Source Funktionsbausteine
when c_NAME_FMODULES.
field-symbols <fmodule> type tfmodule.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
funcname =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'FUNCNAME'
ROOT = NODE-NODE ).
if not area is initial
and not funcname is initial.
loop at p-fgroups assigning <fgroup>
where area = area.
read table <fgroup>-fmodules assigning <fmodule>
with key funcname = funcname.
if sy-subrc eq 0.
move <fmodule>-source to source.
endif.
endloop.
endif.
* Source Includes
when c_NAME_INCLUDES.
field-symbols <include> type tinclude.
data: include type tinclude-include.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
include =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'INCLUDE'
ROOT = NODE-NODE ).
if not area is initial
and not include is initial.
loop at p-fgroups assigning <fgroup>
where area = area.
read table <fgroup>-includes assigning <include>
with key include = include.
if sy-subrc eq 0.
move <include>-source to source.
endif.
endloop.
endif.
when c_NAME_DYNPROS.
field-symbols <dynpro> type tdynpro.
data: dynnr type tdynpro-dynnr.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
dynnr =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'DYNNR'
ROOT = NODE-NODE ).
if not area is initial
and not dynnr is initial.
loop at p-fgroups assigning <fgroup>
where area = area.
read table <fgroup>-dynpros assigning <dynpro>
with key dynnr = dynnr.
if sy-subrc eq 0.
move <dynpro>-FLOW_LOGIC to source.
endif.
endloop.
endif.
endcase.
endmethod. "XML_cdata_source_classes
method XML_cdata_source_programs.
CONSTANTS: c_NAME_NAME type string
value '/DATA/PROGRAMS/item',
c_NAME_DYNPROS type string
value '/DATA/PROGRAMS/item/DYNPROS/item'.
field-symbols: <program> type tprogram.
case node-name.
* Source Includes
when c_NAME_name.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
if not name is initial.
loop at p-programs assigning <program>
where name = name.
move <program>-source to source.
exit.
endloop.
endif.
when c_NAME_dynpros.
field-symbols <dynpro> type tdynpro.
data: dynnr type tdynpro-dynnr.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
dynnr =
XMLDOC->FIND_SIMPLE_ELEMENT( NAME = 'DYNNR'
ROOT = NODE-NODE ).
if not name is initial
and not dynnr is initial.
loop at p-programs assigning <program>
where name = name.
read table <program>-dynpros assigning <dynpro>
with key dynnr = dynnr.
if sy-subrc eq 0.
move <dynpro>-FLOW_LOGIC to source.
endif.
endloop.
endif.
endcase.
endmethod. "XML_cdata_source_classes
method XML_cdata_source_typegroups.
CONSTANTS: c_NAME_TNAME type string
value '/DATA/TYPEGROUPS/item'.
field-symbols: <typegroup> type ttypegroup.
case node-name.
* Source Includes
when c_NAME_tname.
NODE-NODELIST = NODE-NODE->GET_CHILDREN( ).
if not tname is initial.
loop at p-typegroups assigning <typegroup>
where name = tname.
move <typegroup>-source to source.
exit.
endloop.
endif.
endcase.
endmethod. "XML_cdata_source_typegroups
endclass. "xml_download IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS txt_download DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class txt_download definition.
public section.
methods: constructor,
txt_source_classes
importing p type tp
exceptions error,
txt_source_fgroups
importing p type tp
exceptions error,
txt_source_programs
importing p type tp
exceptions error,
txt_source_typegroups
importing p type tp
exceptions error.
* Class Methods
class-methods: check_filename changing filename type string.
private section.
data: oasis type localfile.
methods: download_txt
importing filename type string
source type seop_source
exceptions error.
* statische Attribute
class-data: zahl(3) type n.
endclass. "txt_download DEFINITION
*---------------------------------------------------------------------*
* CLASS txt_download IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class txt_download implementation.
method constructor.
move path1 to oasis.
endmethod. "constructor
method download_txt.
check ctxt eq 'X'.
data: flg_file_exists,
filename_xy type localfile.
if sy-subrc eq 0.
write: / sy-subrc, 'Export to PC File', filename color col_total.
new-line.
else.
write: / sy-subrc color col_negative,
'Error Cant Export to PC File' color col_negative,
filename color col_negative.
new-line.
raise error.
endif.
endmethod. "download_txt
method check_filename.
* Dateiname ueberpruefen
if filename ca '<>?:'.
zahl = zahl + 1.
replace ALL OCCURRENCES OF '<' in filename with space.
replace ALL OCCURRENCES OF '>' in filename with space.
replace ALL OCCURRENCES OF '?' in filename with space.
replace ALL OCCURRENCES OF ':' in filename with space.
condense filename no-gaps.
concatenate filename '_' zahl into filename.
endif.
endmethod. "check_filename
method txt_source_classes.
field-symbols <class> type tclass.
data: filename type string.
* Source Methoden
field-symbols <method> type tymethod.
loop at p-classes assigning <class>.
loop at <class>-METHODS assigning <method>.
concatenate C_ch_Class_method
'_'
<method>-CMPKEY-CLSNAME
'_'
<method>-CMPKEY-CMPNAME
into filename.
* Source Sektionen
field-symbols: <sections> type line of tclass-sections.
loop at p-classes assigning <class>.
Loop at <class>-sections assigning <sections>.
concatenate C_ch_Class_section
'_'
<class>-CIFKEY-CLSNAME
'_'
<sections>-incname
into filename.
* Source Locals
field-symbols: <local> type line of tclass-locals.
loop at p-classes assigning <class>.
loop at <class>-locals assigning <local>.
concatenate C_ch_Class_locals
'_'
<class>-CIFKEY-CLSNAME
'_'
<local>-NAME
into filename.
* Source Dynpros
field-symbols <dynpro> type tdynpro.
data: source type seop_source,
ls_source like line of source,
ls_flow_logic like line of <dynpro>-flow_logic.
loop at p-fgroups assigning <fgroup>.
loop at <fgroup>-dynpros assigning <dynpro>.
concatenate C_ch_Area_Dynpro
'_'
<fgroup>-area
'_'
<dynpro>-dynnr
into filename.
call method check_filename
CHANGING
filename = filename.
concatenate oasis filename '.TXT' into filename.
Loop at <dynpro>-flow_logic into ls_flow_logic.
move ls_flow_logic to ls_source.
append ls_source to source.
Endloop.
field-symbols: <typegroup> type ttypegroup.
data: filename type string.
data: source type seop_source,
ls_source like line of source,
ls_ty_source like line of <typegroup>-source.
*---------------------------------------------------------------------*
* CLASS choose_download DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_download definition.
public section.
methods choose changing t_tadir type ttadir_table.
private section.
* Attribute
* Objekte, die zur Auswahl angezeigt werden
DATA: begin of object.
include type SEOSCOKEY.
data: checkbox.
data: end of object.
DATA: objects like standard table of object.
* Hilfsvariablen
* Ulrich Streit
DATA: w_tadir type tadir.
* Methoden
methods: choice importing t_tadir type ttadir_table,
accept_choice changing t_tadir type ttadir_table,
warning_single_xml_file changing t_tadir type ttadir_table.
endclass. "choose_download DEFINITION
*---------------------------------------------------------------------*
* CLASS choose_download IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class choose_download implementation.
* Funktionscodes
data: FUNCTIONS type standard table of SVALP,
w_function like line of functions.
move 'OK' to w_function-func_name.
move sy-cprog to w_function-prog_name.
if download eq 'X'.
move 'AUSWAHL_DOWNLOAD' to w_function-form_name.
elseif upload eq 'X'.
move 'AUSWAHL_UPLOAD' to w_function-form_name.
endif.
append w_function to functions.
* Objects fuellen
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DOMA.
move w_tadir-obj_name to object-clsname.
move c_ch_domain to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DTEL.
move w_tadir-obj_name to object-clsname.
move c_ch_delement to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_SHLP.
move w_tadir-obj_name to object-clsname.
move c_ch_searchelp to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TABL.
move w_tadir-obj_name to object-clsname.
move c_ch_table to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_VIEW.
move w_tadir-obj_name to object-clsname.
move c_ch_viewname to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TTYP.
move w_tadir-obj_name to object-clsname.
move c_ch_tabletype to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TYPE.
move w_tadir-obj_name to object-clsname.
move c_ch_typegroup to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_INTF.
move w_tadir-obj_name to object-clsname.
move c_ch_Interface to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_CLAS.
move w_tadir-obj_name to object-clsname.
move C_ch_Class to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_PROG.
move w_tadir-obj_name to object-clsname.
move c_ch_program to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_FUGR.
move w_tadir-obj_name to object-clsname.
move c_ch_Fgroup to object-cmpname.
move w_tadir-devclass to object-sconame.
move 'X' to object-checkbox.
append object to objects.
clear object.
endloop.
* Popup anzeigen
if not objects[] is initial.
move 'X' to flag_POPUP_abg.
CALL FUNCTION 'POPUP_GET_SELECTION_FROM_LIST'
EXPORTING
DISPLAY_ONLY = 'X'
TABLE_NAME = 'SEOSCOKEY'
TITLE_BAR = 'Selection'
TABLES
LIST = objects
FUNCTIONS = functions
EXCEPTIONS
NO_TABLEFIELDS_IN_DICTIONARY = 1
NO_TABLE_STRUCTURE = 2
NO_TITLE_BAR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
endmethod. "auswahl
method accept_choice.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_CLAS.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_class
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_INTF.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_interface
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_FUGR.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_Fgroup
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_PROG.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_program
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DOMA.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_domain
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DTEL.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_delement
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TABL.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_table
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_VIEW.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_viewname
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TTYP.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_tabletype
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_SHLP.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_searchelp
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TYPE.
read table objects into object
with key clsname = w_tadir-obj_name
cmpname = c_ch_typegroup
checkbox = space.
if sy-subrc eq 0.
delete t_tadir.
endif.
endloop.
*---------------------------------------------------------------------*
* CLASS crosssource DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class crosssource definition.
public section.
methods: constructor importing i_tadir type ttadir_table,
crosssource exporting e_tadir type ttadir_table.
private section.
* Attribute
data: t_tadir type standard table of tadir,
t_tadir_cross type standard table of tadir,
w_tadir like line of t_tadir.
* Methoden
methods: crossref_scan,
crossref_cl_abap_compiler
importing i_name type program
i_include type program optional
changing ABAP_GLREFS_TAGS type TABAP_GLREFS_TAGS,
crossref_tadir
importing ABAP_GLREFS_TAGS type TABAP_GLREFS_TAGS,
cross_friends_and_superclasses.
endclass. "crosssource DEFINITION
*---------------------------------------------------------------------*
* CLASS crosssource IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class crosssource implementation.
method constructor.
t_tadir_cross = i_tadir.
t_tadir = i_tadir.
endmethod. "constructor
method crosssource.
* Lokale Datendeklaration
data: lines1 type i,
zaehler type i.
* Crossref ueber den Source machen
do.
if not grade is initial.
if sy-index > grade.
exit.
endif.
endif.
if not t_tadir is initial.
describe table t_tadir lines lines1.
call method crossref_scan.
zaehler = 0.
loop at t_tadir into w_tadir.
if zaehler < lines1.
delete t_tadir.
zaehler = zaehler + 1.
exit.
endif.
endloop.
loop at t_tadir into w_tadir.
read table t_tadir_cross
transporting no fields
with key pgmid = w_tadir-pgmid
object = w_tadir-object
obj_name = w_tadir-obj_name.
if sy-subrc ne 0.
append w_tadir to t_tadir_cross.
else.
delete t_tadir.
endif.
endloop.
else.
exit.
endif.
enddo.
* Rueckgabe
e_tadir = t_tadir_cross.
endmethod. "crossref
method crossref_scan.
data: name type program.
* Klassen
data: clskey type SEOCLSKEY.
* Compiler Cross Ref
data: ABAP_GLREFS_TAGS type TABAP_GLREFS_TAGS.
* Programme
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_prog.
move w_tadir-obj_name to name.
call method crossref_cl_abap_compiler
EXPORTING
i_name = name
CHANGING
ABAP_GLREFS_TAGS = ABAP_GLREFS_TAGS.
endloop.
* Funktionsgruppen
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_fugr.
concatenate c_sapl w_tadir-obj_name into name.
call method crossref_cl_abap_compiler
EXPORTING
i_name = name
CHANGING
ABAP_GLREFS_TAGS = ABAP_GLREFS_TAGS.
endloop.
* Typegroups
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_type.
concatenate '%_C' w_tadir-obj_name into name.
call method crossref_cl_abap_compiler
EXPORTING
i_name = name
CHANGING
ABAP_GLREFS_TAGS = ABAP_GLREFS_TAGS.
endloop.
* Klassen
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
move w_tadir-obj_name to clskey-clsname.
CALL FUNCTION 'SEO_CLASS_GET_INCLUDE_BY_NAME'
EXPORTING
CLSKEY = clskey
LIMU = seok_r3tr_class
* INCTYPE =
IMPORTING
PROGNAME = name
.
call method crossref_cl_abap_compiler
EXPORTING
i_name = name
CHANGING
ABAP_GLREFS_TAGS = ABAP_GLREFS_TAGS.
endloop.
* Cross Ref auswerten
call method crossref_tadir
EXPORTING
ABAP_GLREFS_TAGS = ABAP_GLREFS_TAGS.
* Superclasses and Friends
call method cross_friends_and_superclasses.
endmethod. "crossref_scan
method cross_friends_and_superclasses.
* Friends
data: w_refclsname type seofriends-refclsname.
if friends eq 'X'.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
select distinct refclsname from seofriends
into w_refclsname
where clsname eq w_tadir-obj_name.
if w_refclsname(1) eq c_z
or w_refclsname(1) eq c_y.
if not w_refclsname eq w_tadir-obj_name.
" nicht sich selbst
read table t_tadir_cross into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_clas
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endif.
endselect.
endloop.
endif.
* Superklassen
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
clear w_refclsname.
select refclsname from vseoextend
up to 1 rows
into w_refclsname
where clsname eq w_tadir-obj_name.
endselect.
if w_refclsname(1) eq c_z
or w_refclsname(1) eq c_y.
if not w_refclsname eq w_tadir-obj_name. " nicht sich selbst
read table t_tadir_cross into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_clas
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endif.
endloop.
endmethod. "friends_and_superclasses
method crossref_tadir.
data: ABAP_GLREFS_TAG type TABAP_GLREFS_TAG,
name type tfdir-pname.
loop at ABAP_GLREFS_TAGS INTO ABAP_GLREFS_TAG.
if ABAP_GLREFS_TAG-name(1) eq c_z
or ABAP_GLREFS_TAG-name(1) eq c_y.
case ABAP_GLREFS_TAG-TAG.
when 'TY'. " Type
* Datenelemente, Strukturen, Tabellentypen, Tabellen, Views
* Klassen, Interfaces
loop at t_tadir_cross into w_tadir
where pgmid eq c_ta_r3tr
and ( object eq c_ta_tabl
or object eq c_ta_ttyp
or object eq c_ta_view
or object eq c_ta_dtel
or object eq c_ta_clas
or object eq c_ta_intf )
and obj_name eq ABAP_GLREFS_TAG-name.
endloop.
if sy-subrc ne 0.
select * from tadir appending table t_tadir
where pgmid eq c_ta_r3tr
and ( object eq c_ta_tabl
or object eq c_ta_ttyp
or object eq c_ta_view
or object eq c_ta_dtel
or object eq c_ta_clas
or object eq c_ta_intf )
and obj_name eq ABAP_GLREFS_TAG-name.
endif.
when 'FU'.
loop at t_tadir_cross into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_fugr
and obj_name eq ABAP_GLREFS_TAG-name.
endloop.
if sy-subrc ne 0.
select single pname from tfdir into name
where funcname eq ABAP_GLREFS_TAG-name.
if sy-subrc eq 0.
move space to name(4).
shift name left deleting leading space.
select * from tadir appending table t_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_fugr
and obj_name eq name.
endif.
endif.
when 'TP'. " Typepool
loop at t_tadir_cross into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_TYPE
and obj_name eq ABAP_GLREFS_TAG-name.
endloop.
if sy-subrc ne 0.
select * from tadir appending table t_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_type
and obj_name eq ABAP_GLREFS_TAG-name.
endif.
when 'PR'.
* z.B. perform in program
if ABAP_GLREFS_TAG-glref-grade > 0.
loop at t_tadir_cross into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_prog
and obj_name eq ABAP_GLREFS_TAG-name.
endloop.
if sy-subrc ne 0.
select * from tadir appending table t_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_prog
and obj_name eq ABAP_GLREFS_TAG-name.
endif.
endif.
endcase.
endif.
endloop.
endmethod. "crossref_tadir
method crossref_cl_abap_compiler.
* ABAP Compiler
DATA: CL_ABAP_COMPILER type ref to CL_ABAP_COMPILER,
result type SCR_GLREFS,
w_result like line of result,
tag type SCR_TAG,
ABAP_GLREFS_TAG type TABAP_GLREFS_TAG.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
move w_result-full_name+4 to ABAP_GLREFS_TAG-name.
move w_result to ABAP_GLREFS_TAG-glref.
move tag to ABAP_GLREFS_TAG-tag.
if ABAP_GLREFS_TAG-name NA '\:'.
append ABAP_GLREFS_TAG to ABAP_GLREFS_TAGS.
endif.
clear ABAP_GLREFS_TAG.
ENDIF.
*---------------------------------------------------------------------*
* CLASS selectoptions DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class selectoptions definition.
public section.
methods selectoptions exporting e_tadir type ttadir_table.
private section.
* Attribute
data: t_tadir_dev type standard table of tadir,
w_tadir_dev like line of t_tadir_dev,
t_tadir type standard table of tadir,
w_tadir like line of t_tadir_dev,
rcrosssource type ref to crosssource.
* dataelements von tables
call method dataelements_of_tables.
* Domaenen von Datenelementen
call method domains_of_dataelements.
endmethod. "crossreference
method includes_in_programs.
* Includes muessen nicht nochmal gescannt werden
data: prognam type tadir-obj_name.
data: COMPO type standard table of SCOMPO,
CROSS_REF type standard table of CROSS,
INC type standard table of D010INC,
w_inc like line of inc.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_prog.
if sy-subrc eq 0.
loop at inc into w_inc
where include(1) eq c_z
or include(1) eq c_y.
if prognam ne w_inc-include. "nicht sich selbst
read table t_tadir
transporting no fields
with key
pgmid = c_ta_r3tr
object = c_ta_prog
obj_name = w_inc-include.
if sy-subrc ne 0.
select * from tadir appending table t_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_prog
and obj_name eq w_inc-include.
endif.
endif.
endloop.
endif.
endloop.
endmethod. "includes_in_programs
method tables_from_view.
* Evtl. Tabellen und Strukturen hinzunehmen
data: tabname type dd26s-tabname.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_view.
select tabname from dd26s
into tabname
where viewname eq w_tadir-obj_name
and ( tabname like c_z%
or tabname like c_y% )
and as4local eq 'A'. "only active
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_tabl
obj_name = tabname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_tabl
and obj_name eq tabname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "tables_from_view
method tables_from_tabletypes.
* Evtl. Strukturen nachlesen
data: w_dd40l type dd40l.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_TTYP.
select * from dd40l
into w_dd40l
where TYPENAME eq w_tadir-obj_name
and datatype eq 'STRU'
and AS4LOCAL eq 'A' " only active
and ( rowtype like c_z%
or rowtype like c_y% ).
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_TABL
obj_name = w_dd40l-rowtype.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_TABL
and obj_name eq w_dd40l-rowtype.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "tables_from_tabletypes
method tables_from_searchelps.
* abhaengige Tabelle dazunehmen
data: selmethod type dd30l-selmethod.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_shlp.
select selmethod from DD30L
up to 1 rows
into selmethod
where SHLPNAME eq w_tadir-obj_name
and ( selmethod like c_z%
or selmethod like c_y% )
and AS4LOCAL eq 'A'. " only active
* Tabelle lesen
select count( * ) from dd02l " unnoetig
where tabname eq selmethod
and ( tabclass eq c_ta_INTTAB
or tabclass eq c_ta_TRANSP
or tabclass eq c_ta_APPEND ).
if sy-subrc eq 0.
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_tabl
obj_name = selmethod.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_tabl
and obj_name eq selmethod.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endselect.
endloop.
endmethod. "tables_from_searchelps
method devclass.
if not package is initial.
select * from tadir into table t_tadir_dev
where devclass in package
and pgmid eq 'R3TR'.
* Geschachtelte Packages
loop at t_tadir_dev into w_tadir_dev
where object eq 'DEVC'
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
select devclass from tdevc into w_tadir_dev-obj_name
where parentcl eq w_tadir_dev-obj_name.
select * from tadir appending table t_tadir_dev
where devclass eq w_tadir_dev-obj_name
and pgmid eq 'R3TR'.
endselect.
endloop.
endif.
endmethod. "devclass
method table.
data: t_dd02l type standard table of dd02l,
w_dd02l type dd02l.
if not table[] is initial.
select * from dd02l
into table t_dd02l
where tabname in table
and ( tabclass eq c_ta_INTTAB
or tabclass eq c_ta_TRANSP
or tabclass eq c_ta_APPEND )
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd02l into w_dd02l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TABL
and obj_name eq w_dd02l-tabname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_TABL
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_TABL
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd02l
where tabname eq w_tadir_dev-obj_name
and ( tabclass eq c_ta_INTTAB
or tabclass eq c_ta_TRANSP
or tabclass eq c_ta_APPEND )
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "table
method includes_appends_of_tables.
data: precfield type dd03l-precfield.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_tabl.
select distinct precfield from dd03l
into precfield
where tabname eq w_tadir-obj_name
and ( fieldname eq '.INCLUDE'
or fieldname eq '.INCLU--AP' )
and ( precfield like c_z%
or precfield like c_y% )
and AS4LOCAL eq 'A'. " only active
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_tabl
obj_name = precfield.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_tabl
and obj_name eq precfield.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "includes_appends_of_tables
method dataelements_of_tables.
* Dataelements und domains dazulesen
data: rollname type dd03l-rollname.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_tabl.
select distinct rollname from dd03l
into rollname
where tabname eq w_tadir-obj_name
and ( rollname like c_z%
or rollname like c_y% )
and AS4LOCAL eq 'A'. " only active
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_dtel
obj_name = rollname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_dtel
and obj_name eq rollname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "dataelements_of_tables
method domains_of_dataelements.
* Domains dazulesen
data: DOMNAME type dd04l-DOMNAME.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_dtel.
* Domaene dazulesen
select distinct domname from dd04l
into domname
where rollname eq w_tadir-obj_name
and ( domname like c_z%
or domname like c_y% )
and AS4LOCAL eq 'A'. " only active
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_doma
obj_name = domname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_doma
and obj_name eq domname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "domains_of_dataelements
method views.
data: t_dd02l type standard table of dd02l,
w_dd02l type dd02l.
if not view[] is initial.
select * from dd02l
into table t_dd02l
where tabname in view
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd02l into w_dd02l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_VIEW
and obj_name eq w_dd02l-tabname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_VIEW
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_VIEW
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd02l
where tabname eq w_tadir_dev-obj_name
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "views
method tabletypes.
data: t_dd40l type standard table of dd40l,
w_dd40l type dd40l.
if not tabletyp[] is initial.
select * from dd40l
into table t_dd40l
where typename in tabletyp
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd40l into w_dd40l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TTYP
and obj_name eq w_dd40l-typename.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_TTYP
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_TTYP
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd40l
where typename eq w_tadir_dev-obj_name
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "tabletypes
method searchelps.
data: t_dd30l type standard table of dd30l,
w_dd30l type dd30l.
if not searchlp[] is initial.
select * from dd30l
into table t_dd30l
where shlpname in searchlp
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd30l into w_dd30l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_SHLP
and obj_name eq w_dd30l-shlpname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_SHLP
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_SHLP
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd30l
where shlpname eq w_tadir_dev-obj_name
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "searchelps
method domains.
data: t_dd01l type standard table of dd01l,
w_dd01l type dd01l.
* Domaenen selektieren
if not domain[] is initial.
select * from dd01l
into table t_dd01l
where domname in domain
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd01l into w_dd01l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DOMA
and obj_name eq w_dd01l-domname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_DOMA
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_DOMA
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd01l
where domname eq w_tadir_dev-obj_name
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "domains
method dataelements.
data: t_dd04l type standard table of dd04l,
w_dd04l type dd04l.
if not delement[] is initial.
select * from dd04l
into table t_dd04l
where rollname in delement
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
loop at t_dd04l into w_dd04l.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DTEL
and obj_name eq w_dd04l-rollname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_DTEL
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_DTEL
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from dd04l
where rollname eq w_tadir_dev-obj_name
and AS4LOCAL eq 'A'. " only active
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "dataelements
method classes.
data: t_vseoclass type standard table of vseoclass,
w_vseoclass type vseoclass.
if not clsname[] is initial.
select distinct * from vseoclass
into table t_vseoclass
where clsname in clsname.
if sy-subrc eq 0.
loop at t_vseoclass into w_vseoclass.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_CLAS
and obj_name eq w_vseoclass-clsname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_CLAS
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_CLAS
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from vseoclass
where clsname eq w_tadir_dev-obj_name.
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "classes
method friends_and_superclasses.
call method friends.
call method superclasses.
endmethod. "friends_and_superclasses
method friends.
* Friends
data: w_refclsname type seofriends-refclsname.
if friends eq 'X'.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
select distinct refclsname from seofriends
into w_refclsname
where clsname eq w_tadir-obj_name.
if w_refclsname(1) eq c_z
or w_refclsname(1) eq c_y.
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_clas
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endselect.
endloop.
endif.
endmethod. "friends
method superclasses.
* Superclasses
data: w_refclsname type seofriends-refclsname.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
clear w_refclsname.
select refclsname from vseoextend
up to 1 rows
into w_refclsname
where clsname eq w_tadir-obj_name.
endselect.
if w_refclsname(1) eq c_z
or w_refclsname(1) eq c_y.
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_clas
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endloop.
endmethod. "superclasses
method interfaces.
data: t_vseointerf type standard table of vseointerf,
w_vseointerf type vseointerf.
if not intname[] is initial.
select * from vseointerf
into table t_vseointerf
where clsname in intname.
if sy-subrc eq 0.
loop at t_vseointerf into w_vseointerf.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_INTF
and obj_name eq w_vseointerf-clsname.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_INTF
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_INTF
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from vseointerf
where clsname eq w_tadir_dev-obj_name.
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "interfaces
method interfaces_classes_comprisings.
* Interfaces zu Klassen
call method interfaces_from_classes.
* Comprisings
call method comprisings.
endmethod. "interfaces_classes_comprisings
method interfaces_from_classes.
data: w_refclsname type seofriends-refclsname.
* Interfaces zu Klassen
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_clas.
select refclsname from vseoimplem
into w_refclsname
where clsname eq w_tadir-obj_name.
if w_refclsname(1) eq c_z
or w_refclsname(1) eq c_y.
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_intf
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_intf
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endif.
endselect.
endloop.
endmethod. "interfaces_from_classes
method comprisings.
data: w_refclsname type seofriends-refclsname.
loop at t_tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_intf.
select refclsname from vseocompri
into w_refclsname
where clsname eq w_tadir-obj_name.
read table t_tadir into w_tadir
with key pgmid = c_ta_r3tr
object = c_ta_intf
obj_name = w_refclsname.
if sy-subrc ne 0.
select single * from tadir into w_tadir
where pgmid eq c_ta_r3tr
and object eq c_ta_intf
and obj_name eq w_refclsname.
if sy-subrc eq 0.
append w_tadir to t_tadir.
endif.
endif.
endselect.
endloop.
endmethod. "comprisings
method fgroups.
data: t_enlfdir type standard table of enlfdir,
w_enlfdir type enlfdir.
if not funcarea[] is initial.
select distinct * from enlfdir
into table t_enlfdir
where area in funcarea.
if sy-subrc eq 0.
delete adjacent duplicates from t_enlfdir comparing area.
loop at t_enlfdir into w_enlfdir.
select single * from tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_FUGR
and obj_name eq w_enlfdir-area.
append w_tadir to t_tadir.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_FUGR
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_FUGR
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from enlfdir
where area eq w_tadir_dev-obj_name.
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "fgroups
method programs.
if not program[] is initial.
select * from tadir
appending table t_tadir
where pgmid = c_ta_R3TR
and object = c_ta_PROG
and obj_name in program.
if sy-subrc eq 0.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_PROG.
select count( * ) from REPOSRC
* >>>> Beginn ersetzt US20060112 XYXY
* where progname eq w_tadir_dev-obj_name.
where progname eq w_tadir-obj_name.
* >>>> Ende ersetzt US200060112 XYXY
if sy-subrc ne 0.
delete t_tadir.
endif.
endloop.
endif.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_PROG
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_PROG
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
* Existiert es ueberhaupt
select count( * ) from REPOSRC
where progname eq w_tadir_dev-obj_name.
if sy-subrc eq 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endif.
endloop.
endmethod. "programs
method typegroups.
if not typgroup[] is initial.
* Achtung, hier werden auch inaktive selektiert
select * from tadir
appending table t_tadir
where pgmid eq C_ta_R3TR
and object eq C_ta_TYPE
and obj_name in typgroup.
endif.
* Evtl. Objekte aus Entwicklungsklasse dazunehmen
loop at t_tadir_dev into w_tadir_dev
where pgmid eq c_ta_R3TR
and object eq C_ta_type
and ( obj_name(1) eq c_z
or obj_name(1) eq c_y ).
read table t_tadir into w_tadir
with key pgmid = c_ta_R3TR
object = c_ta_type
obj_name = w_tadir_dev-obj_name.
if sy-subrc ne 0.
move w_tadir_dev to w_tadir.
append w_tadir to t_tadir.
endif.
endloop.
endmethod. "typegroups
endclass. "selectoptions IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS select_and_download DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class select_and_download definition.
public section.
methods: constructor importing i_tadir type ttadir_table,
set_tadir importing i_tadir type ttadir_table,
select_and_download exceptions error.
private section.
data: t_tadir type ttadir_table,
w_tadir type tadir,
rxml_download type ref to xml_download,
rtxt_download type ref to txt_download,
index type tindex_table,
w_index like line of index,
xmlsize type sytabix.
if sy-subrc ne 0.
message I000(38) display like 'I'
with 'Error, Determing size of XML'.
raise error_determine_size_xml.
endif.
* Falls der Source zusЇtzlich in cdata abgespeichert wird
if i_flg_source eq 'X'
and cdata eq 'X'.
lv_xmlsize = lv_xmlsize * 2.
endif.
* Wird eine einzelne XML-Datei zu gross ?
xmlsize = xmlsize + lv_xmlsize.
if xmlsize > c_size_max_xml.
message I000(38) display like 'I'
with 'Data volume of single XML-file exceeded maximum size of'
c_size_max_xml
'Bytes'.
raise xml_file_too_big.
endif.
endmethod. "check_size
method check_size_write_xml.
* Gresse ueberpruefen
if save eq 'X'. " es wird alles in eine Datei geschrieben
case sy-subrc.
when 1.
raise xml_file_too_big.
when 2.
raise error_determine_size_xml.
when 3.
raise error_determine_size_xml.
endcase.
endif.
if sfiles eq 'X'. " es wird in mehrere Dateien geschrieben
* in einzelene XML-Datei schreiben
free domain.
call method write_xml_file
EXPORTING
name = name
px = px
IMPORTING
e_filename = e_filename
EXCEPTIONS
error_writing_file = 1
others = 2.
if sy-subrc ne 0.
message I000(38) display like 'I'
with 'Error writing XML File'.
raise error_writing_file.
endif.
endif.
endmethod. "check_size_write_xml
method write_xml_file.
data: filename type string.
data: oasis type localfile.
*************************
* Index-Datei in XML schreiben
*************************
if sfiles eq 'X'.
* Umsortieren, umgekehrte Reihenfolge (wegen dem Upload)
* Es soll die richtige Reihenfolge beim Upload garantiert sein
DATA: index_work like index.
Loop at index into w_index.
insert w_index into index_work index 1.
delete index.
Endloop.
index = index_work.
free index_work.
**************************
* XML-Datei sichern
**************************
call method rxml_download->download_XML_index_file
EXPORTING
index = index
EXCEPTIONS
error = 1
others = 2.
if sy-subrc ne 0.
raise error.
endif.
endif.
**************************
* XML Dokument runterladen (alle Daten in einem XML-Dokument)
**************************
if save eq 'X'.
if not p is initial.
call method rxml_download->download_XML.
endif.
endif.
**************************
* Objekt freigeben
**************************
free rxml_download.
endmethod. "selection
method READ_DOMAINS.
data: domain type tdomain,
DOMA_NAME TYPE RPY_DOMA-DOMANAME,
rdomain type ref to domain_read.
data: px type tp.
data: name type localfile.
if not rdomain is bound.
create object rdomain.
endif.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_DOMA.
* Lokale Datendeklaration
data: inter type tinter,
intkey type SEOCLSKEY,
rinterface type ref to interface_read.
data: px type tp.
data: name type localfile.
if not rinterface is bound.
create object rinterface.
endif.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_INTF.
intkey-clsname = w_tadir-obj_name.
free inter.
call method rinterface->read_interface
EXPORTING
i_intkey = intkey
IMPORTING
e_inter = inter
EXCEPTIONS
error = 1
others = 2.
if not inter is initial
and sy-subrc eq 0.
download_message 'Interface' intkey-clsname.
concatenate c_ch_Interface '_' intkey-clsname into name.
free px.
append inter to px-inters.
clear w_index-file.
call method check_size_write_xml
EXPORTING
name = name
px = px
IMPORTING
e_filename = w_index-file
EXCEPTIONS
xml_file_too_big = 1
error_writing_file = 2
error_determine_size_xml = 3
others = 4.
case sy-subrc.
when 1.
raise xml_file_too_big.
when 2.
raise error_writing_file.
when 3.
raise error_determine_size_xml.
when 4.
raise error.
endcase.
if sfiles eq 'X'.
* Index-Datei erzeugen
move c_ch_Interface to w_index-type.
move intkey-clsname to w_index-name.
append w_index to index.
endif.
* In globale Gesamtvariable speichern
if sfiles ne 'X'.
append inter to p-inters.
endif.
endif.
free px.
free inter.
endloop.
ENDMETHOD. "read_interfaces
method read_fgroups.
DATA: w_fgroup type tfgroup,
area type enlfdir-area,
rfgroup type ref to fgroup_read.
data: px type tp.
data: name type localfile.
if not rfgroup is bound.
create object rfgroup.
endif.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_FUGR.
move w_tadir-obj_name to area.
free w_fgroup.
call method rfgroup->read_fgroup
EXPORTING
i_area = area
IMPORTING
e_fgroup = w_fgroup
EXCEPTIONS
error = 1
others = 2.
if not w_fgroup is initial
and sy-subrc eq 0.
download_message 'Area' area.
concatenate c_ch_Fgroup '_' area into name.
free px.
append w_fgroup to px-fgroups.
clear w_index-file.
call method check_size_write_xml
EXPORTING
name = name
px = px
i_flg_source = 'X'
IMPORTING
e_filename = w_index-file
EXCEPTIONS
xml_file_too_big = 1
error_writing_file = 2
error_determine_size_xml = 3
others = 4.
case sy-subrc.
when 1.
raise xml_file_too_big.
when 2.
raise error_writing_file.
when 3.
raise error_determine_size_xml.
when 4.
raise error.
endcase.
if sfiles eq 'X'.
* Index-Datei erzeugen
move c_ch_Fgroup to w_index-type.
move area to w_index-name.
append w_index to index.
endif.
* Source in einzelne TXT Datei schreiben
if ctxt eq 'X'.
call method rtxt_download->txt_source_fgroups
EXPORTING
p = px
EXCEPTIONS
error = 1
others = 2.
endif.
* In globale Gesamtvariable speichern
if sfiles ne 'X'.
append w_fgroup to p-fgroups.
endif.
endif.
free px.
free w_fgroup.
endloop.
endmethod. "read_fgroups
method read_programs.
data: program type tprogram,
progname type trdir-name,
rprogram type ref to program_read.
data: px type tp.
data: name type localfile.
if not rprogram is bound.
create object rprogram.
endif.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_PROG.
move w_tadir-obj_name to progname.
free program.
call method rprogram->read_program
EXPORTING
i_progname = progname
IMPORTING
e_program = program
EXCEPTIONS
error = 1
others = 2.
if not program is initial
and sy-subrc eq 0.
download_message 'Program' progname.
concatenate c_ch_program '_' progname into name.
free px.
append program to px-programs.
clear w_index-file.
call method check_size_write_xml
EXPORTING
name = name
px = px
i_flg_source = 'X'
IMPORTING
e_filename = w_index-file
EXCEPTIONS
xml_file_too_big = 1
error_writing_file = 2
error_determine_size_xml = 3
others = 4.
case sy-subrc.
when 1.
raise xml_file_too_big.
when 2.
raise error_writing_file.
when 3.
raise error_determine_size_xml.
when 4.
raise error.
endcase.
if sfiles eq 'X'.
* Index-Datei erzeugen
move c_ch_program to w_index-type.
move progname to w_index-name.
append w_index to index.
endif.
* Source in einzelne TXT Datei schreiben
if ctxt eq 'X'.
call method rtxt_download->txt_source_programs
EXPORTING
p = px
EXCEPTIONS
error = 1
others = 2.
endif.
* In globale Gesamtvariable speichern
if sfiles ne 'X'.
append program to p-programs.
endif.
endif.
free px.
free program.
endloop.
endmethod. "read_programs
method read_typegroups.
data: typegroup type ttypegroup,
typegroup_name TYPE trdir-name,
rtypegroup type ref to typegroup_read.
data: px type tp.
data: name type localfile.
if not rtypegroup is bound.
create object rtypegroup.
endif.
loop at t_tadir into w_tadir
where pgmid = c_ta_R3TR
and object = c_ta_TYPE.
move w_tadir-obj_name to typegroup_name.
* typegroup lesen
free typegroup.
call method rtypegroup->read_typegroup
EXPORTING
typegroup_name = typegroup_name
IMPORTING
e_typegroup = typegroup
EXCEPTIONS
error = 1
others = 2.
if not typegroup is initial
and sy-subrc eq 0.
download_message 'Typegroup' typegroup_name.
concatenate c_ch_typegroup '_' typegroup_name into name.
free px.
append typegroup to px-typegroups.
clear w_index-file.
call method check_size_write_xml
EXPORTING
name = name
px = px
i_flg_source = 'X'
IMPORTING
e_filename = w_index-file
EXCEPTIONS
xml_file_too_big = 1
error_writing_file = 2
error_determine_size_xml = 3
others = 4.
case sy-subrc.
when 1.
raise xml_file_too_big.
when 2.
raise error_writing_file.
when 3.
raise error_determine_size_xml.
when 4.
raise error.
endcase.
if sfiles eq 'X'.
* Index-Datei erzeugen
move c_ch_typegroup to w_index-type.
move typegroup_name to w_index-name.
append w_index to index.
endif.
* Source in einzelne TXT Datei schreiben
if ctxt eq 'X'.
call method rtxt_download->txt_source_typegroups
EXPORTING
p = px
EXCEPTIONS
error = 1
others = 2.
endif.
* In globale Gesamtvariable speichern
if sfiles ne 'X'.
append typegroup to p-typegroups.
endif.
endif.
free px.
free domain.
endloop.
endmethod. "read_typegroups
endclass. "process IMPLEMENTATION
*---------------------------------------------------------------------*
* CLASS start_download DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class start_download definition.
public section.
methods: constructor,
download.
private section.
* Data
data: t_tadir type ttadir_table.
DATA: rselectoptions type ref to selectoptions,
rchoose_download type ref to choose_download,
rselect_and_download type ref to select_and_download.
endclass. "download DEFINITION
*---------------------------------------------------------------------*
* CLASS download IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
class start_download implementation.
if not t_tadir is initial.
* Auswahlliste
create object rchoose_download.
call method rchoose_download->choose
CHANGING
t_tadir = t_tadir.
if not t_tadir is initial.
* Daten selektieren und in Dateien abspeichern
create object rselect_and_download
EXPORTING
i_tadir = t_tadir.
call method rselect_and_download->select_and_download
EXCEPTIONS
error = 1
others = 2.
endif.
endif.
endmethod. "downloading
endclass. "start_download IMPLEMENTATION
***********************************************************************
* Formroutinen
***********************************************************************
*&--------------------------------------------------------------------*
*& Form main
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form main.
*&--------------------------------------------------------------------*
*& Form download
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form download.
*&--------------------------------------------------------------------*
*& Form upload
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form upload.
* Klassenvariabeln
DATA: rxml_upload type ref to xml_upload.
create object rxml_upload.
* Referenzen
data: start_upload_single type ref to start_upload_single.
data: start_upload_index type ref to start_upload_index.
* Index Datei
data: index type tindex_table.
******************
* einzelne Datei einspielen
******************
if up_sing eq 'X'.
* Upload einer einzelnen Datei
call method rxml_upload->upload_xml_file
EXPORTING
filename = pcfile1
IMPORTING
dataobject = p
EXCEPTIONS
error = 1
others = 2.
if sy-subrc eq 0.
* Daten einspielen
if not p is initial.
create object start_upload_single.
call method start_upload_single->upload.
endif.
endif.
*****************
* mehrere Dateien ueber index-Datei einspielen
*****************
elseif up_index eq 'X'.
call method rxml_upload->upload_xml_file
EXPORTING
filename = pcfile1
IMPORTING
dataobject = index
EXCEPTIONS
error = 1
others = 2.
if sy-subrc eq 0.
* Upload ueber Index-Datei
if not index is initial.
create object start_upload_index
exporting
i_index = index
i_rxml_upload = rxml_upload.
* Daten einspielen
call method start_upload_index->upload.
endif.
endif.
endif.
endform. "upload
*&---------------------------------------------------------------------*
*& Form auswahl_download
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM auswahl_download
TABLES SELECTION STRUCTURE SHVALUE.
* Funktion wird dynamisch aufgerufen
move space to flag_POPUP_abg.
endform. "auswahl_download
*&---------------------------------------------------------------------*
*& Form auswahl_upload
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM auswahl_upload
TABLES SELECTION STRUCTURE SHVALUE.
* Funktion wird dynamisch aufgerufen
move space to flag_POPUP_abg.
endform. "auswahl_download
*&---------------------------------------------------------------------*
*& Form check_selection
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM check_selection .
if download eq 'X'.
if clsname[] is initial
and funcarea[] is initial
and program[] is initial
and package[] is initial
and intname[] is initial
and domain[] is initial
and delement[] is initial
and table[] is initial
and view[] is initial
and tabletyp[] is initial
and searchlp[] is initial
and typgroup[] is initial.
message E000(38) with 'Please restrict selection'.
endif.
* Entwicklungsklassen ueberpruefen
loop at package.
if not package-low is initial.
if package-low(1) ne c_z
and package-low(1) ne c_y
and package-low ne '$TMP'.
message E000(38) with 'Package must begin with Z or Y'.
endif.
endif.
if not package-high is initial.
if package-high(1) ne c_z
and package-high(1) ne c_y
and package-high ne '$TMP'.
message E000(38) with 'Package must begin with Z or Y'.
endif.
endif.
endloop.
* Table ueberpruefen
loop at table.
if not table-low is initial.
if table-low(1) ne c_z
and table-low(1) ne c_y.
message E000(38) with 'Table must begin with Z or Y'.
endif.
endif.
if not table-high is initial.
if table-high(1) ne c_z
and table-high(1) ne c_y.
message E000(38) with 'Table must begin with Z or Y'.
endif.
endif.
endloop.
* Domain ueberpruefen
loop at domain.
if not domain-low is initial.
if domain-low(1) ne c_z
and domain-low(1) ne c_y.
message E000(38) with 'Domain must begin with Z or Y'.
endif.
endif.
if not domain-high is initial.
if domain-high(1) ne c_z
and domain-high(1) ne c_y.
message E000(38) with 'Domain must begin with Z or Y'.
endif.
endif.
endloop.
* Dataelement ueberpruefen
loop at delement.
if not delement-low is initial.
if delement-low(1) ne c_z
and delement-low(1) ne c_y.
message E000(38) with 'Delement must begin with Z or Y'.
endif.
endif.
if not delement-high is initial.
if delement-high(1) ne c_z
and delement-high(1) ne c_y.
message E000(38) with 'Delement must begin with Z or Y'.
endif.
endif.
endloop.
* Tabletyp ueberpruefen
loop at tabletyp.
if not tabletyp-low is initial.
if tabletyp-low(1) ne c_z
and tabletyp-low(1) ne c_y.
message E000(38) with 'Tabletype must begin with Z or Y'.
endif.
endif.
if not tabletyp-high is initial.
if tabletyp-high(1) ne c_z
and tabletyp-high(1) ne c_y.
message E000(38) with 'Tabletype must begin with Z or Y'.
endif.
endif.
endloop.
* Dataelement ueberpruefen
loop at searchlp.
if not searchlp-low is initial.
if searchlp-low(1) ne c_z
and searchlp-low(1) ne c_y.
message E000(38) with 'Searchhelp must begin with Z or Y'.
endif.
endif.
if not searchlp-high is initial.
if searchlp-high(1) ne c_z
and searchlp-high(1) ne c_y.
message E000(38) with 'Searchelp must begin with Z or Y'.
endif.
endif.
endloop.
* Klassenname ueberpruefen
loop at clsname.
if not clsname-low is initial.
if clsname-low(1) ne c_z
and clsname-low(1) ne c_y.
message E000(38) with 'Classname must begin with Z or Y'.
endif.
endif.
if not clsname-high is initial.
if clsname-high(1) ne c_z
and clsname-high(1) ne c_y.
message E000(38) with 'Classname must begin with Z or Y'.
endif.
endif.
endloop.
* Funktionsgruppenname ueberpruefen
loop at funcarea.
if not funcarea-low is initial.
if funcarea-low(1) ne c_z
and funcarea-low(1) ne c_y.
message E000(38) with 'Funcarea must begin with Z or Y'.
endif.
endif.
if not funcarea-high is initial.
if funcarea-high(1) ne c_z
and funcarea-high(1) ne c_y.
message E000(38) with 'Funcarea must begin with Z or Y'.
endif.
endif.
endloop.
* Programs
loop at program.
if not program-low is initial.
if program-low(1) ne c_z
and program-low(1) ne c_y.
message E000(38) with 'Program must begin with Z or Y'.
endif.
endif.
if not program-high is initial.
if program-high(1) ne c_z
and program-high(1) ne c_y.
message E000(38) with 'Program must begin with Z or Y'.
endif.
endif.
endloop.
***********************
* Falls es in eine Datei geschrieben werden soll
if save eq 'X'.
if disp_onl is initial.
if pcfile is initial.
message E000(38) with 'Please enter path and filename'.
else.
* check, if .XML
perform check_if_xml_file using pcfile.
endif.
endif.
endif.
***********************
* Falls es in mehrere Dateien aufgeteilt wird
if sfiles eq 'X'
or ctxt eq 'X'.
* Pfad kontrollieren, ob initial
if path is initial
and sfiles eq 'X'.
message E000(38) with 'Please enter path'.
endif.
* Ist der Pfad fuer die .txt Dateien initial
if path1 is initial
and ctxt eq 'X'.
message E000(38) with 'Please enter path'.
endif.
* Pfad ueberpruefen
data: length type i,
path_xy like path,
index_xy type sy-index.
do 2 times.
clear path_xy.
move sy-index to index_xy.
if index_xy eq 1.
if sfiles eq 'X'.
move path to path_xy.
else.
continue.
endif.
else.
if ctxt eq 'X'.
move path1 to path_xy.
else.
continue.
endif.
endif.
if not path_xy is initial.
length = strlen( path_xy ).
if length < 3.
message E000(38) with 'Please enter valid path'.
endif.
perform check_if_not_xml_file using path_xy.
length = length - 1.
if path_xy+length(1) ne '/'
and path_xy+length(1) ne '\'.
concatenate path_xy '\' into path_xy.
endif.
if index_xy eq 1.
move path_xy to path.
else.
move path_xy to path1.
endif.
endif.
enddo.
endif.
* Macht keinen Sinn in diesem Fall das Pgm. aufzurufen
if sfiles is initial
and save is initial
and display is initial
and calledit is initial
and ctxt is initial.
message E000(38) with 'Please mark at least one checkbox'.
endif.
endif.
if upload eq 'X'.
DATA: file_oasis type localfile.
move pcfile1 to file_oasis.
SET LOCALE LANGUAGE 'D'.
translate file_oasis to upper case.
SET LOCALE LANGUAGE sy-langu.
* file_index.xml hochladen: Dateiname ueberpruefen
if up_index eq 'X'.
if not file_oasis cs c_file_index_xml.
message E000(38) with 'Please enter file_index.xml'.
endif.
if not postfix is initial.
clear postfix.
message E000(38)
with 'Please dont enter Postfix for file_index.xml uploads'.
endif.
endif.
* check, if .XML
perform check_if_xml_file using pcfile1.
endif.
ENDFORM. " check_selection
*&--------------------------------------------------------------------*
*& Form check_if_xml_file
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->FILENAME_XMtext
*---------------------------------------------------------------------*
form check_if_xml_file using filename_xml type localfile.
data: length_xy type i.
data: string_xy type string.
length_xy = strlen( filename_xml ).
if length_xy < 8.
message E000(38) with 'Please enter valid path and .xml filename'.
endif.
length_xy = length_xy - 4.
string_xy = filename_xml+length_xy(4).
SET LOCALE LANGUAGE 'D'.
translate string_xy to upper case.
SET LOCALE LANGUAGE sy-langu.
if string_xy ne '.XML'.
message E000(38) with 'Please enter valid path and .xml filename'.
endif.
endform. "check_if_xml_file
*&--------------------------------------------------------------------*
*& Form check_if_not_xml_file
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->FILENAME_XMtext
*---------------------------------------------------------------------*
form check_if_not_xml_file using filename_xml type localfile.
data: length_xy type i.
data: string_xy type string.
length_xy = strlen( filename_xml ).
if length_xy < 4.
exit.
endif.
length_xy = length_xy - 4.
string_xy = filename_xml+length_xy(4).
SET LOCALE LANGUAGE 'D'.
translate string_xy to upper case.
SET LOCALE LANGUAGE sy-langu.
if string_xy eq '.XML'.
message E000(38) with 'Please enter valid path'.
endif.
endform. "check_if_xml_file
*&---------------------------------------------------------------------*
*& Form on_value_request
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM on_value_request_pcfile1.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.