Application Development 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: 

use of chain & endchain in modulepool

Former Member
0 Kudos

Hi Gurus,

Can anyone tell what chain endchain does in modulepool,

with eg pl..

1 ACCEPTED SOLUTION

bpawanchand
Active Contributor
0 Kudos

Hi

Sometimes you want to check several fields as a group. To do this, include the fields in a FIELD statement, and enclose everything in a CHAIN-ENDCHAIN block. Example **** Screen flow logic: **** CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.

Regards

Pavan

5 REPLIES 5

bpawanchand
Active Contributor
0 Kudos

Hi

Sometimes you want to check several fields as a group. To do this, include the fields in a FIELD statement, and enclose everything in a CHAIN-ENDCHAIN block. Example **** Screen flow logic: **** CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.

Regards

Pavan

Former Member
0 Kudos

hi krishna chauhan,

chain & end chain are applied for PAI.

All fields are validations only.

Regards,

S.Suresh.

Former Member
0 Kudos

Hi,

You can assume 'Chain and Endchain' in module pool as SELECTION-SCREEN BEGIN OF BLOCK B1.

-


-


SELECTION-SCREEN END OF BLOCK B1.

Hope now you understand the concept of 'Chain and Endchain' in Module pool.

Thanks,

Phani Diwakar.

naveen_inuganti2
Active Contributor
0 Kudos

Hi...,

Chain End chain operater is validates the screen fields...

Ex: Code...in PAI event...

> CHAIN.

> FIELD f!.

> FIELD f2.

> END CHAIN

we can validate with out CHAIN and ENDCHAIN also...

But if you give incorrect input fot f1 here it wont allows you to f2 field.. but in this case.. you can enter Both fields even one is wrong.

Apart from this basic purpose we can use CHAIN and ENDCHAIN in no. of situvations of module pool screens.

For example we are having a table control with four fields in module pool screen.... and as we know we can arrange check box or row selecter as first field of that table control to select the records.....

Now see the following code....

> LOOP AT ITAB.

>

> CHAIN.

> FIELD ITAB-f1.

> FIELD ITAB-f2.

> FIELD ITAB-f3.

> FIELD ITAB-SELKZ.

> field ITAB-SELKZ Module ON_SELECT on request.

> ENDCHAIN.

>

> ENDLOOP.

here on_select module will triggers for selected record in screen...

So we can dynamically handle some actions... with table control......in chain and endchain oparater.....

Thanks,

Naveen.I

Former Member
0 Kudos

Hi Krishna.

I would like to suggest,

Chain and end chain are used for multipe validation on

module pool programing.

I would also like to suggest a couple of references,

[SDN - Reference for Module pool - Chain & Endchain|;

[SAP HELP - Standard Reference for Input checks in Dialog modules - Chain & endchain|http://help.sap.com/saphelp_46c/helpdata/EN/9f/dbaa4735c111d1829f0000e829fbfe/content.htm]

[SDN - Reference for validating of fields using chain & Endchain in Module pool program|;

[SDN - Reference for writing a module pool program with significance of Chain & Endchain statements|;

Hope that's usefull.

Good Luck & Regards.

Harsh Dave