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

Problem in module-pool.

Former Member
0 Likes
399

Hi,

I have developed a Module-pool Prg

in Which i gave a error message if

User enters a particular Contry & enter the ban

color code for that particular country....

But the problem is whenever the error message is

Trigger the Ban color code field is disabled..

I am not been able to enter new color code instead

of ban color or i have to refresh again...and reenter all

entries...

Can any one.....

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
375

Hi,

In module pools ,do the validations in CHAIN END CHAIN only.

See below 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

Regards,

Anversha

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
376

Hi,

In module pools ,do the validations in CHAIN END CHAIN only.

See below 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

Regards,

Anversha

Read only

Former Member
0 Likes
375

Hi,

You need to include ur field in between chain and end chain.

And use Field statement.

When ever an error or warning message occurs on a scree n field validation,

Fields automatically gets disabled.

In order to make them in put enabled use Field Statement.

Syntax: Field field_name Module Module_name [on input or On Request]