‎2008 May 27 12:58 PM
hi,
i have written the following code in PAI event
LOOP AT gt_maint_plan.
CHAIN.
FIELD: field1,
field2.
MODULE validate_1000 ON CHAIN-REQUEST.
MODULE get_data_frm_tc.
ENDCHAIN.
ENDLOOP.
In which field1 and field2 are mandatory fields.
the validations i wrote in MODULE validate_1000 ON CHAIN-REQUEST.
now my issue is ..if iam not entering field1 and field2 ,,
iam not getting the error message.
the control is not going to the VAlidation module.
regards,
shilpa
‎2008 May 27 3:31 PM
hi,
CHAIN.
FIELD: field1,
field2.
MODULE validate_1000.
ENDCHAIN.
Here, y u keeping loop and endloop
What is your exact requirement.
This code mainly for : If you display any error message, the reamaining fields will be disabled. to avoid this, we need to keep them in chain..endchain.
If you want to make them mandatory, wen you create the screen, when click on the field, one popup wil come. there in Program tab one option will be there : Input ...select this as REQUIRED.
so, default error message wil come.
regards
Sandeep REddy
‎2008 May 27 1:41 PM
Have a read of [Conditional Module Calls|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm] and you will see that this is the expected behaviour... but why are these inside the table control loop? Why not, instead, just have:
CHAIN.
FIELD:
field1,
field2.
MODULE validate_1000.
ENDCHAIN.
LOOP AT gt_maint_plan.
MODULE get_data_frm_tc.
ENDLOOP.
... And if field1 & field2 are mandatory, can't you just flag them as obligatory in their field attributes...?
Jonathan
‎2008 May 27 3:31 PM
hi,
CHAIN.
FIELD: field1,
field2.
MODULE validate_1000.
ENDCHAIN.
Here, y u keeping loop and endloop
What is your exact requirement.
This code mainly for : If you display any error message, the reamaining fields will be disabled. to avoid this, we need to keep them in chain..endchain.
If you want to make them mandatory, wen you create the screen, when click on the field, one popup wil come. there in Program tab one option will be there : Input ...select this as REQUIRED.
so, default error message wil come.
regards
Sandeep REddy
‎2008 May 28 11:24 AM
Hi,
Thanks for your reply.
I did the same thing but the error message is not coming.
In the screen the fields r showing as mandatory fields,
but when i click enter, iam not getting the error message.
Regards,
kirthi
‎2008 May 28 7:43 AM
Hi,
You can try like this...
********************************
CHAIN.
field FIELD1 module chk1.
field FIELD2 module chk2.
ENDCHAIN.
LOOP AT gt_maint_plan.
MODULE get_data_frm_tc.
ENDLOOP.
************************************
write your validations and error messages in the modules CHK1 and CHK2.
Reward if helpful.
Regards,
Syed