Skip to Content

Creating an XML file to define a Web AS ABAP system

One of the tasks that often needs to be performed after the installation of a portal is to define a system in the system landscape that defines the access paths to an SAP instance. SAP note 761917 contains the mandatory details that are required to be used, and the following ABAP program can be used to extract these values which can then  be used to create an XML file which can be uploaded through the XML generic creator tool.  The main steps are:   ** Execute the ABAP program and select the appropriate host or logon group. It is also possible to define the ITS to be used.  ** Download the resulting text to an XML file  ** Use the XML import tool (System Administration -> Transport -> XML contents -> Import) to upload the XML file.  ** Create iViews etc that use the system, as has been documented in many blogs    The ABAP code follows:    *&——————————————————————– * *& Report  ZGEN                                                        * *&                                                                     * *&——————————————————————– * *&                                                                     * *&                                                                     * *&——————————————————————– *  REPORT  ZGEN line-size 160.  tables: rzlliclass. tables: t000.  data: lognam type string. data: sysname(20). data: alias(30). data: pcd(80). data: its(80). data: alias_line like sy-linno. data: pcd_line like sy-linno. data: sysname_line like sy-linno. data: its_line like sy-linno.  data: domain(30). data: selection(30). data: icm_table type ICM_SINFO occurs 0 with header line. data: gwy_table type gwy_params occurs 0 with header line. data: ICM_url type string. data: gwy_host type string. data: gwy_service type string. DATA: BEGIN OF IMSXXLIST OCCURS 10.         INCLUDE STRUCTURE MSXXLIST. DATA: END OF IMSXXLIST. data: host type string, b type string, inst type string. types: BEGIN OF SYMSG_ROW,           LINE(128),        END OF SYMSG_ROW. data: ms_table type symsg_row occurs 0. data: ms_line like line of ms_table. data: a1 type string, a2 type string, a3 type string, a4 type string. data: ms_port type string. data: ms_host type string. data: dp_port type string. data: integrated(1).  ************************************* concatenate sy-sysid ‘_’ sy-mandt into sysname. alias = ‘SAP_R3’. pcd = ‘portal_content’. integrated = ‘X’. if sy-saprl ‘. endform.                    “write_common1 *&——————————————————————- * *&      Form  write_its *&——————————————————————- * *       text *——————————————————————– * form write_its.    data: len1 type i.   len1 = strlen( its ).   write: / ”. endform.                    “write_its *&——————————————————————- * *&      Form  write_dedicated *&——————————————————————- * *       text *——————————————————————– * *      –>HOST       text *      –>INST       text *      –>DP_PORT    text *——————————————————————– * form write_dedicated using host inst dp_port.   data: len1 type i.   len1 = strlen( sy-sysid ).   write: / ”. endform.                    “write_dedicated *&——————————————————————- * *&      Form  write_loadbal *&——————————————————————- * *       text *——————————————————————– * *      –>GROUPNAME  text *——————————————————————– * form write_loadbal using groupname.   data: len1 type i, len2 type i.   len1 = strlen( groupname ).   len2 = strlen( sy-sysid ).   write: / ”. endform.                    “write_loadbal  *&——————————————————————- * *&      Form  write_lastbit *&——————————————————————- * *       text *——————————————————————– * form write_lastbit.   data: len1 type i, len2 type i, len3 type i, len4 type i..   len1 = strlen( sysname ).   len2 = strlen( pcd ).   len3 = strlen( alias ).   len4 = strlen( icm_url ).   perform write_its.   write: / ”. endform.                    “write_lastbit  at line-selection.   if selection = space.     write: / ‘Nothing useful selected’.   else.     read line sysname_line field value sysname.     read line pcd_line field value pcd.     read line alias_line field value alias.     read line its_line field value its.     if selection(1) = ‘L’. *      write: / ‘Logical group’, selection+1.       perform write_common1 using ‘LoadBalancing’.       perform write_loadbal using selection+1(10).       perform write_lastbit.     elseif selection(1) = ‘S’.       imsxxlist-name = selection+1.       perform write_common1 using ‘Dedicated’. *      write: / ‘Server’, imsxxlist-name.       split imsxxlist-name at ‘_’ into host b inst. *      write: ‘ on host’, host, ‘instance number’, inst.       CALL FUNCTION ‘MS_DUMP_CLIENT’         EXPORTING           NAME  = imsxxlist-name         IMPORTING           LINES = ms_table.       loop at ms_table into ms_line-line.         if ms_line-line(6) = ‘domain’.           condense ms_line-line.           split ms_line-line at space into a1 a2 domain.         endif.         if ms_line-line(7) = ‘nservno’.           condense ms_line-line.           split ms_line-line at space into a1 a2 dp_port.           write: dp_port.         endif.        endloop.       concatenate host ‘.’ domain into host.       perform write_dedicated using host inst dp_port.       perform write_lastbit.      elseif selection(1) = ‘I’.       integrated = ‘X’.       sy-lsind = sy-lsind – 1.       perform showit.     elseif selection(1) = ‘E’.       integrated = space.       sy-lsind = sy-lsind – 1.       perform showit.       endif.     clear selection.   endif.   The ABAP program will not work with releases before Web AS 610, as it makes use of some function modules that were not used before that release.   At run time, the program presents a screen similar to the followingimage
You must be Logged on to comment or reply to a post.
  • There is a new version in the code library that instead of creating an XML file now creates a URL. This URL can be used to invoke a portal component that will create the system in the portal landscape directory.

    The new ABAP code is here and contains a link to the Java code for the portal component to create the system.