‎2009 Feb 25 5:02 AM
Hi friends,
In modulepool if i will get any error in screen or table control i want to set the cursor position to that error place where i got the error ,how can i do that if possible can any one can provide the seggestion please.
Thanks in advance.
sai.
‎2009 Feb 25 10:09 AM
Dear Sai,
In flow logic for the screen, in PAI event you will be validating required fields.
For example if you are validating field called G_XXXXXX then your PAI looks like :
FIELD G_XXXXXX MODULE CHECK.
In the check module you will write code for validation of the field and if you write error message in this module, you cursor will be in the same field for which you are doing validation.
MODULE CHECK.
<code to validate field and if not validated error message>
ENDMODULE.
Same logic holds good for table control but only thing is your Module CHECK will be in loop for table control.
Example:
LOOP WITH CONTROL <table control>
FIELD G_XXXXXX MODULE CHECK.
ENDLOOP.
And if you want a set of fields to be input enabled under error condition put them in CHAIN...ENDCHAIN.
Example if there are 4 fields and G1,G2,G3 and G4 and you are validating them and you want G1 and G2 to be input enabled when error occurs in G1 then :
CHAIN.
Field : G1,
G2.
MODULE CHECK.
ENDCHAIN.
Hope i am clear.
Ramesh.
‎2009 Feb 25 10:09 AM
Dear Sai,
In flow logic for the screen, in PAI event you will be validating required fields.
For example if you are validating field called G_XXXXXX then your PAI looks like :
FIELD G_XXXXXX MODULE CHECK.
In the check module you will write code for validation of the field and if you write error message in this module, you cursor will be in the same field for which you are doing validation.
MODULE CHECK.
<code to validate field and if not validated error message>
ENDMODULE.
Same logic holds good for table control but only thing is your Module CHECK will be in loop for table control.
Example:
LOOP WITH CONTROL <table control>
FIELD G_XXXXXX MODULE CHECK.
ENDLOOP.
And if you want a set of fields to be input enabled under error condition put them in CHAIN...ENDCHAIN.
Example if there are 4 fields and G1,G2,G3 and G4 and you are validating them and you want G1 and G2 to be input enabled when error occurs in G1 then :
CHAIN.
Field : G1,
G2.
MODULE CHECK.
ENDCHAIN.
Hope i am clear.
Ramesh.
‎2009 Feb 25 10:36 AM
Hi,
You can use code like:-
FIELD <field1_name> MODULE <module_name>.
Now include the validation of <field1> in this module definition.
So, when you encounter an error for this field value all the other input fields will be greyed out and the cursor will be placed in the field <field1>
Or alternatively you can use:-
CHAIN.
FIELD : <field1_name>,
<field2_name>,
<field3_name>.
"and so on (if reqd.)
ENDCHAIN.
But using this whenever an error is encountered all the field specified in the CHAIN..ENDCHAIN will be enabled (open for input) and rest will be greyed out.
So you have to figure out that exactly which field value needs to be changed.
Hope this helps you.
Thanks & Regards,
Tarun Gambhir