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

VALIDATIONS ON PARTICULAR FIELD IN MODULE POOL

Former Member
0 Likes
5,997

Hi Experts,

                 i want to validate the particular field only in module pool after performing some operations(like after pressing push button).if i use CHAIN-END CHAIN on PAI it will show error every time when  i press enter but i want that error should be displayed after  pressing 'SUBMIT' button only.when i write the error message on sy-ucomm for SUBMIT(i.e with out using CHAIN-END CHAIN)it show error and disabling all the fields. can anyone tell me how to solve the problem.

                                                                          

                                                                                                                                                                           Thank's in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,313

Hi

You can do validation in the PAI for the fields

For multiple fields validation you can use CHAIN..ENDCHAIN

Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. 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.


In your chain endchain statement module.You can check the condition

           In the IF condition check the  ok_code = 'SUBMIT'

         write your logic


Hi Experts,

                 i want to validate the particular field only in module pool after performing some operations(like after pressing push button).if i use CHAIN-END CHAIN on PAI it will show error every time when  i press enter but i want that error should be displayed after  pressing 'SUBMIT' button only.when i write the error message on sy-ucomm for SUBMIT(i.e with out using CHAIN-END CHAIN)it show error and disabling all the fields. can anyone tell me how to solve the problem.

                                                                          

                                                                                                                                                                           Thank's in advance.

16 REPLIES 16
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,313

In your chain endchain statement module where you are doing validation put an if gv_okcode eq 'SUBMIT' then only run.

chain

field abc module check.

endchain

module check

if sy-ucomm eq 'SUBMIT'.

validation

endif,.

endmodule

Nabheet

Read only

sivaganesh_krishnan
Contributor
0 Likes
3,313

hi rajendra,

write your code inside chain - endchain itself.. you have to restrict the control for your requirement.

write a IF condition and allow only if the ok_code EQ 'SUBMIT' .

this will work

Regards,

sivaganesh

Read only

Former Member
0 Likes
3,313

Hello;

Input check con be done in different ways; check the package "SDWA"

Read only

Former Member
0 Likes
3,314

Hi

You can do validation in the PAI for the fields

For multiple fields validation you can use CHAIN..ENDCHAIN

Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. 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.


In your chain endchain statement module.You can check the condition

           In the IF condition check the  ok_code = 'SUBMIT'

         write your logic


Read only

0 Likes
3,313

Thankyou much Kiran for this helpful answer but if i want to validate multiple fields and the field i get error only editable and the remaining fields should be in non editable format what should i do then.

                                                                                                              thankyou,

Read only

0 Likes
3,313

Hi,

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.

Read only

0 Likes
3,313

Make seaparate group of chain endchain fields

Read only

0 Likes
3,313

Hi,

Check this demo program!

DEMO_DYNPRO_FIELD_CHAIN

Read only

0 Likes
3,313

Hi Rajendra,

If you want to make the error fields to be editable and other fields to be in display mode then dont enter the fields with in chain - end chain.

Do as below:

PAI:

field abc module check1.

field def module check1.

field ghi module check2.

module check1.

if sy-ucomm eq 'SUBMIT'.

"validation process"

endmodule.

module check2.

if sy-ucomm eq 'SUBMIT'.

"validation process"

endmodule.

Then the corresponding field which has error will be editable.

Hope it might help you.

With Regards,

Giriesh M

Read only

0 Likes
3,313

Hi rajendra,

For validating multiple fields you use CHAIN...ENDCHAIN.

And,for validating single field you use FIELD..MODULE statement.

In second case, only one field becomes editable on error or warning while others are not editable.

In first case all fields specified in CHAIN ENDCHAIN block becomes editable on error or warning while  fields outside this block remains non editable.

Now you want, fields in CHAIN..ENDCHAIN to be selectively be editable and non editable based on  particular field which produced error or warning.

i think you can mark those fields, and in PBO you can make them non editable.

kherwa

Read only

0 Likes
3,313

Thankyou Giriesh Problem solved with your solution.your r genious.

Read only

0 Likes
3,313

Thankyou nabeet but now only i know chain endchain is for multiple fields.

Read only

Former Member
0 Likes
3,313

I am very Thankfull to all of  you for helping me to solve this problem

Read only

Former Member
0 Likes
3,313

Hi one more doubt If i use chain endchain all the fields which i put Under chain-endchain are in enable mode.  if i use FIELD---MODULE it validates first field and shows error .after correcting it it goes for second error field . If i want all the error fields only in editable(i.e AT A TIME) .and remaing fields in  noneditable MODE.

Read only

0 Likes
3,313

Hi Rajendra,

you can do either a particular field or a group of fields. If you are using a particular field then it will proceed one by one fields as you mentioed earlier and if you are grouping it, the grouped fields irrespective of the error will be enabled. Your scenario is not possible to enable only the error fields.

With Regards,

Giriesh M

Read only

0 Likes
3,313

ok Thankyou Giriesh.