XML_OPEN

Script Function: Opens an XML document for processing purposes.

Syntax

XML_OPEN (DOCU, [Object Name], @Documentation )
XML_OPEN
(REPORT, [RunID], Report )
XML_OPEN (STRING, String )

Syntax

Description/Format

Source

Source of the XML document.
Format: AE name, script literal or script variable

Allowed values: DOCU, REPORT, and STRING

DOCU - Structured documentation.
REPORT - Report of an SAP job.
STRING - XML in the form of a string.

For structured documentations:

Object Name

Name of the object.
Format: script literal or script variable

This parameter is optional if this is the own object's tab.

Documentation

Name of the documentation tab with a preceding "@".
Format: script literal or script variable

For reports:

RunID

Run number (RunID) of the task whose report should be opened.
Format: script literal or script variable

This parameter is optional if the report of the own object is concerned.

Report

Type of XML report (Reports Overview)

For strings:
String

String that contains the XML.
Format: script variable or script literal


Return code

Reference to the XML document.

Comments

The script function opens an XML document for processing purposes. This can be the structured documentation or the report of an SAP job.

In order to add further descriptions and explanations, you can use tabs for documentation purposes. You can define them for the individual object types in the variable UC_OBJECT_DOCU. The structured documentation is a specific type of description which is characterized by a preceding "@". Structured documentation can be processed with specific script elements. 

Reports of SAP jobs are stored as XML documents. For XI_GET_CHANNEL, they contain a list of selected communication channels.

The return code of this script function is a handle which refers to the XML document. Some script elements that are used to process the XML document use this handle as a parameter.

You can close the XML document by using XML_CLOSE.

You cannot open more than one XML document at a time.

Examples

In this example, the Details tab of the object MM.DAY is opened for further processing.

:SET &XMLDOCU# = XML_OPEN(DOCU,"MM.DAY", "@Details")

This example opens an XML document with a string.

:set &ref# xml_open('STRING','<xmlstring>')
:set &ref# = sys_last_err_nr()
:if &ret > 0
:  set &txt# = sys_last_err_ins()
!   implement error handling here
:endif

A bad XML string either leads to run time error, or returns a return code which can be read with sys_last_err_nr().

See also:

Script element Description

:XML_CLOSE

Closes XML documents.

Script Elements - Read or Modify Objects

Structured Documentation

www.w3c.org/TR/xmlbase

Sample Collection:
Retrieving Error Message and Number

About Scripts
Script Elements - Alphabetical Listing

Script-Elements - Ordered by Function