What is the use of CHAIN and ENDCHAIN statement?

Answer Posted / saurabh shrivastava

If the validation has to be done for more than one field the
those fields are included between chanin and endchain.
Ex
In PAI if you want to validate group of fields put in
chain and End chain statement .


You can declare fields in the chain enchain .


CHAIN.
FIELD chk_ABC.
FIELD chk_DEF.
FIELD chk_GHI.
FIELD CHK-JKL.
MODULE CHK_screenfields.
ENDCHAIN.


MODULE CHK_screenfields INPUT.
CLEAR okcode.
okcode = sy-ucomm.
CASE okcode.
WHEN 'ENTER' OR 'EXECUTE'.

IF chk_ABC IS INITIAL AND chk_DEF IS INITIAL AND CHK_GHI
IS INITIAL .
MESSAGE e000(zo_spa) WITH text-017. " Enter VALUES'
ELSE.
.....
ENDIF.
ENDIF.

ENDMODULE. " modify_screenfields INPUT

Is This Answer Correct ?    26 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is a foreign key relationship? Explain this with the help of an example.

566


What are the check tables?

559


What are the personnel administration related Infotypes

2060


How many detail lists can be created in interactive reporting?

743


Explain what is the difference between sy-tabix and sy-index? Where it is used?

558






What is an Open Item in SAP? How will you find an Open Item in SAP?

621


It is possible to assign a local data object defined in a subroutine or function module to a field group. State true or false. : abap modularization

768


how to combine the transparent table with cluster table.

1101


What is sap abap data classes?

603


What are Pull and Push Methods?

1774


How are the date abd time field values stored in sap?

597


What are the function modules used in f4 help?

642


A subroutine can contain nested form and endform blocks. State true or false. : abap modularization

774


how to create module pool program using table controls based on selection criteria specified for sales document item in the first screen and item details in the second screen. plz mention the detail coding Tahnks, Rahul

3410


How do we handle multiple line items in BDC's.

6366