cancel
Showing results for 
Search instead for 
Did you mean: 

chain ststement

Former Member
0 Kudos
48

Hi All,

What is the purpose of chain statement, where we use this chain statement?

Regards,

VRV Singh.

View Entire Topic
Former Member
0 Kudos

To ensure that one or more PAI modules are only called when several screen fields meet a particular condition, you must combine the calls in the flow logic to form a processing chain. You define processing chains as follows:

CHAIN.

...

ENDCHAIN.

All flow logic statements between CHAIN and ENDCHAIN belong to a processing chain. The fields in the various FIELD statements are combined, and can be used in shared conditions.

CHAIN.

FIELD: <f1>, <f 2>,...

MODULE <mod1> ON CHAIN-INPUT|CHAIN-REQUEST.

FIELD: <g1>, <g 2>,...

MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.

...

ENDCHAIN.

The additions ON CHAIN-INPUT and ON CHAIN-REQUEST work like the additions ON INPUT and ON REQUEST that you use for individual fields. The exception is that the module is called whenever at least one of the fields listed in a preceding FIELD statement within the chain meets the condition. So <mod1> is called when one of the fields <fi> meets the condition. <mod2> is called when one of the fields <f i> or <g i> meets the condition.

Within a processing chain, you can combine individual FIELD statements with a MODULE statement to set a condition for a single field within the chain:

CHAIN.

FIELD: <f1>, <f 2>,...

FIELD <f> MODULE <mod1> ON INPUT|REQUEST|*-INPUT

|CHAIN-INPUT|CHAIN-REQUEST.

MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.

ENDCHAIN.

The module <mod1> is called when screen field <f> meets the specified condition for individual fields. <mod2> is called when one of the fields <fi> or <f> meets the condition. If you use the addition ON CHAIN-INPUT or ON CHAIN-REQUEST with FIELD <f>, the condition also applies to the entire chain and module <mod1> and <mod2> are both called.

In cases where you apply conditions to various combinations of screen fields, it is worth setting up a separate processing chain for each combination and calling different modules from within it.

The functions of the FIELD statement for controlling data transport also apply when you use processing chains. Within a processing chain, screen fields are not transported until the FIELD statement. Processing chains also have another function for the FIELDS statements that they contain. This is described in the section on validity checks.

regards,

srinivas

<b>*reward for useful answers*</b>

franois_henrotte
Active Contributor
0 Kudos

beware: when raising an error message, processing is stopped until user changes values of fields on screen but only fields of the current chain are available

this is a way to indicate which fields do not pass the validation but also can lead to some annoying locks