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

How can i put the validations in Dialog programming

Former Member
0 Likes
768

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

5 REPLIES 5
Read only

anversha_s
Active Contributor
0 Likes
713

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 INPUT

Rgds

Anver

Read only

Former Member
0 Likes
713

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

Read only

Former Member
0 Likes
713

u have to do the validations in PAI

PAI

MODILE VALIDATION.


MODULE VALIDATION..

  If field1 is initial.
      message E001 ...
   endif.

ENDMODULE

Read only

Former Member
0 Likes
713

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

Read only

Former Member
0 Likes
713

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