How to test the Change method

This topic describes how you can test a Business Object's public Change method.

XML schema file request
The following figure shows the XML schema file of the request argument of the change method of the Order (tlbct790) Business Object.
tl bct bl790bcgrq0000.xsd
		  tlbct790-Change-Request
tl bct bl790bcgrq0000.xsd tlbct790-Change-Request
Enter request

The main difference between the Create method and the Change method is that the Change method runs on an existing object in LN

[...]
[...]
As you can see by the red markings in the Graphical Browser, specifying the object ID is mandatory:
[...]

You are free to fill in the attributes that must be changed. In the previous example, the installAt attribute must be changed from COR to TOM on the header, and the orderedQuantityValue attribute must be changed from 100 to 8.

Note

The attributes that must not be modified must be removed from the Graphical Browser.

Action type

For the Change method, some additional functionality is available. On the component level, you must enter the action type.

You can find the following menu options in the Menu Browser's Specific menu:

  • Set Action Type `Create'
  • Set Action Type `Change'
  • Set Action Type `Delete'
  • Set Action Type `Unchanged'

You can also select these options on the shortcut menu when you right-click a component.

In this way, you can also delete lines by means of the Change method.

The next request is an example in which the installAt attribute will be changed and lineNumber 10 will be deleted.
[...]

Save the Request argument and close the graphical browser to return to the BOL Test Tool - Public Layer (tlbct3250m000) session.

Execute test

After the Request argument is created, you can run the test. Click Execute Test. Refer to Execute test for more details.

View response
For a successful execution, the Response Graphical Browser looks as follows:
[...]

As you can see, the Response Graphical Browser does not contain information.

View result
Assume that the application logic as follows. You cannot modify the installAtBP attribute if the order is Approved:
[...]

The DAL script contains the following code:

function extern domain tcbool tlbct700.bpsh.is.readonly()
{
  if tlbct700.stat = tlbct.stat.approved then
     dal.set.error.message("@Order is approved")
     return(true)
  endif

		return(false)
}
In that case, an error is presented in the Result Graphical Browser format:
[...]