Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Module Pool Program(SAP-ABAP)

Former Member
0 Likes
379

Hi,

I am trying to put CHAIN..ENDCHAIN logic in PAI module

to validate screen.

How sd i use CHAIN..ENDCHAIN ?

Pls guide me with suitable example.

I m waiting for ur reply........

Thanx in Adv.

Prabhas

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
349

HI,

See the thread:

i copied the below data from SAPHELP for your sake,

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.

<i>

Check this out

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801ca2454211d189710000e8322d00/frameset.htm</i>;

Regards

anver

Message was edited by: Anversha s

Read only

Former Member
0 Likes
349

Prabhas,

when u have 5 fields and if one of the filed's validation fails, and you want all the 5 fields in input mode than use these 5 fields in chain and endchain.

so you can change any field value.

if it is not in chain, only that paricular field will be in input mode and all other will be in display mode.

-Anu