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-endchain

Former Member
0 Likes
818

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
746

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

4 REPLIES 4
Read only

Former Member
0 Likes
746

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

Read only

Former Member
0 Likes
747

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

Read only

0 Likes
746

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

Read only

Former Member
0 Likes
746

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