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
    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

For more information, see Reports

For strings:
String

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


Return code

Reference to the XML document.

The script function opens an XML document for processing purposes. You can open only one XML document at a time. The XML document can be structured documentation or the report of an SAP job.

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.

More Information:

Notes:

  • Reports of SAP jobs are stored as XML documents. For XI_GET_CHANNEL, they contain a list of selected communication channels. For more information, see XI_GET_CHANNEL.
  • Use XML_CLOSE to close the XML document after processing. For more information, see :XML_CLOSE.

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: