zsaplink instasaplink ller

Upload: prabhu-kushwaha

Post on 04-Mar-2016

255 views

Category:

Documents


1 download

DESCRIPTION

sap link installer

TRANSCRIPT

  • */---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/REPORT ZSAPLINK_INSTALLER.

    CLASS ZCX_SAPLINK DEFINITION INHERITING FROM CX_STATIC_CHECK CREATE PUBLIC .public section.

    constants ERROR_MESSAGE type SOTR_CONC value 'E40421B84B051AF1B83A0050568C0F65'. "#EC NOTEXT constants EXISTING type SOTR_CONC value 'E40421B84B051BF1B83A0050568C0F65'. "#EC NOTEXT constants INCORRECT_FILE_FORMAT type SOTR_CONC value 'E40421B84B051CF1B83A0050568C0F65'. "#EC NOTEXT constants LOCKED type SOTR_CONC value 'E40421B84B051DF1B83A0050568C0F65'. "#EC NOTEXT data MSG type STRING value '44F7518323DB08BC02000000A7E42BB6'. "#EC NOTEXT constants NOT_AUTHORIZED type SOTR_CONC value 'E40421B84B051EF1B83A0050568C0F65'. "#EC NOTEXT constants NOT_FOUND type SOTR_CONC value 'E40421B84B051FF1B83A0050568C0F65'. "#EC NOTEXT constants NO_PLUGIN type SOTR_CONC value 'E40421B84B0520F1B83A0050568C0F65'. "#EC NOTEXT constants SYSTEM_ERROR type SOTR_CONC value '005056B811CD1ED4B195DC694F38E0C3'. "#EC NOTEXT constants ZCX_SAPLINK type SOTR_CONC value 'E40421B84B0522F1B83A0050568C0F65'. "#EC NOTEXT data OBJECT type STRING .

    methods CONSTRUCTOR importing !TEXTID like TEXTID optional !PREVIOUS like PREVIOUS optional !MSG type STRING default '44F7518323DB08BC02000000A7E42BB6' !OBJECT type STRING optional .*"* protected components of class ZCX_SAPLINK*"* do not include other source files here!!!protected section.*"* private components of class ZCX_SAPLINK*"* do not include other source files here!!!private section.ENDCLASS.

  • CLASS ZSAPLINK DEFINITION CREATE PUBLIC ABSTRACT .public section.

    types: BEGIN OF gts_version_info,* Change this if import or export is incompatible to older major versions or if enhancements are so important to force the new version of the plugin* Please comment changes in major version in class documentation zsaplink_plugin_major_version TYPE i,* Change this if bugfixes are being done but the basic structure and im- and exportbehaviour don't change. Reset to 0 when incrementing major version* Please comment changes in minor version in class documentation zsaplink_plugin_minor_version TYPE i,* Change this if cosmetic changes are being done or if internal handling changed but no change to import- or exportbehaviour* ( i.e. speeding up the plugin will fall into this ). Reset to 0 when incrementeing major or minor version zsaplink_plugin_build_version TYPE i,* zsaplink_plugin_info1 TYPE string, " Plugin info - part 1 - See demoimplementation how this may be used zsaplink_plugin_info2 TYPE string, " Plugin info - part 2 zsaplink_plugin_info3 TYPE string, " Plugin info - part 3 zsaplink_plugin_info4 TYPE string, " Plugin info - part 4 zsaplink_plugin_info5 TYPE string, " Plugin info - part 5 END OF gts_version_info .

    data NUGGET_LEVEL type INT4 read-only value 0. "#EC NOTEXT

    class-methods GETOBJECTINFOFROMIXMLDOC importing !IXMLDOCUMENT type ref to IF_IXML_DOCUMENT exporting !OBJTYPENAME type STRING !OBJNAME type STRING raising ZCX_SAPLINK . 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 . class-methods GET_VERSION_INFO_STATIC importing !IV_CLASSNAME type CLIKE returning value(RS_VERSION_INFO) type GTS_VERSION_INFO . 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 CREATESTRINGFROMOBJECT returning value(STRING) type STRING 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 . methods VALUEHELP importing !I_OBJTYPE type STRING returning value(E_OBJNAME) type STRING . class-methods CHECKOBJECT importing !I_IXMLDOCUMENT type ref to IF_IXML_DOCUMENT exporting !E_OBJTYPE type STRING !E_OBJNAME type STRING !E_PLUGINEXISTS type FLAG !E_OBJECTEXISTS type FLAG !E_TARGETOBJECT type ref to ZSAPLINK . methods GET_VERSION_INFO returning value(RS_VERSION_INFO) type GTS_VERSION_INFO .*"* 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 . 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 importing value(NODE) type ref to IF_IXML_ELEMENT !DEVCLASS type DEVCLASS default '$TMP' exporting !CONCEPT type SOTR_TEXT-CONCEPT raising ZCX_SAPLINK . methods CREATENODEFROMOTR importing !OTRGUID type SOTR_CONC returning value(NODE) type ref to IF_IXML_ELEMENT .*"* private components of class ZSAPLINK*"* do not include other source files here!!!private section.

    types: BEGIN OF t_objecttable, classname TYPE string, object TYPE ko100-object, text TYPE ko100-text, END OF t_objecttable .

    data STREAMFACTORY type ref to IF_IXML_STREAM_FACTORY . data XMLDATA type STRING . data: objecttable TYPE TABLE OF t_objecttable .ENDCLASS.CLASS ZSAPLINK_OO DEFINITION INHERITING FROM ZSAPLINK CREATE PUBLIC

  • ABSTRACT .public section. type-pools ABAP . type-pools SEOP . type-pools SEOR . type-pools SEOS . type-pools SEOT . type-pools SEOX .

    constants C_XML_KEY_FRIENDS type STRING value 'friends'. "#EC NOTEXT constants C_XML_KEY_INHERITANCE type STRING value 'inheritance'. "#EC NOTEXT constants C_XML_KEY_SOTR type STRING value 'sotr'. "#EC NOTEXT constants C_XML_KEY_SOTRTEXT type STRING value 'sotrText'. "#EC NOTEXT*"* protected components of class ZSAPLINK_OO*"* do not include other source files here!!!protected section.

    constants C_XML_KEY_ALIAS_METHOD type STRING value 'aliasMethod'. "#EC NOTEXT constants C_XML_KEY_CLSDEFERRD type STRING value 'typeClasDef'. "#EC NOTEXT constants C_XML_KEY_FORWARDDECLARATION type STRING value 'forwardDeclaration'. "#EC NOTEXT constants C_XML_KEY_INTDEFERRD type STRING value 'typeIntfDef'. "#EC NOTEXT constants C_XML_KEY_TYPEPUSAGE type STRING value 'typeUsage'. "#EC NOTEXT

    methods CREATE_ALIAS_METHOD changing !XT_ALIASES_METHOD type SEOO_ALIASES_R . methods CREATE_CLSDEFERRD changing !XT_CLSDEFERRDS type SEOT_CLSDEFERRDS_R . methods CREATE_INTDEFERRD changing !XT_INTDEFERRDS type SEOT_INTDEFERRDS_R . methods CREATE_OTR importing value(NODE) type ref to IF_IXML_ELEMENT !DEVCLASS type DEVCLASS default '$TMP' exporting !CONCEPT type SOTR_TEXT-CONCEPT raising ZCX_SAPLINK . methods CREATE_TYPEPUSAGE changing !XT_TYPEPUSAGES type SEOT_TYPEPUSAGES_R . methods GET_ALIAS_METHOD importing !IT_METHODS type ABAP_METHDESCR_TAB changing !XO_ROOTNODE type ref to IF_IXML_ELEMENT . methods GET_CLSDEFERRD changing !XO_ROOTNODE type ref to IF_IXML_ELEMENT . methods GET_INTDEFERRD changing !XO_ROOTNODE type ref to IF_IXML_ELEMENT . methods GET_OTR importing !OTRGUID type SOTR_CONC returning

  • value(NODE) type ref to IF_IXML_ELEMENT . methods GET_TYPEPUSAGE changing !XO_ROOTNODE type ref to IF_IXML_ELEMENT .*"* private components of class ZSAPLINK_OO*"* do not include other source files here!!!private section.ENDCLASS.CLASS ZSAPLINK_CLASS DEFINITION INHERITING FROM ZSAPLINK_OO CREATE PUBLIC .public section.

    type-pools ABAP . data MV_STEAMROLLER type ABAP_BOOL value ABAP_FALSE. "#EC NOTEXT

    methods CHECKEXISTS redefinition . methods CREATEIXMLDOCFROMOBJECT redefinition . methods CREATEOBJECTFROMIXMLDOC redefinition . methods GET_VERSION_INFO redefinition .*"* protected components of class ZSAPLINK_CLASS*"* do not include other source files here!!!protected section.

    constants C_XML_KEY_METHOD_DOCUMENTATION type STRING value 'methodDocumentation'. "#EC NOTEXT constants C_XML_KEY_TEXTELEMENT type STRING value 'textElement'. "#EC NOTEXT constants C_XML_KEY_TEXTPOOL type STRING value 'textPool'. "#EC NOTEXT constants C_XML_KEY_CLASS_DOCUMENTATION type STRING value 'classDocumentation'. "#EC NOTEXT constants C_XML_KEY_LANGUAGE type STRING value 'language'. "#EC NOTEXT constants C_XML_KEY_OBJECT type STRING value 'OBJECT'. "#EC NOTEXT constants C_XML_KEY_SPRAS type STRING value 'SPRAS'. "#EC NOTEXT constants C_XML_KEY_TEXTLINE type STRING value 'textLine'. "#EC NOTEXT

    methods CREATE_DOCUMENTATION . methods CREATE_METHOD_DOCUMENTATION importing !NODE type ref to IF_IXML_ELEMENT . methods CREATE_SECTIONS . methods CREATE_TEXTPOOL . methods FINDIMPLEMENTINGCLASS importing !METHODNAME type STRING !STARTCLASS type STRING optional returning value(CLASSNAME) type STRING . methods GET_DOCUMENTATION changing !ROOTNODE type ref to IF_IXML_ELEMENT . methods GET_METHOD_DOCUMENTATION importing !METHOD_KEY type SEOCPDKEY changing !ROOTNODE type ref to IF_IXML_ELEMENT .

  • methods GET_SECTIONS changing !ROOTNODE type ref to IF_IXML_ELEMENT . methods GET_TEXTPOOL changing !ROOTNODE type ref to IF_IXML_ELEMENT .

    methods DELETEOBJECT redefinition . methods GETOBJECTTYPE redefinition .*"* private components of class ZSAPLINK_CLASS*"* do not include other source files here!!!private section.ENDCLASS.CLASS ZSAPLINK_PROGRAM DEFINITION INHERITING FROM ZSAPLINK FINAL CREATE PUBLIC .public section.

    methods CHECKEXISTS redefinition . methods CREATEIXMLDOCFROMOBJECT redefinition . methods CREATEOBJECTFROMIXMLDOC redefinition . methods CREATESTRINGFROMOBJECT 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 GET_SOURCE returning value(PROGSOURCE) type RSWSOURCET . methods UPDATE_WB_TREE . 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_DOCUMENTATION importing !DOCNODE 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 GET_DOCUMENTATION returning value(DOCNODE) type ref to IF_IXML_ELEMENT . 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 ZCX_SAPLINK IMPLEMENTATION. method CONSTRUCTOR. CALL METHOD SUPER->CONSTRUCTOR EXPORTING TEXTID = TEXTID PREVIOUS = PREVIOUS . IF textid IS INITIAL. me->textid = ZCX_SAPLINK . ENDIF. me->MSG = MSG . me->OBJECT = OBJECT . endmethod.ENDCLASS.CLASS ZSAPLINK IMPLEMENTATION. method BUILDSOURCESTRING.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |

  • *\---------------------------------------------------------------------/ data sTemp type string. data pageLine type O2PAGELINE.

    if sourceTable is not initial. loop at sourceTable into sTemp. concatenate sourceString sTemp CL_ABAP_CHAR_UTILITIES=>NEWLINE into sourceString. endloop. elseif pageTable is not initial. loop at pageTable into pageLine. concatenate sourceString pageLine-line CL_ABAP_CHAR_UTILITIES=>NEWLINE into sourceString. endloop. endif.

    * remove extra newline characters for conversion comparison consistency shift sourceString left deleting leading CL_ABAP_CHAR_UTILITIES=>NEWLINE. shift sourceString right deleting trailing CL_ABAP_CHAR_UTILITIES=>NEWLINE. shift sourceString left deleting leading space. endmethod. method BUILDTABLEFROMSTRING.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ split source at CL_ABAP_CHAR_UTILITIES=>NEWLINE into table sourceTable. endmethod. METHOD checkobject. DATA l_objtable LIKE objecttable. DATA l_objline LIKE LINE OF objecttable.

    CLEAR: e_objtype, e_objname, e_pluginexists, e_objectexists. TRY. CALL METHOD zsaplink=>getobjectinfofromixmldoc EXPORTING ixmldocument = i_ixmldocument IMPORTING objtypename = e_objtype objname = e_objname. CATCH zcx_saplink. ENDTRY.

  • CALL METHOD zsaplink=>getplugins( CHANGING objecttable = l_objtable ).

    READ TABLE l_objtable INTO l_objline WITH KEY object = e_objtype.

    IF sy-subrc = 0. e_pluginexists = 'X'. CREATE OBJECT e_targetobject TYPE (l_objline-classname) EXPORTING name = e_objname.

    e_objectexists = e_targetobject->checkexists( ). ENDIF.

    ENDMETHOD. method CONSTRUCTOR.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/

    * data meTypeDescr type ref to CL_ABAP_TYPEDESCR.* clear className.** objName = name.* meTypeDescr = CL_ABAP_TYPEDESCR=>DESCRIBE_BY_OBJECT_REF( me ).* className = meTypeDescr->get_relative_name( ).

    objName = name. translate objName to upper case.

    ixml = cl_ixml=>create( ). xmlDoc = ixml->create_document( ). streamFactory = ixml->CREATE_STREAM_FACTORY( ). endmethod. method CONVERTIXMLDOCTOSTRING.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |

  • *| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ data _ixml type ref to if_ixml. data _encoding type ref to if_ixml_encoding. 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 _tempStringx type xstring. data _printXMLDoc type ref to cl_xml_document. data _rc type sysubrc.

    _ixml = cl_ixml=>create( ). _encoding = _ixml->create_encoding( byte_order = if_ixml_encoding=>co_none character_set = 'utf-8' ). _streamFactory = _ixml->CREATE_STREAM_FACTORY( ). _outputStream = _streamFactory->create_ostream_xstring( _tempStringx ). _outputstream->set_encoding( encoding = _encoding ). _renderer = _ixml->CREATE_RENDERER( DOCUMENT = ixmlDocument OSTREAM = _outputStream ). _renderer->SET_NORMALIZING( ). _rc = _renderer->render( ). create object _printXMLDoc. _rc = _printXMLDoc->parse_string( _tempString ).

    CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING' EXPORTING im_xstring = _tempstringx im_encoding = 'UTF-8' IMPORTING ex_string = _tempstring.

    xmlString = _tempString. endmethod. method CONVERTSTRINGTOIXMLDOC.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |

  • *| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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.

    " Make sure to convert Windows Line Break to Unix as " this linebreak is used to get a correct import REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN xmlString WITH cl_abap_char_utilities=>newline.

    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. method CREATENODEFROMOTR.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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.

    DATA _ixml TYPE REF TO if_ixml. DATA _xmldoc TYPE REF TO if_ixml_document.

    CALL FUNCTION 'SOTR_GET_CONCEPT' EXPORTING concept = otrguid IMPORTING header = sotrheader

  • TABLES entries = sotrtexttable EXCEPTIONS no_entry_found = 1 OTHERS = 2. IF sy-subrc 0. EXIT. ENDIF.

    sotrheader-paket = '$TMP'. "change devclass to $TMP for exports

    * Create xml doc* _ixml = cl_ixml=>create( ).* _xmldoc = _ixml->create_document( ).* streamfactory = _ixml->create_stream_factory( ).

    * Create parent node rootnode = xmldoc->create_element( zsaplink_oo=>c_xml_key_sotr ). "OTR object type CLEAR sotrheader-concept. "ewH:33 setattributesfromstructure( node = rootnode structure = sotrheader ).

    * Create nodes for texts LOOP AT sotrtexttable INTO sotrtextline. txtnode = xmldoc->create_element( zsaplink_oo=>c_xml_key_sotrtext ). CLEAR: sotrtextline-concept, sotrtextline-object. "ewH:33 setattributesfromstructure( node = txtnode structure = sotrtextline ). rc = rootnode->append_child( txtnode ). ENDLOOP.

    node = rootnode.

    endmethod. method CREATEOTRFROMNODE.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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 sotrheader TYPE sotr_head. DATA sotrtextline TYPE sotr_text. DATA sotrtexttable TYPE TABLE OF sotr_text.

  • DATA sotrpaket TYPE sotr_pack.

    * get OTR header info CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = sotrheader.

    * get OTR text info filter = node->create_filter_name( zsaplink_oo=>c_xml_key_sotrText ). iterator = node->create_iterator_filtered( filter ). txtnode ?= iterator->get_next( ).

    WHILE txtnode IS NOT INITIAL. CLEAR sotrtextline. CALL METHOD getstructurefromattributes EXPORTING node = txtnode CHANGING structure = sotrtextline. CLEAR: sotrtextline-concept, sotrtextline-object. "ewH:33 APPEND sotrtextline TO sotrtexttable. txtnode ?= iterator->get_next( ). ENDWHILE.

    * ewH:issue 33--> in 6.40 and above, you cannot pass a default concept* (otr) guid, so we will always create new* CALL FUNCTION 'SOTR_GET_CONCEPT'* EXPORTING* concept = sotrHeader-concept** IMPORTING** HEADER =** TABLES** ENTRIES =* EXCEPTIONS* NO_ENTRY_FOUND = 1* OTHERS = 2* .* IF sy-subrc 1.** delete OTR if exists already* CALL FUNCTION 'SOTR_DELETE_CONCEPT'* EXPORTING* concept = sotrHeader-concept* EXCEPTIONS* NO_AUTHORIZATION = 1* NO_ENTRY_FOUND = 2. "who cares** CONCEPT_USED = 3** NO_MASTER_LANGUAGE = 4** NO_SOURCE_SYSTEM = 5** 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 = sotrpaket crea_lan = sotrheader-crea_lan alias_name = sotrheader-alias_name* CATEGORY = object = objecttype entries = sotrtexttable* FLAG_CORRECTION_ENTRY =* IN_UPDATE_TASK =* CONCEPT_DEFAULT = sotrHeader-concept "ewH:33 IMPORTING concept = concept "ewH:33 EXCEPTIONS package_missing = 1 crea_lan_missing = 2 object_missing = 3 paket_does_not_exist = 4 alias_already_exist = 5 object_type_not_found = 6 langu_missing = 7 identical_context_not_allowed = 8 text_too_long = 9 error_in_update = 10 no_master_langu = 11 error_in_concept_id = 12 alias_not_allowed = 13 tadir_entry_creation_failed = 14 internal_error = 15 error_in_correction = 16 user_cancelled = 17 no_entry_found = 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. method CREATESTRINGFROMOBJECT. endmethod.

  • method CREATEXMLSTRING.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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. METHOD getobjectinfofromixmldoc.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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( ).

  • * Check whether got a valid ixmldocument IF rootnode IS NOT BOUND. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>incorrect_file_format. ENDIF.

    * 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. method GETPLUGINS.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ DATA classlist TYPE seo_inheritances. DATA classline TYPE vseoextend. DATA classobject TYPE REF TO zsaplink. DATA objectline TYPE t_objecttable. DATA tabletypeline TYPE ko105. DATA tabletypesin TYPE TABLE OF ko105. DATA tabletypesout TYPE tr_object_texts. DATA tabletypeoutline TYPE ko100. DATA clsname TYPE string. DATA objtype TYPE trobjtype.

    REFRESH objecttable.

    SELECT * FROM vseoextend INTO TABLE classlist WHERE refclsname like 'ZSAPLINK%' AND version = '1'.

    LOOP AT classlist INTO classline. clsname = classline-clsname. TRY. CREATE OBJECT classobject TYPE (clsname) EXPORTING name = 'foo'. objtype = classobject->getobjecttype( ).

  • CATCH cx_root. CONTINUE. ENDTRY. CLEAR tabletypeline. REFRESH tabletypesin.

    tabletypeline-object = objtype. APPEND tabletypeline TO tabletypesin.

    CALL FUNCTION 'TRINT_OBJECT_TABLE' TABLES tt_types_in = tabletypesin tt_types_out = tabletypesout.

    LOOP AT tabletypesout INTO tabletypeoutline. objectline-classname = clsname. MOVE-CORRESPONDING tabletypeoutline TO objectline. APPEND objectline TO objecttable. ENDLOOP. ENDLOOP. endmethod. method GETSTRUCTUREFROMATTRIBUTES.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ data attributeList type ref to IF_IXML_NAMED_NODE_MAP. data nodeIterator type ref to IF_IXML_NODE_ITERATOR. data attributeNode type ref to if_ixml_node. data value type string. data name type string. field-symbols type any.

    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 .

  • if sy-subrc = 0. = value. endif. attributeNode = nodeIterator->get_next( ). endwhile.

    * .-"-.* .'=^=^='.* /=^=^=^=^=\*:^=SAPLINK=^;*|^ EASTER ^|*:^=^EGG^=^=^:* \=^=^=^=^=/* `.=^=^=.'* `~~~`* Don't like the way we did something?* Help us fix it! Tell us what you think!* http://saplink.org endmethod. METHOD GET_VERSION_INFO.

    *--------------------------------------------------------------------** Please use the following 6 lines of code when versioning a* SAPLINK-Plugin. See documentation of Type GTS_VERSION_INFO* what should be put here*--------------------------------------------------------------------* rs_version_info-zsaplink_plugin_major_version = 0. " Default for all child classes, that have not been updated to return a version info. rs_version_info-zsaplink_plugin_minor_version = 0. " Default for all child classes, that have not been updated to return a version info. rs_version_info-zsaplink_plugin_build_version = 0. " Default for all child classes, that have not been updated to return a version info.

    rs_version_info-zsaplink_plugin_info1 = ''. " Sufficient to set this the first time a child class is being updated rs_version_info-zsaplink_plugin_info2 = ''. " Sufficient to set this the first time a child class is being updated rs_version_info-zsaplink_plugin_info3 = ''. " Sufficient to set this the first time a child class is being updated rs_version_info-zsaplink_plugin_info4 = ''. " Sufficient to set this the first time a child class is being updated rs_version_info-zsaplink_plugin_info5 = ''. " Sufficient to set this the first time a child class is being updated

    * Hint - see redefinition of this class in ZSAPLINK_CLASS how information may be set

  • ENDMETHOD. METHOD get_version_info_static.

    DATA: lo_zsaplink TYPE REF TO zsaplink.

    TRY. CREATE OBJECT lo_zsaplink TYPE (iv_classname) EXPORTING name = 'Not needed for versio info'. rs_version_info = lo_zsaplink->get_version_info( ). CATCH cx_root. " Don't pass version info for unknown or abstract classes ENDTRY.

    ENDMETHOD. method SETATTRIBUTESFROMSTRUCTURE.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ data int type i. int = int. data structDescr type ref to cl_abap_structDescr. data aComponent type abap_compdescr. field-symbols type any. data rc type sysubrc. data sName type string. data sValue type string.

    structDescr ?= cl_abap_structDescr=>describe_by_data( structure ). loop at structDescr->components into aComponent. assign component aComponent-name of structure structure to . if sy-subrc = 0. sName = aComponent-name.* sValue = .* for certain attributes, set to a standard for exporting case sName.* when 'VERSION'. "version should always export as inactive* sValue = '0'. "commented by ewH: issue 45 when 'DEVCLASS'. "development class should always be $TMP sValue = '$TMP'. " Developer, Date and Time Metadata has to be removed to " not clutter diffs " " Meta Attributes for DDIC Types when 'AS4USER'.

  • clear sValue. when 'AS4DATE'. clear sValue. when 'AS4TIME'. clear sValue. " Meta Attributes for PROG when 'CNAM'. clear sValue. when 'CDAT'. clear sValue. when 'UNAM'. clear sValue. when 'UDAT'. clear sValue. when 'VERN'. clear sValue. when 'SDATE'. clear sValue. when 'STIME'. clear sValue. when 'IDATE'. clear sValue. when 'ITIME'. clear sValue. " Meta Attributes for CLAS when 'AUTHOR'. clear sValue. when 'CREATEDON'. clear sValue. when 'CHANGEDBY'. clear sValue. when 'CHANGEDON'. clear sValue. when 'CHANGETIME'. clear sValue. when 'CHGDANYON'. clear sValue. when 'R3RELEASE'. clear sValue. when 'UUID'. clear sValue. " SOTR when 'CREA_NAME'. clear sValue. when 'CHAN_NAME'. clear sValue. when 'CREA_TSTUT'. clear sValue. when 'CHAN_TSTUT'. clear sValue. " MSAG when 'LASTUSER'. clear sValue. when 'LDATE'. clear sValue. when 'LTIME'. clear sValue. when 'DGEN'. clear sValue. when 'TGEN'.

  • clear sValue. when 'GENDATE'. clear sValue. when 'GENTIME'. clear sValue. " BSP when 'IMPLCLASS'. clear sValue. when others. sValue = . endcase. if sValue is not initial. rc = Node->set_attribute( name = sName value = sValue ). endif. else.* WHAT?>!?? endif. endloop. endmethod. method UPLOADXML.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ data iStream type ref to if_ixml_istream. data ixmlParser type ref to if_ixml_parser.

    iStream = streamFactory->CREATE_ISTREAM_STRING( xmlData ). iXMLParser = iXML->create_parser( stream_factory = streamFactory istream = iStream document = XMLdoc ). iXMLParser->parse( ).

    endmethod. method VALUEHELP.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |

  • *| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ DATA l_object_type type euobj-id. data objname(40) type c.

    l_object_type = i_objType.

    CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4' EXPORTING object_type = l_object_type object_name = objname suppress_selection = 'X' use_alv_grid = '' without_personal_list = '' IMPORTING object_name_selected = objname EXCEPTIONS cancel = 1.

    e_objname = objname. endmethod.ENDCLASS.CLASS ZSAPLINK_OO IMPLEMENTATION. method CREATE_ALIAS_METHOD. DATA: filter TYPE REF TO if_ixml_node_filter, iterator TYPE REF TO if_ixml_node_iterator, node TYPE REF TO if_ixml_element.

    DATA: ls_alias_method LIKE LINE OF xt_aliases_method.

    filter = xmldoc->create_filter_name( c_xml_key_alias_method ). iterator = xmldoc->create_iterator_filtered( filter ). node ?= iterator->get_next( ). WHILE node IS NOT INITIAL. CLEAR ls_alias_method. CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = ls_alias_method. INSERT ls_alias_method INTO TABLE xt_aliases_method. node ?= iterator->get_next( ). ENDWHILE.

    endmethod. method CREATE_CLSDEFERRD. DATA: filter TYPE REF TO if_ixml_node_filter, iterator TYPE REF TO if_ixml_node_iterator, node TYPE REF TO if_ixml_element.

    DATA: ls_clsdeferrd LIKE LINE OF xt_clsdeferrds.

  • filter = xmldoc->create_filter_name( c_xml_key_clsdeferrd ). iterator = xmldoc->create_iterator_filtered( filter ). node ?= iterator->get_next( ).

    WHILE node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = ls_clsdeferrd. APPEND ls_clsdeferrd TO xt_clsdeferrds. node ?= iterator->get_next( ). ENDWHILE.

    endmethod. method CREATE_INTDEFERRD. DATA: filter TYPE REF TO if_ixml_node_filter, iterator TYPE REF TO if_ixml_node_iterator, node TYPE REF TO if_ixml_element.

    DATA: ls_intdeferrd LIKE LINE OF xt_intdeferrds.

    filter = xmldoc->create_filter_name( c_xml_key_intdeferrd ). iterator = xmldoc->create_iterator_filtered( filter ). node ?= iterator->get_next( ).

    WHILE node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = ls_intdeferrd. APPEND ls_intdeferrd TO xt_intdeferrds. node ?= iterator->get_next( ). ENDWHILE.

    endmethod. method CREATE_OTR.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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 sotrheader TYPE sotr_head. DATA sotrtextline TYPE sotr_text. DATA sotrtexttable TYPE TABLE OF sotr_text. DATA sotrpaket TYPE sotr_pack.

    * get OTR header info CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = sotrheader.

    * get OTR text info filter = node->create_filter_name( c_xml_key_sotrText ). iterator = node->create_iterator_filtered( filter ). txtnode ?= iterator->get_next( ).

    WHILE txtnode IS NOT INITIAL. CLEAR sotrtextline. CALL METHOD getstructurefromattributes EXPORTING node = txtnode CHANGING structure = sotrtextline. CLEAR: sotrtextline-concept, sotrtextline-object. "ewH:33 APPEND sotrtextline TO sotrtexttable. txtnode ?= iterator->get_next( ). ENDWHILE.

    * ewH:issue 33--> in 6.40 and above, you cannot pass a default concept* (otr) guid, so we will always create new* CALL FUNCTION 'SOTR_GET_CONCEPT'* EXPORTING* concept = sotrHeader-concept** IMPORTING** HEADER =** TABLES** ENTRIES =* EXCEPTIONS* NO_ENTRY_FOUND = 1* OTHERS = 2* .* IF sy-subrc 1.** delete OTR if exists already* CALL FUNCTION 'SOTR_DELETE_CONCEPT'* EXPORTING* concept = sotrHeader-concept* EXCEPTIONS* NO_AUTHORIZATION = 1* NO_ENTRY_FOUND = 2. "who cares** CONCEPT_USED = 3** NO_MASTER_LANGUAGE = 4** NO_SOURCE_SYSTEM = 5** 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 = sotrpaket crea_lan = sotrheader-crea_lan alias_name = sotrheader-alias_name* CATEGORY = object = objecttype entries = sotrtexttable* FLAG_CORRECTION_ENTRY =* IN_UPDATE_TASK =* CONCEPT_DEFAULT = sotrHeader-concept "ewH:33 IMPORTING concept = concept "ewH:33 EXCEPTIONS package_missing = 1 crea_lan_missing = 2 object_missing = 3 paket_does_not_exist = 4 alias_already_exist = 5 object_type_not_found = 6 langu_missing = 7 identical_context_not_allowed = 8 text_too_long = 9 error_in_update = 10 no_master_langu = 11 error_in_concept_id = 12 alias_not_allowed = 13 tadir_entry_creation_failed = 14 internal_error = 15 error_in_correction = 16 user_cancelled = 17 no_entry_found = 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. method CREATE_TYPEPUSAGE. DATA: filter TYPE REF TO if_ixml_node_filter, iterator TYPE REF TO if_ixml_node_iterator, node TYPE REF TO if_ixml_element, source TYPE string.

    DATA: ls_typepusage LIKE LINE OF xt_typepusages.

    *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

    filter = xmldoc->create_filter_name( c_xml_key_typepusage ). iterator = xmldoc->create_iterator_filtered( filter ). node ?= iterator->get_next( ).

    WHILE node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = ls_typepusage. APPEND ls_typepusage TO xt_typepusages. node ?= iterator->get_next( ). ENDWHILE.

    * only check forwardDeclaration if typeUsages does not exist* later version this will be removed IF xt_typepusages IS INITIAL. filter = xmldoc->create_filter_name( c_xml_key_forwarddeclaration ). iterator = xmldoc->create_iterator_filtered( filter ). node ?= iterator->get_next( ).

    WHILE node IS NOT INITIAL. CLEAR ls_typepusage. source = node->get_value( ). ls_typepusage-clsname = objname. ls_typepusage-version = '0'. ls_typepusage-tputype = '0'. ls_typepusage-explicit = 'X'. ls_typepusage-implicit = ''. ls_typepusage-typegroup = source. APPEND ls_typepusage TO xt_typepusages. node ?= iterator->get_next( ). ENDWHILE. ENDIF.

    endmethod. method GET_ALIAS_METHOD. DATA lo_alias TYPE REF TO if_ixml_element. DATA ls_alias TYPE seoaliases. DATA: l_rc TYPE sy-subrc,

  • ls_method LIKE LINE OF it_methods, ls_clsmethkey TYPE seocmpkey.

    LOOP AT it_methods INTO ls_method. ls_clsmethkey-clsname = objname. ls_clsmethkey-cmpname = ls_method-name. CLEAR ls_alias. CALL FUNCTION 'SEO_ALIAS_GET' EXPORTING cmpkey = ls_clsmethkey* VERSION = SEOC_VERSION_INACTIVE IMPORTING alias = ls_alias EXCEPTIONS not_existing = 1 deleted = 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. ELSE. lo_alias = xmldoc->create_element( c_xml_key_alias_method ). setattributesfromstructure( node = lo_alias structure = ls_alias ). l_rc = xo_rootnode->append_child( lo_alias ). ENDIF. ENDLOOP.

    endmethod. method GET_CLSDEFERRD. DATA: lt_clsdeferrds TYPE seot_clsdeferrds_r, lo_clsdeferrds TYPE REF TO if_ixml_element, ls_clsdeferrd TYPE seot_typepusage_r.

    DATA: l_rc TYPE sy-subrc, ls_classkey TYPE seoclskey.

    ls_classkey-clsname = objname.

    CALL FUNCTION 'SEO_CLSDEFERRD_READ_ALL' EXPORTING cifkey = ls_classkey version = seoc_version_active IMPORTING CLASSDEFERREDS = lt_clsdeferrds EXCEPTIONS clif_not_existing = 1 OTHERS = 2.

    LOOP AT lt_clsdeferrds INTO ls_clsdeferrd. lo_clsdeferrds = xmldoc->create_element( c_xml_key_clsdeferrd ). setattributesfromstructure( node = lo_clsdeferrds structure = ls_clsdeferrd ). l_rc = xo_rootnode->append_child( lo_clsdeferrds ). ENDLOOP. endmethod. method GET_INTDEFERRD. DATA: lt_intdeferrds TYPE seot_intdeferrds_r, lo_intdeferrds TYPE REF TO if_ixml_element,

  • ls_intdeferrd TYPE seot_intdeferrd_r.

    DATA: l_rc TYPE sy-subrc, ls_classkey TYPE seoclskey.

    ls_classkey-clsname = objname.

    CALL FUNCTION 'SEO_INTDEFERRD_READ_ALL' EXPORTING cifkey = ls_classkey version = seoc_version_active IMPORTING interfacedeferreds = lt_intdeferrds EXCEPTIONS clif_not_existing = 1 OTHERS = 2.

    LOOP AT lt_intdeferrds INTO ls_intdeferrd. lo_intdeferrds = xmldoc->create_element( c_xml_key_intdeferrd ). setattributesfromstructure( node = lo_intdeferrds structure = ls_intdeferrd ). l_rc = xo_rootnode->append_child( lo_intdeferrds ). ENDLOOP.

    endmethod. method GET_OTR.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ 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.

    DATA _ixml TYPE REF TO if_ixml. DATA _xmldoc TYPE REF TO if_ixml_document.

    CALL FUNCTION 'SOTR_GET_CONCEPT' EXPORTING concept = otrguid IMPORTING header = sotrheader

  • TABLES entries = sotrtexttable EXCEPTIONS no_entry_found = 1 OTHERS = 2. IF sy-subrc 0. EXIT. ENDIF.

    sotrheader-paket = '$TMP'. "change devclass to $TMP for exports

    * Create xml doc* _ixml = cl_ixml=>create( ).* _xmldoc = _ixml->create_document( ).* streamfactory = _ixml->create_stream_factory( ).

    * Create parent node rootnode = xmldoc->create_element( c_xml_key_sotr ). "OTR object type CLEAR sotrheader-concept. "ewH:33 setattributesfromstructure( node = rootnode structure = sotrheader ).

    * Create nodes for texts LOOP AT sotrtexttable INTO sotrtextline. txtnode = xmldoc->create_element( c_xml_key_sotrtext ). CLEAR: sotrtextline-concept, sotrtextline-object. "ewH:33 setattributesfromstructure( node = txtnode structure = sotrtextline ). rc = rootnode->append_child( txtnode ). ENDLOOP.

    node = rootnode.

    endmethod. method GET_TYPEPUSAGE. DATA: lt_typepusages TYPE seot_typepusages_r, lo_typepusages TYPE REF TO if_ixml_element, ls_typepusage TYPE seot_typepusage_r.

    DATA: l_rc TYPE sy-subrc, l_string TYPE string, ls_classkey TYPE seoclskey.

    ls_classkey-clsname = objname.

    CALL FUNCTION 'SEO_TYPEPUSAGE_READ_ALL' EXPORTING cifkey = ls_classkey version = seoc_version_active IMPORTING typepusages = lt_typepusages EXCEPTIONS clif_not_existing = 1 OTHERS = 2.

    LOOP AT lt_typepusages INTO ls_typepusage. lo_typepusages = xmldoc->create_element( c_xml_key_typepusage ). setattributesfromstructure( node = lo_typepusages structure = ls_typepusage ). l_rc = xo_rootnode->append_child( lo_typepusages ). ENDLOOP.

  • *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. LOOP AT lt_typepusages INTO ls_typepusage. lo_typepusages = xmldoc->create_element( c_xml_key_forwarddeclaration ). l_string = ls_typepusage-typegroup. l_rc = lo_typepusages->if_ixml_node~set_value( l_string ). l_rc = xo_rootnode->append_child( lo_typepusages ). ENDLOOP.

    endmethod.ENDCLASS.CLASS ZSAPLINK_CLASS IMPLEMENTATION. method CHECKEXISTS.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |*| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ data classkey type SEOCLSKEY. data not_active TYPE SEOX_BOOLEAN.

    classKey-clsName = objname.

    call function 'SEO_CLASS_EXISTENCE_CHECK' EXPORTING clskey = classkey IMPORTING not_active = not_active EXCEPTIONS* not_specified = 1 not_existing = 2.* is_interface = 3* no_text = 4* inconsistent = 5* others = 6.

    if sy-subrc 2. exists = 'X'. endif. endmethod. METHOD createixmldocfromobject.*/---------------------------------------------------------------------\*| This file is part of SAPlink. |*| |*| Copyright 2014 SAPlink project members |

  • *| |*| Licensed under the Apache License, Version 2.0 (the "License"); |*| you may not use this file except in compliance with the License. |*| You may obtain a copy of the License at |*| |*| http://www.apache.org/licenses/LICENSE-2.0 |*| |*| Unless required by applicable law or agreed to in writing, software |*| distributed under the License is distributed on an "AS IS" BASIS, |*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |*| implied. |*| See the License for the specific language governing permissions and |*| limitations under the License. |*\---------------------------------------------------------------------/ DATA localimplementation TYPE REF TO if_ixml_element. DATA localtypes TYPE REF TO if_ixml_element. DATA localmacros TYPE REF TO if_ixml_element. DATA rootnode TYPE REF TO if_ixml_element. DATA reportlist TYPE STANDARD TABLE OF string. DATA includename TYPE program. DATA _classname TYPE seoclsname. DATA reportstring TYPE string. DATA rc TYPE sysubrc. DATA classdescr TYPE REF TO cl_abap_classdescr. DATA typedescr TYPE REF TO cl_abap_typedescr. DATA methoddescr TYPE abap_methdescr. DATA methodnode TYPE REF TO if_ixml_element. DATA parameternode TYPE REF TO if_ixml_element. DATA sourcenode TYPE REF TO if_ixml_element. DATA exceptionnode TYPE REF TO if_ixml_element. DATA exceptionlist TYPE seos_exceptions_r. DATA anexception TYPE vseoexcep. DATA inheritancenode TYPE REF TO if_ixml_element. DATA redefnode TYPE REF TO if_ixml_element.

    DATA tempstring TYPE string. DATA methodkey TYPE seocpdkey. DATA clsmethkey TYPE seocmpkey. DATA methodproperties TYPE vseomethod. DATA classkey TYPE seoclskey. DATA classproperties TYPE vseoclass. DATA paramdescr TYPE abap_parmdescr. DATA paramkey TYPE seoscokey. DATA paramproperties TYPE vseoparam. DATA superclass TYPE REF TO cl_abap_typedescr. DATA superclassname TYPE string. DATA superclasskey TYPE seorelkey.

    DATA attribdescr TYPE abap_attrdescr. DATA attribkey TYPE seocmpkey. DATA attribproperties TYPE vseoattrib. DATA attribnode TYPE REF TO if_ixml_element. DATA inheritanceprops TYPE vseoextend. DATA redefines TYPE STANDARD TABLE OF seoredef WITH KEY clsname refclsname version mtdname. DATA inheritance TYPE seor_inheritance_r. DATA redefinitions TYPE seor_redefinitions_r. DATA redefinition LIKE LINE OF redefinitions.

    DATA otrnode TYPE REF TO if_ixml_element.

  • DATA _otrguid TYPE sotr_conc.

    data: ls_version_info type gts_version_info.

    _classname = objname. classkey-clsname = objname.

    * setObjectType( ).

    DATA _objtype TYPE string.* _objType = objType. _objtype = getobjecttype( ). rootnode = xmldoc->create_element( _objtype ). CALL FUNCTION 'SEO_CLASS_GET' EXPORTING clskey = classkey version = '1' IMPORTING class = classproperties EXCEPTIONS not_existing = 1 deleted = 2 is_interface = 3 model_only = 4.

    IF sy-subrc 0. CASE sy-subrc. WHEN 1. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>not_found object = objname. WHEN 2. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = 'class deleted'. WHEN 3. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = 'interfaces not supported'. WHEN 4. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = 'class is modeled only'. ENDCASE. ENDIF.

    setattributesfromstructure( node = rootnode structure = classproperties ).*--------------------------------------------------------------------** Added versioning info*--------------------------------------------------------------------* ls_version_info = get_version_info( ). setattributesfromstructure( node = rootnode structure = ls_version_info ).

    TRY.

  • CALL METHOD cl_abap_classdescr=>describe_by_name EXPORTING p_name = objname RECEIVING p_descr_ref = typedescr EXCEPTIONS type_not_found = 1. IF sy-subrc = 0. classdescr ?= typedescr. ELSE.

    ENDIF. CATCH cx_root. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>system_error. ENDTRY.

    CALL METHOD classdescr->get_super_class_type RECEIVING p_descr_ref = superclass EXCEPTIONS super_class_not_found = 1.

    IF sy-subrc = 0. superclassname = superclass->get_relative_name( ). IF NOT superclassname CS 'OBJECT'. superclasskey-clsname = objname. superclasskey-refclsname = superclassname. CALL FUNCTION 'SEO_INHERITANC_GET' EXPORTING inhkey = superclasskey IMPORTING inheritance = inheritanceprops redefinitions = redefines. setattributesfromstructure( node = rootnode structure = inheritanceprops ). ENDIF. ENDIF.

    */***TPJ - Added Logic for TYPES -------------------*/ DATA: types TYPE seoo_types_r, wa_type LIKE LINE OF types, types_node TYPE REF TO if_ixml_element. CALL FUNCTION 'SEO_TYPE_READ_ALL' EXPORTING cifkey = classkey version = 1 IMPORTING types = types EXCEPTIONS clif_not_existing = 1 OTHERS = 2. IF sy-subrc 0. ENDIF. LOOP AT types INTO wa_type. types_node = xmldoc->create_element( 'types' ). clear wa_type-TYPESRC_LENG. " Will be recalculated on import, differs depending on OS due to linebreaks setattributesfromstructure( node = types_node structure =

  • wa_type ). rc = rootnode->append_child( types_node ). ENDLOOP.*/***TPJ - End of Added Logic for TYPES -------------------*/

    */***TPJ - Added Logic for Friends -------------------*/ DATA: clif_keys TYPE STANDARD TABLE OF seoclskey, friends TYPE STANDARD TABLE OF seofriends, wa_friend LIKE LINE OF friends, friends_node TYPE REF TO if_ixml_element.

    APPEND classkey TO clif_keys. CALL FUNCTION 'SEO_FRIENDS_SELECT' EXPORTING with_external_ref = 'X' TABLES clif_keys = clif_keys friends_relations = friends. IF sy-subrc 0. ENDIF. LOOP AT friends INTO wa_friend. friends_node = xmldoc->create_element( c_xml_key_friends ). setattributesfromstructure( node = friends_node structure = wa_friend ). rc = rootnode->append_child( friends_node ). ENDLOOP.*/***TPJ - End of Added Logic for Friends -------------------*/

    */***ewH - Added Logic for Interfaces -------------------*/*/***uku - discard included interfaces -------------------*/ DATA: it_implementings TYPE seor_implementings_r, lt_implementings_copy TYPE seor_implementings_r, wa_implementings LIKE LINE OF it_implementings, implementingnode TYPE REF TO if_ixml_element, ls_interface TYPE seoc_interface_r, lt_comprisings TYPE seor_comprisings_r, ls_intfkey TYPE seoclskey. FIELD-SYMBOLS TYPE seor_comprising_r.

    CALL FUNCTION 'SEO_IMPLEMENTG_READ_ALL' EXPORTING clskey = classkey IMPORTING implementings = it_implementings EXCEPTIONS class_not_existing = 1 OTHERS = 2.

    lt_implementings_copy = it_implementings. LOOP AT it_implementings INTO wa_implementings. CLEAR: ls_intfkey. ls_intfkey-clsname = wa_implementings-refclsname. CALL FUNCTION 'SEO_INTERFACE_TYPEINFO_GET' EXPORTING intkey = ls_intfkey IMPORTING comprisings = lt_comprisings. LOOP AT lt_comprisings ASSIGNING . DELETE lt_implementings_copy WHERE refclsname = -refclsname.

  • ENDLOOP. ENDLOOP.

    LOOP AT lt_implementings_copy INTO wa_implementings. implementingnode = xmldoc->create_element( 'implementing' ). setattributesfromstructure( node = implementingnode structure = wa_implementings ). rc = rootnode->append_child( implementingnode ). ENDLOOP.*/***uku - End of discard included interfaces -------------------*/*/***ewH - End of Added Logic for Interfaces -------------------*/*/***rrq - Added Logic for EVENTS -------------------*/ DATA: events TYPE seoo_events_r, wa_event LIKE LINE OF events, event_node TYPE REF TO if_ixml_element, eventkey TYPE seocmpkey, eventparams TYPE seos_parameters_r, wa_params TYPE seos_parameter_r. CALL FUNCTION 'SEO_EVENT_READ_ALL' EXPORTING cifkey = classkey version = 1 IMPORTING events = events EXCEPTIONS 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.

    parameternode = xmldoc->create_element( 'parameter' ). setattributesfromstructure( node = parameternode structure = wa_params ). rc = event_node->append_child( parameternode ). ENDLOOP. rc = rootnode->append_child( event_node ). ENDLOOP.*/***rrq - End of Added Logic for EVENTS -------------------*/* removed by Rene. get_sections( CHANGING rootnode = rootnode ) .*|--------------------------------------------------------------------| includename = cl_oo_classname_service=>get_ccimp_name( _classname ). READ REPORT includename INTO reportlist. localimplementation = xmldoc->create_element( 'localImplementation' ). reportstring = buildsourcestring( sourcetable = reportlist ). rc = localimplementation->if_ixml_node~set_value( reportstring ).

  • *|--------------------------------------------------------------------| includename = cl_oo_classname_service=>get_ccdef_name( _classname ). READ REPORT includename INTO reportlist. localtypes = xmldoc->create_element( 'localTypes' ). reportstring = buildsourcestring( sourcetable = reportlist ). rc = localtypes->if_ixml_node~set_value( reportstring ).*|--------------------------------------------------------------------| includename = cl_oo_classname_service=>get_ccmac_name( _classname ). READ REPORT includename INTO reportlist. localmacros = xmldoc->create_element( 'localMacros' ). reportstring = buildsourcestring( sourcetable = reportlist ). rc = localmacros->if_ixml_node~set_value( reportstring ).*|--------------------------------------------------------------------|*/***EVP - Added Logic for Local Test Classes ----------------------*/ DATA localtestclasses TYPE REF TO if_ixml_element. DATA localtestclassesexist TYPE i.

    includename = cl_oo_classname_service=>get_local_testclasses_include( _classname ). READ REPORT includename INTO reportlist. " If sy-subrc = 0 the local test classes do exist localtestclassesexist = sy-subrc. IF localtestclassesexist = 0. localtestclasses = xmldoc->create_element( 'localTestClasses' ). reportstring = buildsourcestring( sourcetable = reportlist ). rc = localtestclasses->if_ixml_node~set_value( reportstring ). ENDIF.*/***EVP - End of Added Logic for Local Test Classes ---------------*/*| |*\--------------------------------------------------------------------/ rc = rootnode->append_child( localimplementation ). rc = rootnode->append_child( localtypes ). rc = rootnode->append_child( localmacros ).*/***EVP - Added Logic for Local Test Classes -------------------*/ IF localtestclassesexist = 0. rc = rootnode->append_child( localtestclasses ). ENDIF.*/***EVP - End of Added Logic for Local Test Classes ------------*/**// Rich: Start get_textpool( CHANGING rootnode = rootnode ). get_documentation( CHANGING rootnode = rootnode ).**// Rich: End get_typepusage( CHANGING xo_rootnode = rootnode ). get_clsdeferrd( CHANGING xo_rootnode = rootnode ). get_intdeferrd( CHANGING xo_rootnode = rootnode ).

    * classDescriptor ?= cl_abap_typedescr=>describe_by_name( className ). attribkey-clsname = objname.

    LOOP AT classdescr->attributes INTO attribdescr WHERE is_inherited = abap_false AND is_interface = abap_false. "rrq:issue 46 attribnode = xmldoc->create_element( 'attribute' ). attribkey-cmpname = attribdescr-name. CALL FUNCTION 'SEO_ATTRIBUTE_GET' EXPORTING attkey = attribkey IMPORTING attribute = attribproperties.

  • * include OTR if necessary (for exception classes) IF attribproperties-type = 'SOTR_CONC' AND attribproperties-attvalue IS NOT INITIAL. _otrguid = attribproperties-attvalue+1(32). otrnode = get_otr( _otrguid ). IF otrnode IS BOUND. rc = attribnode->append_child( otrnode ). " Issue #222 - get_text empty when ZCX_SAPLINK exception is raised " Gregor Wolf, 2012-12-20 " As GUID for OTR Node is created new in every system we import " the Slinkee we should empty it CLEAR: attribproperties-attvalue. ENDIF. ENDIF.

    * append attribute node to parent node setattributesfromstructure( node = attribnode structure = attribproperties ). rc = rootnode->append_child( attribnode ). ENDLOOP.

    *// 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( c_xml_key_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 with out alias We handle this later LOOP AT classdescr->methods INTO methoddescr WHERE alias_for IS INITIAL AND NOT ( is_inherited = 'X' AND is_redefined IS INITIAL ). methodkey-clsname = _classname. methodkey-cpdname = methoddescr-name.*//nbus: added logic for exception class IF methoddescr-name = 'CONSTRUCTOR' AND classproperties-category = seoc_category_exception and me->mv_steamroller abap_true. " Constructor() will be generated automatically into the " target system once the class is saved CONTINUE. ENDIF.

  • *//nbus: end of added logic for exception class* 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-COR