‎2009 May 26 10:26 AM
Hi All,
how to validate group of fields in the module pool programming ,
could you send any example pls.
Regards,
Kumar
‎2009 May 26 10:56 AM
Hi,
In the PROCESS AFTER INPUT in the SCREENS FLOW LOGIC.
write like this
PROCESS AFTER INPUT.
CHAIN.
FIELD : zempl-empid MODULE check_empid.
FIELD : zempl-age MODULE check_age.
FIELD : zempl-name MODULE check_name.
FIELD : zempl-dob MODULE check_dob.
ENDCHAIN.
Create Module - Endmodule for these modules by double clicking on them and then inside the Module EndModule, write the code for validation.
Regards,
S.Dakshna Nagaratnam.
‎2009 May 26 12:22 PM
...or
create one module for handling all the fields
CHAIN. "change on any of below fields
FIELD screenfield1.
FIELD screenfield2.
MODULE selection_changed ON CHAIN-REQUEST.
ENDCHAIN.
The addition ON CHAIN-REQUEST will cause that selection_changed module is exectued only if ANY of above fields were changed (but they can stay initial i.e. when deleting data from field and accepting that with ENTER). ON CHAIN-INPUT on the other hand, if used, would cause that selection_changed module would be exectued each time there is not initial value in ANY of the above fields entered.
Regards
Marcin
‎2009 May 26 12:56 PM
Hi,
In PAI.
PROCESS AFTER INPUT.
CHAIN.
FIELD : <field name1> MODULE <module name1>.
<field name2> MODULE <module name2>.
<field name3> MODULE <module name3>.
ENDCHAIN.
Now create these modules in F01 and write the validation code there.
For example if you want to check whether an employee number exists in the data base table and then if it does not exist then u have to give an error message else display the employee number,
it could be some thing like this:
SELECT SINGLE empno
FROM zemployee
INTO lv_empno
WHERE empno = <the employee no with which you are validating>.
IF sy-subrc = 0.
display it.
ELSE.
MESSAGE 'employee number does not exist' TYPE 'E'.
Thanks,
Sri...
‎2009 Jun 02 12:26 PM