Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
class-methods GETOBJECTINFOFROMIXMLDOC
importing
!IXMLDOCUMENT type ref to IF_IXML_DOCUMENT
exporting
!OBJTYPENAME type STRING
!OBJNAME type STRING .
class-methods CONVERTSTRINGTOIXMLDOC
importing
value(XMLSTRING) type STRING
returning
value(IXMLDOCUMENT) type ref to IF_IXML_DOCUMENT .
class-methods CONVERTIXMLDOCTOSTRING
importing
!IXMLDOCUMENT type ref to IF_IXML_DOCUMENT
returning
value(XMLSTRING) type STRING .
methods CREATEOBJECTFROMIXMLDOC
abstract
importing
!IXMLDOCUMENT type ref to IF_IXML_DOCUMENT
!DEVCLASS type DEVCLASS default '$TMP'
!OVERWRITE type FLAG optional
returning
value(NAME) type STRING
raising
ZCX_SAPLINK .
methods CREATEIXMLDOCFROMOBJECT
abstract
returning
value(IXMLDOCUMENT) type ref to IF_IXML_DOCUMENT
raising
ZCX_SAPLINK .
methods CONSTRUCTOR
importing
!NAME type STRING .
methods UPLOADXML
final
importing
!XMLDATA type STRING .
class-methods GETPLUGINS
changing
value(OBJECTTABLE) type TABLE .
methods CHECKEXISTS
abstract
returning
value(EXISTS) type FLAG .
*"* protected components of class ZSAPLINK
*"* do not include other source files here!!!
protected section.
data OBJNAME type STRING .
data IXML type ref to IF_IXML .
data XMLDOC type ref to IF_IXML_DOCUMENT .
methods DELETEOBJECT
abstract
raising
ZCX_SAPLINK .
methods CREATENODEFROMOTR
final
importing
!OTRGUID type SOTR_CONC
returning
value(NODE) type ref to IF_IXML_ELEMENT .
class-methods SETATTRIBUTESFROMSTRUCTURE
importing
!NODE type ref to IF_IXML_ELEMENT
!STRUCTURE type DATA .
class-methods GETSTRUCTUREFROMATTRIBUTES
importing
!NODE type ref to IF_IXML_ELEMENT
!PRESERVEVERSION type FLAG optional
changing
!STRUCTURE type DATA .
methods CREATEXMLSTRING
final
returning
value(XML) type STRING .
class-methods BUILDTABLEFROMSTRING
importing
!SOURCE type STRING
returning
value(SOURCETABLE) type TABLE_OF_STRINGS .
class-methods BUILDSOURCESTRING
importing
!SOURCETABLE type RSWSOURCET optional
!PAGETABLE type O2PAGELINE_TABLE optional
returning
value(SOURCESTRING) type STRING .
methods GETOBJECTTYPE
abstract
returning
value(OBJECTTYPE) type STRING .
methods CREATEOTRFROMNODE
final
importing
value(NODE) type ref to IF_IXML_ELEMENT
!DEVCLASS type DEVCLASS default '$TMP'
exporting
!CONCEPT type SOTR_TEXT-CONCEPT
raising
ZCX_SAPLINK .
*"* private components of class ZSAPLINK
*"* do not include other source files here!!!
private section.
data STREAMFACTORY type ref to IF_IXML_STREAM_FACTORY .
data XMLDATA type STRING .
ENDCLASS.
CLASS ZSAPLINK_PROGRAM DEFINITION
INHERITING FROM ZSAPLINK
FINAL
CREATE PUBLIC
.
public section.
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
*"* protected components of class ZSAPLINK_PROGRAM
*"* do not include other source files here!!!
protected section.
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
*"* private components of class ZSAPLINK_PROGRAM
*"* do not include other source files here!!!
private section.
methods CREATE_TEXTPOOL
importing
!TEXTPOOLNODE type ref to IF_IXML_ELEMENT .
methods DEQUEUE_ABAP
raising
ZCX_SAPLINK .
methods GET_TEXTPOOL
returning
value(TEXTNODE) type ref to IF_IXML_ELEMENT .
methods CREATE_SOURCE
importing
!SOURCE type TABLE_OF_STRINGS
!ATTRIBS type TRDIR .
methods ENQUEUE_ABAP
raising
ZCX_SAPLINK .
methods TRANSPORT_COPY
importing
!AUTHOR type SYUNAME
!DEVCLASS type DEVCLASS
raising
ZCX_SAPLINK .
methods GET_DYNPRO
returning
value(DYNP_NODE) type ref to IF_IXML_ELEMENT .
methods CREATE_DYNPRO
importing
!DYNP_NODE type ref to IF_IXML_ELEMENT .
methods GET_PFSTATUS
returning
value(PFSTAT_NODE) type ref to IF_IXML_ELEMENT .
methods CREATE_PFSTATUS
importing
!PFSTAT_NODE type ref to IF_IXML_ELEMENT .
ENDCLASS.
CLASS ZSAPLINK_CLASS DEFINITION
INHERITING FROM ZSAPLINK
CREATE PUBLIC
.
public section.
type-pools ABAP .
type-pools SEOP .
type-pools SEOR .
type-pools SEOS .
type-pools SEOT .
type-pools SEOX .
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
*"* protected components of class ZSAPLINK_CLASS
*"* do not include other source files here!!!
protected section.
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
*"* private components of class ZSAPLINK_CLASS
*"* do not include other source files here!!!
private section.
methods FINDIMPLEMENTINGCLASS
importing
!METHODNAME type STRING
!STARTCLASS type STRING optional
returning
value(CLASSNAME) type STRING .
ENDCLASS.
CLASS ZCX_SAPLINK IMPLEMENTATION.
method CONSTRUCTOR .
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
.
me->MSG = MSG .
endmethod.
ENDCLASS.
CLASS ZSAPLINK IMPLEMENTATION.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method BUILDSOURCESTRING .
data sTemp type string.
data pageLine type O2PAGELINE.
method CONSTRUCTOR .
*
*
*
*
*
*
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CONVERTIXMLDOCTOSTRING .
data _ixml type ref to if_ixml.
data _streamFactory type ref to IF_IXML_STREAM_FACTORY.
data _outputStream type ref to IF_IXML_OSTREAM.
data _renderer type ref to IF_IXML_RENDERER.
data _tempString type string.
data _printXMLDoc type ref to cl_xml_document.
data _rc type sysubrc.
_ixml = cl_ixml=>create( ).
_streamFactory = _ixml->CREATE_STREAM_FACTORY( ).
_outputStream = _streamFactory->CREATE_OSTREAM_CSTRING( _tempString ).
_renderer = _ixml->CREATE_RENDERER(
DOCUMENT = ixmlDocument OSTREAM = _outputStream ).
_renderer->SET_NORMALIZING( ).
_rc = _renderer->render( ).
create object _printXMLDoc.
_rc = _printXMLDoc->parse_string( _tempString ).
while _tempString(1) <> '<'.
shift _tempString left by 1 places.
endwhile.
xmlString = _tempString.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CONVERTSTRINGTOIXMLDOC .
data ixml type ref to if_ixml.
data streamFactory type ref to IF_IXML_STREAM_FACTORY.
data iStream type ref to if_ixml_istream.
data ixmlParser type ref to if_ixml_parser.
data xmlDoc type ref to if_ixml_document.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
iXMLParser = iXML->create_parser( stream_factory = streamFactory
istream
= iStream
document
= xmlDoc ).
iXMLParser->parse( ).
ixmlDocument = xmlDoc.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CREATENODEFROMOTR .
data rootNode type ref to if_ixml_element.
data txtNode type ref to if_ixml_element.
data rc type sysubrc.
data sotrHeader type SOTR_HEAD.
data sotrTextLine type SOTR_TEXT.
data sotrTextTable type table of SOTR_TEXT.
*\---------------------------------------------------------------------/
method CREATEOTRFROMNODE .
data txtNode type ref to if_ixml_element.
data filter type ref to if_ixml_node_filter.
data iterator type ref to if_ixml_node_iterator.
data
data
data
data
**
NO_TADIR_ENTRY
= 6
**
ERROR_IN_CORRECTION
= 7
**
USER_CANCELLED
= 8
**
OTHERS
= 9
**
.
*
if sy-subrc = 1.
*
raise exception type zcx_saplink
*
exporting textid = zcx_saplink=>not_authorized.
*
endif.
* ENDIF.
data objectTable type SOTR_OBJECTS.
data objectType type line of SOTR_OBJECTS.
* Retrieve object type of OTR
call function 'SOTR_OBJECT_GET_OBJECTS'
exporting
object_vector
= sotrHeader-objid_vec
importing
objects
= objectTable
exceptions
object_not_found = 1
others
= 2.
read table objectTable into objectType index 1.
* create OTR
sotrPaket-paket = devclass.
CALL FUNCTION 'SOTR_CREATE_CONCEPT'
EXPORTING
paket
crea_lan
ALIAS_NAME
*
CATEGORY
object
entries
*
FLAG_CORRECTION_ENTRY
*
IN_UPDATE_TASK
*
CONCEPT_DEFAULT
IMPORTING
CONCEPT
* EXCEPTIONS
*
PACKAGE_MISSING
*
CREA_LAN_MISSING
*
OBJECT_MISSING
*
PAKET_DOES_NOT_EXIST
*
ALIAS_ALREADY_EXIST
*
OBJECT_TYPE_NOT_FOUND
*
LANGU_MISSING
*
IDENTICAL_CONTEXT_NOT_ALLOWED
*
TEXT_TOO_LONG
*
ERROR_IN_UPDATE
*
NO_MASTER_LANGU
*
ERROR_IN_CONCEPT_ID
*
ALIAS_NOT_ALLOWED
*
TADIR_ENTRY_CREATION_FAILED
*
INTERNAL_ERROR
*
ERROR_IN_CORRECTION
*
USER_CANCELLED
*
NO_ENTRY_FOUND
= sotrPaket
= sotrHeader-crea_lan
= sotrHeader-alias_name
=
= objectType
= sotrTextTable
=
=
= sotrHeader-concept "ewH:33
= concept "ewH:33
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
*
*
*
OTHERS
= 19
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CREATEXMLSTRING .
data streamFactory type ref to IF_IXML_STREAM_FACTORY.
data outputStream type ref to IF_IXML_OSTREAM.
data renderer type ref to IF_IXML_RENDERER.
data tempString type string.
data printXMLDoc type ref to cl_xml_document.
data rc type sysubrc.
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
outputStream = streamFactory->CREATE_OSTREAM_CSTRING( tempString ).
renderer = ixml->CREATE_RENDERER(
DOCUMENT = xmlDoc OSTREAM = outputStream ).
rc = renderer->render( ).
create object printXMLDoc.
rc = printXMLDoc->parse_string( tempString ).
xml = tempString.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method GETOBJECTINFOFROMIXMLDOC .
data
data
data
data
rootNode
rootAttr
AttrNode
nodeName
type
type
type
type
ref to IF_IXML_NODE.
ref to IF_IXML_NAMED_NODE_MAP.
ref to IF_IXML_NODE.
string.
rootNode ?= ixmlDocument->GET_ROOT_ELEMENT( ).
* get object type
objTypeName = rootNode->GET_NAME( ).
translate objTypeName to upper case.
* get object name
rootAttr = rootNode->GET_ATTRIBUTES( ).
AttrNode = rootAttr->GET_ITEM( 0 ).
objName = AttrNode->GET_VALUE( ).
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method GETPLUGINS .
types: begin of t_objectTable,
classname type string,
object type ko100-object,
text type ko100-text,
end of t_objectTable.
data
data
data
data
data
data
data
data
data
data
refresh objectTable.
select * from VSEOEXTEND into table classList
where REFCLSNAME = 'ZSAPLINK'
and version = '1'.
clear structure.
attributeList = node->GET_ATTRIBUTES( ).
nodeIterator = attributeList->create_iterator( ).
attributeNode = nodeIterator->get_next( ).
while attributeNode is not initial.
name = attributeNode->get_name( ).
if name = 'VERSION' and preserveVersion is initial. "ewh:issue 45
if name = 'VERSION'.
value = '0'.
else.
value = attributeNode->get_value( ).
endif.
assign component name of structure structure to <value>.
if sy-subrc = 0.
<value> = value.
endif.
attributeNode = nodeIterator->get_next( ).
endwhile.
endmethod.
*
.-"-.
* .'=^=^='.
* /=^=^=^=^=\
*:^=SAPLINK=^;
*|^ EASTER ^|
*:^=^EGG^=^=^:
* \=^=^=^=^=/
* `.=^=^=.'
*
`~~~`
* Don't like the way we did something?
* Help us fix it! Tell us what you think!
* http://saplink.org
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method SETATTRIBUTESFROMSTRUCTURE .
data int type i.
int = int.
data structDescr type ref to cl_abap_structDescr.
data aComponent type abap_compdescr.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CHECKEXISTS .
select single name from trdir into objName where NAME = objName.
if sy-subrc = 0.
exists = 'X'.
endif.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CREATEIXMLDOCFROMOBJECT .
data rootNode type ref to if_ixml_element.
data sourceNode type ref to if_ixml_element.
data textPoolNode type ref to if_ixml_element.
data dynproNode type ref to if_ixml_element.
data statusNode type ref to if_ixml_element.
data rc type sysubrc.
data progAttribs type trdir.
data progSource type RSWSOURCET.
data _objName(30) type c.
data sourceString type string.
data _objType type string.
_objType = getObjectType( ).
rootNode = xmlDoc->create_element( _objType ).
sourceNode = xmlDoc->create_element( 'source' ).
*
rootNode = xmlDoc->find_from_name( _objType ).
*
call method GETSTRUCTUREFROMATTRIBUTES
*
exporting
*
node = rootNode
*
changing
*
structure = progAttribs.
*
objName = progAttribs-NAME.
*
** check existing
*
select single name from trdir into objName where NAME = objName.
*
if sy-subrc = 0.
*
raise exception type zcx_saplink
*
exporting textid = zcx_saplink=>existing.
*
endif.
*
*
sourceNode = rootNode->find_from_name( 'source' ).
*
source = sourceNode->get_value( ).
*
sourceTable = BUILDTABLEFROMSTRING( source ).
*
insert report progAttribs-NAME from sourceTable.
*
*
commit work.
*
*
call function 'RS_INSERT_INTO_WORKING_AREA'
*
EXPORTING
*
object
= 'REPS'
*
obj_name
= aobjName
*
EXCEPTIONS
*
wrong_object_name = 1.
*
if sy-subrc <> 0.
*
*
endif.
*
*else.
_objtype = getobjecttype( ).
xmldoc = ixmldocument.
rootnode = xmldoc->find_from_name( _objtype ).
call method getstructurefromattributes
exporting
node
= rootnode
changing
structure = progattribs.
objname = progattribs-name.
*
*
*
*
*
*
endif.
enqueue_abap( ).
transport_copy( author = progattribs-cnam devclass = devclass ).
sourcenode = rootnode->find_from_name( 'source' ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
create_source( source = sourcetable attribs = progattribs ).
textnode = rootnode->find_from_name( 'textPool' ).
create_textpool( textnode ).
dynpnode = rootnode->find_from_name( 'dynpros' ).
create_dynpro( dynpnode ).
statnode = rootnode->find_from_name( 'pfstatus' ).
create_pfstatus( statnode ).
dequeue_abap( ).
*endif.
* successful install
name = objname.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method create_dynpro.
types: begin of tdyn_head_temp.
include type d020s.
types: dtext type d020t-dtxt.
types: end of tdyn_head_temp.
data: idyn_fldl type table of d021s,
idyn_flow type table of d022s,
idyn_mcod type table of d023s.
data: xdyn_head
xdyn_fldl
xdyn_flow
xdyn_mcod
type
type
type
type
d020s,
d021s,
d022s,
d023s.
data dynpro_node
data dynpro_filter
data dynpro_iterator
data dynfldl_node
data dynfldl_filter
data dynfldl_iterator
data dynmcod_node
data dynmcod_filter
data dynmcod_iterator
data dynflow_node
= xdyn_head_temp.
= xdyn_head_temp-dtext.
changing
structure = xdyn_fldl.
append xdyn_fldl to idyn_fldl.
dynfldl_node ?= dynfldl_iterator->get_next( ).
endwhile.
* Retrieve matchcode data.
free: dynmcod_filter, dynmcod_iterator, dynmcod_node.
dynmcod_filter = dynpro_node->create_filter_name( 'dynprofield' ).
dynmcod_iterator =
dynpro_node->create_iterator_filtered( dynmcod_filter ).
dynmcod_node ?= dynmcod_iterator->get_next( ).
while dynmcod_node is not initial.
call method getstructurefromattributes
exporting
node
= dynmcod_node
changing
structure = xdyn_mcod.
append xdyn_mcod to idyn_mcod.
dynmcod_node ?= dynmcod_iterator->get_next( ).
endwhile.
* retieve flow logic source.
clear xdynpro_flow_source. refresh idynpro_flow_source.
clear xdyn_flow.
refresh idyn_flow.
free dynflow_node.
dynflow_node = dynpro_node->find_from_name( 'dynproflowsource' ).
xdynpro_flow_source = dynflow_node->get_value( ).
idynpro_flow_source = buildtablefromstring( xdynpro_flow_source ).
loop at idynpro_flow_source into xdyn_flow.
append xdyn_flow to idyn_flow.
endloop.
* Build dynpro from data
call function 'RPY_DYNPRO_INSERT_NATIVE'
exporting
*
suppress_corr_checks
= ' '
*
CORRNUM
= ' '
header
= xdyn_head
dynprotext
= xdyn_text
*
SUPPRESS_EXIST_CHECKS
= ' '
*
USE_CORRNUM_IMMEDIATEDLY
= ' '
*
SUPPRESS_COMMIT_WORK
= ' '
tables
fieldlist
= idyn_fldl
flowlogic
= idyn_flow
params
= idyn_mcod
exceptions
cancelled
= 1
already_exists
= 2
program_not_exists
= 3
not_executed
= 4
others
= 5.
if sy-subrc <> 0.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>system_error.
endif.
dynpro_node ?= dynpro_iterator->get_next( ).
endwhile.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method create_pfstatus.
data: ista
ifun
imen
imtx
iact
ibut
ipfk
iset
idoc
itit
ibiv
type
type
type
type
type
type
type
type
type
type
type
table
table
table
table
table
table
table
table
table
table
table
of
of
of
of
of
of
of
of
of
of
of
rsmpe_stat,
rsmpe_funt,
rsmpe_men,
rsmpe_mnlt,
rsmpe_act,
rsmpe_but,
rsmpe_pfk,
rsmpe_staf,
rsmpe_atrt,
rsmpe_titt,
rsmpe_buts.
data: xsta
xfun
xmen
xmtx
xact
xbut
xpfk
xset
xdoc
xtit
xbiv
type
type
type
type
type
type
type
type
type
type
type
rsmpe_stat,
rsmpe_funt,
rsmpe_men,
rsmpe_mnlt,
rsmpe_act,
rsmpe_but,
rsmpe_pfk,
rsmpe_staf,
rsmpe_atrt,
rsmpe_titt,
rsmpe_buts.
data
data
data
data
data
data
data
data
stat_node
node
filter
iterator
type
type
type
type
ref
ref
ref
ref
_objname = objname.
to
to
to
to
stat_node = pfstat_node.
if_ixml_element.
if_ixml_element.
if_ixml_node_filter.
if_ixml_node_iterator.
endwhile.
* read pfstatus_act node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_act' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xact.
append xact to iact.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_but node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_but' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xbut.
append xbut to ibut.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_pfk node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_pfk' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xpfk.
append xpfk to ipfk.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_set node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_set' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xset.
append xset to iset.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_doc node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_doc' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xdoc.
append xdoc to idoc.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_tit node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_tit' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xtit.
append xtit to itit.
node ?= iterator->get_next( ).
endwhile.
* read pfstatus_biv node
free: filter, iterator, node.
filter = stat_node->create_filter_name( 'pfstatus_biv' ).
iterator = stat_node->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
while node is not initial.
call method getstructurefromattributes
exporting
node
= node
changing
structure = xbiv.
append xbiv to ibiv.
node ?= iterator->get_next( ).
endwhile.
* Update the gui status
_program = _objname.
xtrkey-obj_type
xtrkey-obj_name
xtrkey-sub_type
xtrkey-sub_name
call function
exporting
program
language
tr_key
=
=
=
=
'PROG'.
_program.
'CUAD'.
_program.
'RS_CUA_INTERNAL_WRITE'
= _program
= sy-langu
= xtrkey
adm
state
tables
sta
fun
men
mtx
act
but
pfk
set
doc
tit
biv
exceptions
not_found
others
= xadm
= 'I'
=
=
=
=
=
=
=
=
=
=
=
ista
ifun
imen
imtx
iact
ibut
ipfk
iset
idoc
itit
ibiv
= 1
= 2.
if sy-subrc <> 0.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>system_error.
endif.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method CREATE_SOURCE .
data _objName type TROBJ_NAME.
data progLine type PROGDIR.
data titleInfo type trdirti.
data reportLine type string.
data miniReport type table_of_strings.
_objName = objName.
call function 'RS_INSERT_INTO_WORKING_AREA'
exporting
OBJECT = 'REPS'
OBJ_NAME = _objName
exceptions
WRONG_OBJECT_NAME = 1.
INSERT REPORT _objName FROM source STATE 'I'
program type attribs-subc. "added to handle includes, etc.
MOVE 'I' TO progline-STATE.
move-corresponding attribs to progline.
aTextNode ?= textIterator->get_next( ).
*For some reason the 1st one is blank... not sure why.
aTextNode ?= textIterator->get_next( ).
while aTextNode is not initial.
call method GETSTRUCTUREFROMATTRIBUTES
exporting
node = aTextNode
changing
structure = textPoolRow.
append textPoolRow to textPoolTable.
aTextNode ?= textIterator->get_next( ).
endwhile.
if textPoolTable is not initial.
lang = langNode->get_attribute( 'SPRAS' ).
if lang = sy-langu.
logonLanguageExists = 'X'.
_state = 'I'.
else.
*
seems that if a textpool is inserted as inactive for language
*
other than the logon language, it is lost upon activation
*
not sure inserting as active is best solution,but seems to work
_state = 'A'.
endif.
endif.
insert textpool _objName from textPooltable language lang
state _state.
langNode ?= langIterator->get_next( ).
endwhile.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method DELETEOBJECT .
data program type sy-repid.
program = objName.
CALL FUNCTION 'RS_DELETE_PROGRAM'
EXPORTING
* CORRNUMBER
=
program
= program
* SUPPRESS_CHECKS
= ' '
* SUPPRESS_COMMIT
= ' '
SUPPRESS_POPUP
= 'X'
* MASS_DELETE_CALL
= ' '
* WITH_CUA
= 'X'
* WITH_DOCUMENTATION
= 'X'
* WITH_DYNPRO
= 'X'
* WITH_INCLUDES
= ' '
* WITH_TEXTPOOL
= 'X'
* WITH_VARIANTS
= 'X'
* TADIR_DEVCLASS
=
* SKIP_PROGRESS_IND
= ' '
* FORCE_DELETE_USED_INCLUDES
= ' '
* IMPORTING
* CORRNUMBER
=
* PROGRAM
=
* EXCEPTIONS
* ENQUEUE_LOCK
= 1
* OBJECT_NOT_FOUND
= 2
* PERMISSION_FAILURE
= 3
* REJECT_DELETION
= 4
* OTHERS
= 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method DEQUEUE_ABAP .
call function 'RS_ACCESS_PERMISSION'
exporting
global_lock
=
mode
=
object
=
object_class
=
exceptions
canceled_in_corr
=
enqueued_by_user
=
enqueue_system_failure =
locked_by_author
=
illegal_parameter_values =
no_modify_permission
=
no_show_permission
=
'X'
'FREE'
objName
'ABAP'
1
3
4
5
6
7
8
permission_failure
= 9.
if sy-subrc <> 0.
case sy-subrc.
when 7 or 8 or 9.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>not_authorized.
when 5.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>error_message
msg = 'object locked'.
when others.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>system_error.
endcase.
endif.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method ENQUEUE_ABAP .
*
*
*
*
*
*
no_modify_permission
no_show_permission
permission_failure
= 7
= 8
= 9.
if sy-subrc <> 0.
case sy-subrc.
when 7 or 8 or 9.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>not_authorized.
when 5.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>error_message
msg = 'object locked'.
when others.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>system_error.
endcase.
endif.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method GETOBJECTTYPE .
objectType = 'PROG'. "ABAP Program
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
type
type
type
type
d020s,
d021s,
d022s,
d023s.
_objname = objname.
* Get all dynpros for program object
clear xdynp. refresh idynp.
select prog dnum into table idynp
from d020s
where prog = _objname
and type <> 'S'
" No Selection Screens
and type <> 'J'. " No selection subscreens
check sy-subrc = 0 .
dynp_node = xmldoc->create_element( 'dynpros' ).
loop at idynp into xdynp.
* Retrieve dynpro imformation
dynnr_node = xmldoc->create_element( 'dynpro' ).
clear:
xdyn_head, xdyn_fldl, xdyn_flow, xdyn_mcod.
refresh: idyn_fldl, idyn_flow, idyn_mcod.
call function 'RPY_DYNPRO_READ_NATIVE'
exporting
progname
= xdynp-prog
*
*
dynnr
SUPPRESS_EXIST_CHECKS
SUPPRESS_CORR_CHECKS
importing
HEADER
dynprotext
tables
fieldlist
flowlogic
params
FIELDTEXTS
exceptions
cancelled
not_found
permission_error
others
= xdynp-dnum
= ' '
= ' '
= xdyn_head
= xdyn_text
= idyn_fldl
= idyn_flow
= idyn_mcod
=
=
=
=
=
1
2
3
4.
check sy-subrc = 0.
* Add heading information for screen.
setattributesfromstructure(
node = dynnr_node structure = xdyn_head ).
* Add the dynpro text also.
xdyn_text_string = xdyn_text.
rc = dynnr_node->set_attribute(
name = 'DTEXT' value = xdyn_text_string ).
rc = dynp_node->append_child( dynnr_node ).
* Add fields information for screen.
if not idyn_fldl[] is initial.
loop at idyn_fldl into xdyn_fldl.
dynprofieldsnode = xmldoc->create_element( 'dynprofield' ).
setattributesfromstructure(
node = dynprofieldsnode structure = xdyn_fldl ).
rc = dynnr_node->append_child( dynprofieldsnode ).
endloop.
endif.
* Add flow logic of screen
if not idyn_flow[] is initial.
clear xflowsource. refresh iflowsource.
loop at idyn_flow into xdyn_flow.
xflowsource = xdyn_flow.
append xflowsource to iflowsource.
endloop.
dynproflownode = xmldoc->create_element( 'dynproflowsource' ).
flowsourcestring = buildsourcestring( sourcetable = iflowsource ).
rc = dynproflownode->if_ixml_node~set_value( flowsourcestring ).
rc = dynnr_node->append_child( dynproflownode ).
endif.
* Add matchcode information for screen.
if not idyn_mcod[] is initial.
loop at idyn_mcod into xdyn_mcod.
check not xdyn_mcod-type is initial
and not xdyn_mcod-content is initial.
dynpromatchnode = xmldoc->create_element( 'dynpromatchcode' ).
setattributesfromstructure(
node = dynpromatchnode structure = xdyn_mcod ).
rc = dynnr_node->append_child( dynpromatchnode ).
endloop.
endif.
endloop.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method get_pfstatus.
data: ista
ifun
imen
imtx
iact
ibut
ipfk
iset
idoc
itit
ibiv
type
type
type
type
type
type
type
type
type
type
type
table
table
table
table
table
table
table
table
table
table
table
data: xsta
xfun
xmen
xmtx
xact
xbut
xpfk
xset
xdoc
xtit
xbiv
type
type
type
type
type
type
type
type
type
type
type
rsmpe_stat,
rsmpe_funt,
rsmpe_men,
rsmpe_mnlt,
rsmpe_act,
rsmpe_but,
rsmpe_pfk,
rsmpe_staf,
rsmpe_atrt,
rsmpe_titt,
rsmpe_buts.
data
data
data
data
data
data
data
data
data
sta_node
fun_node
men_node
mtx_node
act_node
but_node
pfk_node
set_node
doc_node
type
type
type
type
type
type
type
type
type
ref
ref
ref
ref
ref
ref
ref
ref
ref
of
of
of
of
of
of
of
of
of
of
of
to
to
to
to
to
to
to
to
to
rsmpe_stat,
rsmpe_funt,
rsmpe_men,
rsmpe_mnlt,
rsmpe_act,
rsmpe_but,
rsmpe_pfk,
rsmpe_staf,
rsmpe_atrt,
rsmpe_titt,
rsmpe_buts.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
if_ixml_element.
setattributesfromstructure(
node = biv_node
structure = xbiv ).
rc = pfstat_node->append_child( biv_node ).
endloop.
endif.
* It itit is filled, assume one or more titles
if itit[] is not initial.
loop at itit into xtit.
tit_node = xmldoc->create_element( 'pfstatus_tit' ).
setattributesfromstructure(
node = tit_node
structure = xtit ).
rc = pfstat_node->append_child( tit_node ).
endloop.
endif.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method GET_TEXTPOOL .
data
data
data
data
data
data
data
data
data
_objName = objName.
textNode = xmlDoc->create_element( 'textPool' ).
CALL FUNCTION 'RS_TEXTLOG_GET_PARAMETERS'
changing
INSTALLED_LANGUAGES = languageList.
loop at languageList into aLanguage.
read textpool _objName into textPoolTable language aLanguage.
if sy-subrc = 0.
languageNode = xmlDoc->create_Element( 'language' ).
sTemp = aLanguage.
rc = languageNode->set_attribute( name = 'SPRAS' value = sTemp ).
loop at textPoolTable into textPoolRow.
aText = xmlDoc->create_element( 'textElement' ).
setAttributesFromStructure( node = aText structure =
textPoolRow ).
rc = languageNode->append_child( aText ).
endloop.
rc = textNode->append_child( languageNode ).
endif.
endloop.
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
method TRANSPORT_COPY .
*
*
*
*
*
*
if sy-subrc <> 0.
case sy-subrc.
when 2.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>not_authorized.
when others.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>system_error.
endcase.
endif.
endmethod.
ENDCLASS.
CLASS ZSAPLINK_CLASS IMPLEMENTATION.
method CHECKEXISTS .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
data classkey type SEOCLSKEY.
data not_active TYPE SEOX_BOOLEAN.
classKey-clsName = objname.
*
*
*
*
*
if sy-subrc <> 2.
exists = 'X'.
endif.
endmethod.
method CREATEIXMLDOCFROMOBJECT .
*/---------------------------------------------------------------------\
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
Interfaces -------------------*/
type seor_implementings_r,
like line OF it_implementings,
TYPE REF TO if_ixml_element.
clif_not_existing = 1
OTHERS
= 2.
IF sy-subrc <> 0.
ENDIF.
LOOP AT events INTO wa_event.
eventkey-clsname = wa_event-clsname.
eventkey-cmpname = wa_event-CMPNAME.
event_node = xmldoc->create_element( 'events' ).
setattributesfromstructure( node = event_node structure =
wa_event ).
CALL FUNCTION 'SEO_EVENT_SIGNATURE_GET'
EXPORTING
EVTKEY
= eventkey
importing
PARAMETERS
= eventparams.
*
parameters
loop at eventParams into wa_params.
IS NOT INITIAL.
_otrguid = attribproperties-attvalue+1(32).
otrnode = createnodefromotr( _otrguid ).
if otrnode is bound.
rc = attribnode->append_child( otrnode ).
endif.
ENDIF.
*
*// ewH: begin of logic for interface methods & inheritance redesign-->
* inheritances & redefinitions: old source removed-recover w/subversion
CALL FUNCTION 'SEO_INHERITANC_READ'
EXPORTING
CLSKEY
= classKey
IMPORTING
INHERITANCE
= inheritance
REDEFINITIONS
= redefinitions
EXCEPTIONS
CLASS_NOT_EXISTING
= 1
OTHERS
= 2.
if inheritance is not initial.
inheritanceNode = xmldoc->create_element( 'inheritance' ).
setattributesfromstructure( node = inheritanceNode structure =
inheritance ).
loop at redefinitions into redefinition.
redefNode = xmldoc->create_element( 'redefinition' ).
setattributesfromstructure( node = redefNode structure =
redefinition ).
rc = inheritanceNode->append_child( redefNode ).
endloop.
rc = rootnode->append_child( inheritanceNode ).
endif.
* methods
LOOP AT classdescr->methods INTO methoddescr where
not ( is_inherited = 'X' and is_redefined is initial ).
methodkey-clsname = _classname.
methodkey-cpdname = methoddescr-name.
* interface methods
if methoddescr-is_interface = 'X'.
CALL METHOD cl_oo_classname_service=>get_method_include
EXPORTING
mtdkey
= methodkey
RECEIVING
result
= includename
EXCEPTIONS
method_not_existing = 1.
IF sy-subrc = 0.
methodnode = xmldoc->create_element( 'interfaceMethod' ).
setattributesfromstructure( node = methodnode structure =
methodkey ).
sourcenode = xmldoc->create_element( 'source' ).
*
tempString = includeName.
*
*
rc = sourceNode->set_attribute(
name = 'includeName' value = tempString ).
READ REPORT includename INTO reportlist.
reportstring = buildsourcestring( sourcetable = reportlist ).
rc = sourcenode->if_ixml_node~set_value( reportstring ).
rc = methodnode->append_child( sourcenode ).
rc = rootnode->append_child( methodnode ).
ENDIF.
other methods
else.
clsmethkey-clsname = _classname.
clsmethkey-cmpname = methoddescr-name.
CLEAR methodproperties.
if methoddescr-is_redefined = 'X'.
methodnode = xmldoc->create_element( 'method' ).
move-corresponding clsMethKey to methodProperties.
*// ewh: begin of forward compatibility hack, can be removed for next
*//
major release-->
read table redefinitions into redefinition
with key mtdname = methoddescr-name.
if sy-subrc = 0.
methodProperties-clsname = redefinition-refclsname.
endif.
*//<--ewH: end of forward compatibility hack
setattributesfromstructure( node = methodnode structure =
methodproperties ).
else.
CALL FUNCTION 'SEO_METHOD_GET'
EXPORTING
mtdkey
= clsmethkey
IMPORTING
method
= methodproperties
EXCEPTIONS
not_existing = 1.
IF sy-subrc = 0.
methodnode = xmldoc->create_element( 'method' ).
setattributesfromstructure( node = methodnode structure =
methodproperties ).
*
parameters
LOOP AT methoddescr-parameters INTO paramdescr.
CLEAR paramproperties.
parameternode = xmldoc->create_element( 'parameter' ).
paramkey-cmpname = clsmethkey-cmpname.
paramkey-sconame = paramdescr-name.
paramkey-clsname = objname.
CALL FUNCTION 'SEO_PARAMETER_GET'
EXPORTING
parkey
= paramkey
version = '1'
IMPORTING
parameter = paramproperties.
setattributesfromstructure( node = parameternode
structure = paramproperties ).
rc = methodnode->append_child( parameternode ).
ENDLOOP.
exceptions
CALL FUNCTION 'SEO_METHOD_SIGNATURE_GET'
EXPORTING
mtdkey = clsmethkey
version = '1'
IMPORTING
exceps = exceptionlist.
LOOP AT exceptionlist INTO anexception.
exceptionnode = xmldoc->create_element( 'exception' ).
setattributesfromstructure( node = exceptionnode
structure = anexception ).
rc = methodnode->append_child( exceptionnode ).
ENDLOOP.
endif. "method found
endif. "is_redefined?
source
CALL METHOD cl_oo_classname_service=>get_method_include
EXPORTING
mtdkey
= methodkey
RECEIVING
result
= includename
EXCEPTIONS
method_not_existing = 1.
IF sy-subrc = 0.
READ REPORT includename INTO reportlist.
reportstring = buildsourcestring( sourcetable = reportlist ).
sourcenode = xmldoc->create_element( 'source' ).
rc = sourcenode->if_ixml_node~set_value( reportstring ).
rc = methodnode->append_child( sourcenode ).
endif.
rc = rootnode->append_child( methodnode ).
endif. "is_interface?
endloop.
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA
data
data
data
DATA
type rrq
type TRKORR,
type DEVCLASS,
type SEOVERSION,
type GENFLAG,
type SEOX_BOOLEAN,
type SEOX_BOOLEAN,
type SEOX_BOOLEAN,
type SEOX_BOOLEAN,
type SEO_METHOD_SOURCE_TABLE,
type RSWSOURCET,
type RSWSOURCET,
type RSWSOURCET,
type SEOX_BOOLEAN,
type trkorr,
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
type
VSEOCLASS,
VSEOEXTEND,
SEOR_REDEFINITIONS_R,
SEOR_IMPLEMENTINGS_R,
SEO_REDEFINITIONS,
SEOO_ATTRIBUTES_R,
SEOO_METHODS_R,
SEOO_EVENTS_R,
SEOO_TYPES_R,
SEOP_SOURCE,
SEOP_SOURCE,
SEOS_PARAMETERS_R,
SEOS_EXCEPTIONS_R,
SEOO_ALIASES_R,
SEOT_TYPEPUSAGES_R,
SEOT_CLSDEFERRDS_R,
SEOT_INTDEFERRDS_R,
SEO_FRIENDS,
*tb_component_descr
type table of seocompotx,
*tb_subcomponent_descr
type table of seosubcotx,
* work areas for the tables
wa_attributes
type SEOO_ATTRIBUTE_R,
wa_types
type SEOO_TYPE_R,
wa_friends
type seofriends,
wa_implementings
type SEOR_IMPLEMENTING_R,
wa_redefinitions
type SEOREDEF,
wa_methods
type SEOO_METHOD_R,
wa_parameters
type seos_parameter_r,
wa_exceps
type seos_exception_r,
wa_typeusages
type SEOT_TYPEPUSAGE_R, "forward declarations
wa_method_Sources
type SEO_METHOD_SOURCE,
wa_events
type SEOO_EVENT_R.
data: lines type i.
*//<-- end of new data types rrq
CALL FUNCTION 'SEO_BUFFER_INIT'.
e_devclass = devclass.
_objtype = getobjecttype( ).
e_overwrite = overwrite.
xmldoc = ixmldocument.
rootnode = xmldoc->find_from_name( _objtype ).
CALL METHOD getstructurefromattributes
EXPORTING
node
= rootnode
CHANGING
structure = ch_class.
objname = classkey-clsname = ch_class-clsname.
ch_class-version = '0'.
superclass = rootnode->get_attribute( name = 'REFCLSNAME' ).
IF superclass IS NOT INITIAL.
* set something for inheritence
superclasskey-clsname = classkey-clsname.
superclasskey-refclsname = superclass.
superclasskey-version = '0'.
superclasskey-state = '1'.
MOVE-CORRESPONDING superclasskey to ch_inheritance.
ch_inheritance-author = 'BCUSER'.
ch_inheritance-createdOn = sy-datum.
ENDIF.
*Add attributes to new class
data otrConcept type SOTR_TEXT-CONCEPT.
filter = xmldoc->create_filter_name( 'attribute' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
*
*
*
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR wa_implementings.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node
CHANGING
structure = wa_implementings.
append wa_implementings to ch_implementings.
node ?= iterator->get_next( ).
ENDWHILE.
*//<--ewH: End of Added Logic for Implementings(interfaces)
*// rrq: Added Logic for events-->
filter = xmldoc->create_filter_name( 'events' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR wa_events.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node
CHANGING
structure = wa_events.
append wa_events to ch_events.
filter2 = node->create_filter_name( 'parameter' ).
iterator2 = node->create_iterator_filtered( filter2 ).
node2 ?= iterator2->get_next( ).
WHILE node2 IS NOT INITIAL.
CLEAR wa_parameters.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node2
CHANGING
structure = wa_parameters.
append wa_parameters to ch_parameters.
node2 ?= iterator2->get_next( ).
endwhile.
node ?= iterator->get_next( ).
ENDWHILE.
*//<--rrq: End of Added Logic for events
*// ewH: start redesign method/inheritances-->
* inheritance
inheritanceNode = rootNode->find_from_name( 'inheritance' ).
if inheritanceNode is bound.
CALL METHOD getstructurefromattributes
EXPORTING
node
= inheritanceNode
CHANGING
structure = ch_inheritance.
* redefs
filter = inheritanceNode->create_filter_name( 'redefinition' ).
iterator = inheritanceNode->create_iterator_filtered( filter ).
redefNode ?= iterator->get_next( ).
WHILE redefNode IS NOT INITIAL.
CALL METHOD getstructurefromattributes
EXPORTING
node
= redefNode
CHANGING
structure = wa_redefinitions.
append wa_redefinitions to ch_redefinitions.
redefNode ?= iterator->get_next( ).
ENDWHILE.
endif.
*Add Methods to new class
filter = xmldoc->create_filter_name( 'method' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR wa_methods.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node
CHANGING
structure = wa_methods.
*
node
= node2
CHANGING
structure = wa_exceps.
append wa_exceps to ch_exceps.
node2 ?= iterator2->get_next( ).
ENDWHILE.
append wa_methods to ch_methods.
node ?= iterator->get_next( ).
ENDWHILE.
*// <--ewH: end redesign method/inheritances
*// ewh: continuation of backward compatibility hack-->
* IF ( ch_redefinitions IS NOT INITIAL OR superclass-clsname
* IS NOT INITIAL ) and ch_inheritance is initial.
*
CALL FUNCTION 'SEO_INHERITANC_CREATE_F_DATA'
*
EXPORTING
*
save
= ' '
*
CHANGING
*
inheritance = superclasskey
*
redefinitions = ch_redefinitions.
* ENDIF.
*// <--ewH: end of backward compatibility hack
DATA classtype TYPE seoclstype.
DATA impkeys TYPE seor_implementing_keys.
DATA iserror TYPE boolean.
*rrq comments Forward nodes are created in an old version of the
*create XML from object. In that node, the only attribute set
*is the "TypeGroup". All other attributes are hard coded on the
*create Object from XML . To fix this and make it transparent to
*users, "forwaredDeclaration" nodes will be supported, and a new
*node will be added.
*if it is an old version XML document, forwardDeclarations nodes
*if it is a new version XML document, typeUsages nodes
*ewH: for version 0.1.3, we will continue to generate both nodes
* in order for upgradeability of saplink itself. For version
* 2.0, forwardDeclaration node generations will be deprecated.
filter = xmldoc->create_filter_name( 'typeUsage' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node
CHANGING
structure = wa_typeUsages.
APPEND wa_typeusages TO ch_typeusages.
node ?= iterator->get_next( ).
ENDWHILE.
* only check forwardDeclaration if typeUsages does not exist
if ch_typeusages is initial.
filter = xmldoc->create_filter_name( 'forwardDeclaration' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
source = node->get_value( ).
wa_typeusages-typegroup = source.
CLEAR wa_typeusages.
wa_typeusages-clsname = classkey-clsname.
wa_typeusages-version = '0'.
wa_typeusages-tputype = '0'.
wa_typeusages-explicit = 'X'.
wa_typeusages-implicit = ''.
wa_typeusages-typegroup = source.
APPEND wa_typeusages TO ch_typeusages.
node ?= iterator->get_next( ).
ENDWHILE.
endif.
new way....only one of these nodes should exist
filter = xmldoc->create_filter_name( 'typeUsage' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
*
*
*
*
*
* WHILE node IS NOT INITIAL.
*
CALL METHOD getstructurefromattributes
*
EXPORTING
*
node
= node
*
CHANGING
*
structure = wa_typeUsages.
*
APPEND wa_typeusages TO ch_typeusages.
*
node ?= iterator->get_next( ).
* ENDWHILE.
*Insert source code into the methods
filter = xmldoc->create_filter_name( 'method' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CALL METHOD getstructurefromattributes
EXPORTING
node
= node
CHANGING
structure = wa_methods.
methodkey-clsname = objname.
methodkey-cpdname = wa_methods-cmpname.
aobjname = methodkey.
methodsourcenode = node->find_from_name( 'source' ).
IF methodsourcenode IS NOT INITIAL.
clear wa_method_sources.
source = methodsourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
loop at sourceTable into source.
check source is not initial.
translate source to upper case.
shift source left deleting leading space.
if source+0(6) = 'METHOD'.
delete sourceTable index sy-tabix.
EXIT.
endif.
endloop.
describe table sourceTable lines lines.
while lines > 0.
read table sourceTable into source index lines.
if source cp 'endmethod*'.
if sy-subrc = 0 and source+0(1) <> '*'.
*
**// ewH: create interface methods-->
filter = xmldoc->create_filter_name( 'interfaceMethod' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
*
ch_type_source_temp = buildtablefromstring( source ).
*
append lines of ch_type_source_temp to ch_type_source.
* ENDIF.
name = objname.
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
EXPORTING
CORRNR
= e_corrnr
DEVCLASS
= e_devclass
VERSION
= e_version
GENFLAG
= e_genflag
AUTHORITY_CHECK
= e_authority_check
OVERWRITE
= e_overwrite
* SUPPRESS_METHOD_GENERATION
= e_suppress_meth_gen
* SUPPRESS_REFACTORING_SUPPORT
= e_suppress_refac_gen
METHOD_SOURCES
= e_method_sources
LOCALS_DEF
= e_locals_def
LOCALS_IMP
= e_locals_imp
LOCALS_MAC
= e_locals_mac
* SUPPRESS_INDEX_UPDATE
= e_suppress_ind_update
IMPORTING
KORRNR
= i_korrnr
* TABLES
* CLASS_DESCRIPTIONS
= tb_classDescription
* COMPONENT_DESCRIPTIONS
= tb_component_descr
* SUBCOMPONENT_DESCRIPTIONS
= tb_subcomponent_descr
CHANGING
CLASS
= ch_class
INHERITANCE
= ch_inheritance
REDEFINITIONS
= ch_redefinitions
IMPLEMENTINGS
= ch_implementings
IMPL_DETAILS
= ch_impl_details
ATTRIBUTES
= ch_attributes
METHODS
= ch_methods
EVENTS
= ch_events
TYPES
= ch_types
* TYPE_SOURCE
= ch_type_source "???
PARAMETERS
= ch_parameters
EXCEPS
= ch_exceps
ALIASES
= ch_aliases
TYPEPUSAGES
= ch_typeusages
CLSDEFERRDS
= ch_clsdeferreds
INTDEFERRDS
= ch_intdeferrds
FRIENDSHIPS
= ch_friendships
EXCEPTIONS
EXISTING
= 1
IS_INTERFACE
= 2
DB_ERROR
= 3
COMPONENT_ERROR
= 4
NO_ACCESS
= 5
OTHER
= 6
OTHERS
= 7.
case sy-subrc.
when '0'.
** i guess if we made it this far, we will assume success
** successful install
when '1'.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
when others.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>system_error.
endcase.
*ewH:insert pub, prot, and priv sections manually to keep any direct
* attribute/type definitions
aobjname = classkey-clsname.
**public
sourcenode = xmldoc->find_from_name( 'publicSection' ).
IF sourcenode IS NOT INITIAL.
includename = cl_oo_classname_service=>get_pubsec_name( _classname ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
INSERT REPORT includename FROM sourcetable EXTENSION TYPE
srext_ext_class_public STATE 'I'.
ENDIF.
**protected
sourcenode = xmldoc->find_from_name( 'protectedSection' ).
IF sourcenode IS NOT INITIAL.
includename = cl_oo_classname_service=>get_prosec_name( _classname ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
INSERT REPORT includename FROM sourcetable EXTENSION TYPE
srext_ext_class_protected STATE 'I'.
ENDIF.
**private
sourcenode = xmldoc->find_from_name( 'privateSection' ).
IF sourcenode IS NOT INITIAL.
includename = cl_oo_classname_service=>get_prisec_name( _classname ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
INSERT REPORT includename FROM sourcetable EXTENSION TYPE
srext_ext_class_private STATE 'I'.
ENDIF.
* insert inactive sections into worklist
CALL FUNCTION 'RS_INSERT_INTO_WORKING_AREA'
EXPORTING
object
= 'CPUB'
obj_name
= aobjname
EXCEPTIONS
wrong_object_name = 1.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'RS_INSERT_INTO_WORKING_AREA'
EXPORTING
object
= 'CPRO'
obj_name
= aobjname
EXCEPTIONS
wrong_object_name = 1.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'RS_INSERT_INTO_WORKING_AREA'
EXPORTING
object
= 'CPRI'
obj_name
= aobjname
EXCEPTIONS
wrong_object_name = 1.
IF sy-subrc <> 0.
ENDIF.
endmethod.
method DELETEOBJECT .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
data clsKey type SEOCLSKEY.
clsKey-clsname = objname.
CALL FUNCTION 'SEO_CLASS_DELETE_W_DEPS'
EXPORTING
clskey
= clsKey
EXCEPTIONS
NOT_EXISTING
= 1
IS_INTERFACE
= 2
NOT_DELETED
= 3
DB_ERROR
= 4
OTHERS
= 5
.
if sy-subrc <> 0.
case sy-subrc.
when 1.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>not_found.
when 2.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>error_message
msg = 'interfaces not supported'.
when 3.
raise exception type zcx_saplink
exporting
textid = zcx_saplink=>error_message
msg = 'class not deleted'.
when others.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>system_error.
endcase.
endif.
endmethod.
method FINDIMPLEMENTINGCLASS .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
data
data
data
data
data
if startClass is initial.
methodKey-CLSNAME = objName.
else.
methodKey-clsName = startClass.
endif.
methodKey-CMPNAME = methodName.
call function 'SEO_METHOD_GET'
exporting
MTDKEY = methodKey
importing
method = methodProperties
exceptions
NOT_EXISTING = 1.
if sy-subrc = 0.
className = methodProperties-clsname.
else.
classDescr ?= cl_abap_classDescr=>describe_by_name(
methodKey-clsName ).
call method classDescr->GET_SUPER_CLASS_TYPE
receiving
P_DESCR_REF = superClass
exceptions
SUPER_CLASS_NOT_FOUND = 1.
superClassName = superClass->GET_RELATIVE_NAME( ).
className = FINDIMPLEMENTINGCLASS( methodName = methodName
startClass = superCLassName ).
endif.
endmethod.
method GETOBJECTTYPE .
*/---------------------------------------------------------------------\
*| This file is part of SAPlink.
|
*|
|
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version.
|
*|
|
*| SAPlink is distributed in the hope that it will be useful,
|
*| but WITHOUT ANY WARRANTY; without even the implied warranty of
|
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
*| GNU General Public License for more details.
|
*|
|
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the
|
*| Free Software Foundation, Inc.,
|
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
*\---------------------------------------------------------------------/
objecttype = 'CLAS'. "Class
endmethod.
ENDCLASS.
type-pools: seor, abap.
data retFileTable type FILETABLE.
data retRc type sysubrc.
data retUserAction type i.
data tempXMLString type string.
data ixmlNugget type ref to if_ixml_document.
data pluginExists type flag.
data objectExists type flag.
data flag type flag.
data statusMsg type string.
DATA y2all type flag.
selection-screen begin of Line.
SELECTION-SCREEN COMMENT 1(20) fileCom FOR FIELD NUGGFIL.
parameters NUGGFIL(300) type c modif id did obligatory.
selection-screen end of Line.
selection-screen begin of Line.
SELECTION-SCREEN COMMENT 1(20) checkCom FOR FIELD NUGGFIL.
parameters overwrt type c as checkbox default 'X'.
selection-screen end of Line.
start-of-selection.
clear tempXMLString.
perform uploadXMLFromLM using NUGGFIL tempXMLString.
perform CONVERTSTRINGTOIXMLDOC using tempXMLString changing ixmlNugget.
perform installNugget using ixmlNugget overwrt.
*/--------------------------------------------------------------------\
*| Selection screen events
|
initialization.
fileCom = 'Installation Nugget'.
checkCom = 'Overwrite Originals'.
*/--------------------------------------------------------------------\
*| Forms from the SAPLink Root Class
|
form CONVERTSTRINGTOIXMLDOC
using
xmlString type string
changing
ixmlDocument type ref to if_ixml_document.
data ixml type ref to if_ixml.
data streamFactory type ref to IF_IXML_STREAM_FACTORY.
|
|
FORM GETOBJECTInfoFROMIXMLDOC
using ixmlDocument type ref to if_ixml_document
changing objTypeName type string objName type string.
data rootNode type ref to IF_IXML_NODE.
data rootAttr type ref to IF_IXML_NAMED_NODE_MAP.
data AttrNode type ref to IF_IXML_NODE.
data nodeName type string.
rootNode ?= ixmlDocument->GET_ROOT_ELEMENT( ).
* get object type
objTypeName = rootNode->GET_NAME( ).
translate objTypeName to upper case.
* get object name
rootAttr = rootNode->GET_ATTRIBUTES( ).
AttrNode = rootAttr->GET_ITEM( 0 ).
objName = AttrNode->GET_VALUE( ).
ENDFORM.
*/--------------------------------------------------------------------\
*| Nugget Class
|
form
installNugget
using xmlDoc type ref to if_ixml_document overwrite type c.
types: begin of t_objectTable,
classname type string,
object type ko100-object,
text type ko100-text,
end of t_objectTable.
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
data
ixml = cl_ixml=>create( ).
nameFilter = xmlDoc->create_filter_name( name = 'nugget' ).
parentFilter = xmlDoc->create_filter_parent( nameFilter ).
iterator = xmlDoc->create_iterator_filtered( parentFilter ).
currentNode ?= iterator->get_next( ).
while currentNode is not initial.
clear exists.
ixmlDocument = ixml->create_document( ).
newNode = currentNode->clone( ).
rval = ixmlDocument->append_child( newNode ).
call method zsaplink=>GETOBJECTInfoFROMIXMLDOC
exporting
ixmlDocument = ixmlDocument
importing
objtypename = objType
objname
= _objName.
* call method zsaplink=>getplugins( changing objectTable = objectTable )
*.
*
* read table objectTable into objectLine with key object = objType.
*
* if sy-subrc = 0.
translate objType to upper case.
case objtype.
when 'CLAS'.
tempcname = 'ZSAPLINK_CLASS'.
when 'PROG'.
tempcname = 'ZSAPLINK_PROGRAM'.
when others.
endcase.
create object l_targetObject type (tempcname)
exporting name = _objName.
objectExists = l_targetObject->checkexists( ).
if objectExists = 'X' and overWrt = ''.
write :/ objType, _objName,
' exists on this system , if you wish to install this Nugget '
& 'please set the Overwrite Originals checkbox.'
.
elseif objectExists = 'X' and overWrt = 'X'.
if l_targetObject is not initial.