2006 Dec 13 7:52 AM
Hi.
How can i check the validations in Module pool programming.
Thanks in advance.
srik
Hi.
How can i check the validations in Module pool programming.
Thanks in advance.
srik
2006 Dec 13 7:53 AM
hi,
use chain end chain.
eg:
For example if there are 10 fields in the screen and for 5 fields whenever the user enters wrong values u like to give some error message. You can declare that fields in the chain enchain so that only those fields will be input enabled and all other fields will disabled.
CHAIN.
FIELD chk_connobj.
FIELD chk_inst.
FIELD chk_devloc.
FIELD ehaud-haus.
FIELD eanl-anlage.
MODULE modify_screenfields.
ENDCHAIN.
*&---------------------------------------------------------------------*
*& Module modify_screenfields INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE modify_screenfields INPUT.
CLEAR okcode.
okcode = sy-ucomm.
CASE okcode.
WHEN 'ENTER' OR 'EXECUTE'.
IF chk_connobj IS INITIAL AND chk_inst EQ c_x AND
chk_devloc EQ c_x.
IF ehaud-haus IS INITIAL.
SET CURSOR FIELD 'EHAUD-HAUS'.
MESSAGE e000(zo_spa) WITH text-017. " Enter Connection obj
ELSE.
PERFORM conn_obj_check.
ENDIF.
ENDIF.
ENDMODULE. " modify_screenfields INPUTRgds
Anver
2006 Dec 13 7:54 AM
in process after input you should call something like below for field level validations in module pool programming.
chain .
field <screen fielname> module <module name> .
endchain .
module <modulename> input.
if <screen fieldname> is initial.
*error message
endif .
endmodule.
Regards,
Santosh
2006 Dec 13 7:56 AM
u have to do the validations in PAI
PAI
MODILE VALIDATION.
MODULE VALIDATION..
If field1 is initial.
message E001 ...
endif.
ENDMODULE
2006 Dec 13 7:58 AM
hi,
Normally sap is screen level validator
sometimes if you want to do filed level validations then you have to go with
chain....
.....
endchain
concept
with this you can do the validation filed level only ie if you put some value in some field in the screen, and if you defind the validdation for that field in between chain and end chain
if the value what ever u put is not compatable then u will get the message... rather than going through all the fileds in the screen and then if u perform some operation in the screen then giving the error....
Regards,
GNK
2006 Dec 13 8:00 AM
try tahat type
chain.
field : f1,f2,f3.
module m1.
endchain.
chain.
field : f1,f2,f3 module m1.
endchain.
field f1 module m1.
regards
shiba dutta