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

chain and end chain

Former Member
15,773

Hi,

What's the use of chain and endchain.

Regards

Suresh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,773

Hi Suresh

To make all the fields ready for Input, even if a single field was entered wrongly.

we use this in PAI

CHAIN.

fields: f1, f2, f3.

module < mod Name>.

endchain.

Hope this helps !!!

Britto

9 REPLIES 9
Read only

Former Member
0 Likes
4,774

Hi Suresh

To make all the fields ready for Input, even if a single field was entered wrongly.

we use this in PAI

CHAIN.

fields: f1, f2, f3.

module < mod Name>.

endchain.

Hope this helps !!!

Britto

Read only

Former Member
0 Likes
4,773

Chain and endchain..............form an processing chain in module pool program. It surves different activities :

1. For data validetion:

If you want to keep a no of fields ready for input in the time of validetion then put them within end and endchain.

2. If you want a module to be execute depending a no of fields ( on input/ on request) then it is used.

Read only

Former Member
0 Likes
4,773

hi suresh

1. It is used in module pool programming

2. Lets say there are 5 fields on a screen , when trying to execute there is an error in one of the 5 fields

3. All the other 4 fields will get greyed out(changes to display mode) on the screen.

4. To overcome that we use chanin endchain

5.

MODULE PAI

CHAIN.

FIELDS : FIELD1,

FIELD2,

.....

ENDCHAIN.

regards

navjot

Read only

0 Likes
4,773

minor correction.

FIELD.

FIELDS is not a valid key word.

Read only

Former Member
0 Likes
4,773

Hi,

check this sample code....

PROCESS AFTER INPUT.

  • Module to control Exit

MODULE EXIT_PROGRAM AT EXIT-COMMAND.

CHAIN.

  • Validate Remittance advice No

FIELD: WS_REMIT_HEAD-COMP_CODE module check_comp_code,

WS_REMIT_HEAD-REM_ADV_NO,

WS_REMIT_HEAD-FYEAR.

MODULE CHECK_REMITTANCE.

ENDCHAIN.

MODULE USER_COMMAND_0100.

MODULE CHECK_REMITTANCE INPUT.

DATA:

LW_DOC_DATE LIKE SY-DATUM, " Document Date

WA_REMIT LIKE ZFI_REMIT-REM_ADV_NO." Remittance Advice Number

  • Check the Remittance no is Exists

SELECT SINGLE REM_ADV_NO " Remittance Advice No

FROM ZFI_REMIT

INTO WA_REMIT

WHERE COMP_CODE = WS_REMIT_HEAD-COMP_CODE

AND REM_ADV_NO = WS_REMIT_HEAD-REM_ADV_NO

AND FYEAR = WS_REMIT_HEAD-FYEAR.

IF SY-SUBRC EQ 0.

  • if exists set the display Flag

W_FLAG_CREA_DISP = SPACE.

ELSE.

  • if not Exists set Create remittance flag

W_FLAG_CREA_DISP = SPACE.

MESSAGE 'Enter a Valid Remittance Number'(050)

TYPE C_MESSAGE_E.

ENDIF. " IF SY-SUBRC EQ 0.

ENDMODULE. " check_remittance INPUT

with regards...

Jay

Read only

Former Member
0 Likes
4,773

Hi Suresh,

The CHAIN ... END CHAIN statement is used in Flow logic block.

While creating screen, we want to validate group of fields, for validating group of fields we are using CHAIN.... END CHAIN statement.

Chain

FIeld wa_tmp-name

Field wa_tmp-ID

Module valudate NAME_ID

End chain.

the above example is used to validate 2 fields..

mail me for any clarifications

Rajesh

Read only

0 Likes
4,773

Man its very easy once u throw an error message with the message command on the screen the screen will be displayed in output only mode.In order to make the fields editable we require chain endchain,,,,,the fields defined in chain endchain will be available for input even after the error message is thrown...

hope it helps..

if not clear tell me i will try to make it more simple for u

Read only

Former Member
0 Likes
4,773

Hi Suresh,

Please refer to the following link.

http://help.sap.com/saphelp_47x200/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm

Thanks and Regards

Archana.S

Read only

0 Likes
4,773

Hi,

If error detected inside the chain and end chain, then fields that are in chain are made Input enabled other fields which are not mentioned in chain and end chain remain input disabled.

Between chain and end chain user executes module and field.

Regards,

Nasreen