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 to validate the field values in module pool program?

Former Member
0 Likes
1,853

Hi Guys

I am working with module pool programming.

Here I want to validate the fields like below.

with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled. This can be done by checking all the fields individually.

I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.

If it is possible, can anyone help me?

2 REPLIES 2
Read only

Former Member
0 Likes
631

You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51

If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:

CHAIN.

FIELD: <f1>, <f 2>,...

MODULE <mod1>.

FIELD: <g1>, <g 2>,...

MODULE <mod2>.

...

ENDCHAIN.

all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.

Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.

ashish

Read only

former_member491305
Active Contributor
0 Likes
631

Hi,

No need to use loop at screen to validate the fields.You can put a condition while handling the SAVE user comand.

Eg:

Module user_command input.

case ok_9000.

when 'SAVE'.

if field1 is initial or field2 is initial.

message 'all fields has to be filled' type 'I'.

exit.

Endif.

endcase.

endmodule.