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

regarding validation

Former Member
0 Likes
651

Hi All,

how to validate group of fields in the module pool programming ,

could you send any example pls.

Regards,

Kumar

4 REPLIES 4
Read only

Former Member
0 Likes
613

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.

Read only

MarcinPciak
Active Contributor
0 Likes
613

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

Read only

sridhar_meesala
Active Contributor
0 Likes
613

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

Read only

Former Member
0 Likes
613

thanks,