abap class utilities

Upload: brett-hall

Post on 13-Oct-2015

108 views

Category:

Documents


5 download

TRANSCRIPT

SDN Contribution Utilities for downloading and uploading OO ABAP classes in XML format Applies to: SAP WebAS 6.20 and above. Summary This article will present two utility reports for downloading and uploading OO ABAP class. They can be used for transporting classes from system to system and also they demonstrate CL_XML_DOCUMENT usage, SEOK package functions usage, etc. Author(s): Sergey Korolev Company: Deloitte & Touche Created on: 2 August 2006 Author Bio In his pre-SAP era Sergey Korolev was a loyal Delphi programmer, developing component libraries and proprietary applications. Since 1999 he has been working as an Workflow/ABAP consultant and developer. Now he is a senior Workflow/ABAP consultant at Deloitte & Touch RCS working for various customers. 2006 SAP AG 1 Table of Contents Utilities to download and upload OO ABAP class in XML format....................................................1 Why?................................................................................................................................................3 Why XML?.......................................................................................................................................3 Usage...............................................................................................................................................3 Download utility............................................................................................................................3 Selection screen parameters....................................................................................................3 Upload utility.................................................................................................................................4 Versions supported..........................................................................................................................4 Weaknesses....................................................................................................................................4 Source Code....................................................................................................................................5 Copyright..........................................................................................................................................6 2006 SAP AG 2 Why? If you are closely acquainted with ABAP Objects and more generally with OO technology and paradigm, then it is likely that you have your own OO developments you want to reuse. Personally I have some. The problem is that for one reason or another not always you can use SAP transport system to port your classes from one system to another. There is a standard program RWBPRINT which can be used (with debugging tricks) to download ABAP class data, but frankly it is not quite convenient, its strength is that it can be used as a usage template of some function modules for accessing ABAP class data. Why XML? When thinking of file format I had remembered that SAP SmartForms has upload/download functionality which uses XML format. Also I was already familiar with CL_XML_DOCUMENT class which offers DOM model functionality for XML documents. And also I had an idea of utilizing XSLT transformation somehow to make myself familiar with it (unfortunately, there were no need, as SAP function modules for reading and creating ABAP classed have fully compatible parameters which can be converted from/to XML without special transformations). And yes, everybody uses XML nowadays. Usage Download utility Program YRS_CLASS_DOWNLOAD_XML has quite simple selection screen (see below). Selection screen parameters Parameter Type Notes

Class name Parameter ABAP class name to be downloaded. Can be selected via search help

Show XML file in browser Flag If set, resulting file will be displayed in additional window,