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

module-pool

Former Member
0 Likes
940

HI

How to validate a field in selection-screen of a dialog program.

Best regards,

Mahesh.

9 REPLIES 9
Read only

Former Member
0 Likes
911

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

Read only

Former Member
0 Likes
911

AT SELECTION SCREEN OUTPUT.

MIGHT ALSO BE HELPFUL

Read only

Former Member
0 Likes
911

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

Read only

Former Member
0 Likes
911

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.

Read only

Former Member
0 Likes
911

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.

Read only

Former Member
0 Likes
911

Hi

Validations should be done in Process After Input.

In PAI, use chain and endchain for validation of fields.

Regards

Swathi

Read only

Former Member
0 Likes
911

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

Read only

Former Member
0 Likes
911

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

Read only

Former Member
0 Likes
911

use at selection-screen on <fld_name> in the PAI of the calling screen.