‎2006 Jun 22 1:04 PM
HI
How to validate a field in selection-screen of a dialog program.
Best regards,
Mahesh.
‎2006 Jun 22 1:07 PM
hai,
you have to write the validation code in the PAI event.
Ex:
PROCESS AFTER INPUT.
FIELD <fname> MODULE validate_<fname>.
then you can write ur validation code in the module.
Cheers,
Umasankar
‎2006 Jun 22 1:09 PM
‎2006 Jun 22 4:06 PM
Hi,
In the PAI event,
CHAIN
Field : l_empid validate_empid.
field : v_name validate_name.
ENDCHAIN.
Create form/endform of validate_empid. It will be called automatically and validation would be done.
Best regards,
Prashant
‎2006 Jun 22 4:11 PM
HI Mahesh,
In PAI
PROCESS AFTER INPUT.
FIELD f1 MODULE m1.
FIELD f2 MODULE m2.
CHAIN.
FIELD: f1, f2, f3.
FIELD: f4, f5, f1.
MODULE m3.
MODULE m4.
ENDCHAIN.
CHAIN.
FIELD: f6.
MODULE m5.
ENDCHAIN.
CHAIN.
FIELD f4.
MODULE m6.
ENDCHAIN.
Regards,
Laxmi.
‎2006 Jun 22 4:14 PM
hi,
check this sample prog.
data:v_matnr like marc-matnr,
v_werks like marc-werks,
v_pstat like marc-pstat,
v_mmstd like marc-mmstd.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
case sy-ucomm.
when 'SUBMIT'.
select single pstat mmstd from marc into (v_pstat,v_mmstd) where matnr
=
v_matnr and werks = v_werks.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave to screen 0.
when 'BCK'.
leave to screen 0.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'TRANS'.
SET TITLEBAR 'TRANSA'.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module mod1 INPUT
&----
text
----
MODULE mod1 INPUT.
select single matnr from mara into (v_matnr) where matnr = v_matnr.
if sy-subrc ne 0.
message e000(zz) with 'Invalid materialnumber'.
endif.
select single werks from marc into (v_werks) where werks = v_werks.
if sy-subrc ne 0.
message e000(zz) with 'Invalid plant'.
endif.
ENDMODULE. " mod1 INPUT
in the pai write,
chain.
fld1,fld2.
module mod1.
endchain.
reward if helpful.
regards,
keerthi.
‎2006 Jun 23 12:45 PM
Hi
Validations should be done in Process After Input.
In PAI, use chain and endchain for validation of fields.
Regards
Swathi
‎2006 Jun 23 1:58 PM
hI,
For the validation of a single field u have to use the syntax in PAI
FIELD <fieldname> MODULE <modulename>.
and for more than one field u can write the code between Chain and Endchain.
Hope this helps u.
Seema
‎2006 Jun 23 2:08 PM
hi,
The validation of a single field
In PAI, you have to mention the field and do the validation in corresponding module.
FIELD <fieldname> MODULE <modulename>.
if you want to validate more than one field then you need to write in Chain and Endchain.
Hope this information is useful.
Regards,
Richa
‎2006 Jun 23 2:09 PM
use at selection-screen on <fld_name> in the PAI of the calling screen.