The GET command is used to read the inbound document object.
Fragments use only fields, so the GET FRAGMENT command requires the SERVICE_EXCHANGE(*FIELD) keyword.
Lists use only a working list, so the GET LIST command requires a working list argument.
Syntax:
|
Example
GET LIST(ORDERS) #WRKLST
GET FRAGMENT(DETAIL) SERVICE_EXCHANGE(*FIELD)
Note: List and Fragment keywords
You can only use one keyword at a time.
There are two ways in which you can read a list from an XML document.
1. You can either define the relevant section of the XML code as a list (using the XML Binding Wizard), and use the LIST keyword in your GET command. This will retrieve the entire list in one go into a working list.
2. Alternatively, you can define the relevant section as a collection of fragments (using the XML Binding Wizard) and then use the FRAGMENT keyword in your GET command and place this in a loop.
The following points are important when using GET FRAGMENT and GET LIST together.
Note: Instruction keyword
If the XML processing instructions were as per the following example:
<?xml version="1.0" encoding="utf-8"?>
<?Label SLBK|PROFILE|208|SUCCESS?>
<Orders>
Then you could use the following command to retrieve the instruction.
GET INSTRUCTION(Label)