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

FIELD ... MODULE ... ON INPUT

Former Member
0 Likes
4,516

Hi experts!

Can you answer me one question?

My code in the PAI:

FIELD field MODULE on_change ON INPUT.

Module on_change:


MODULE on_change INPUT.
  MESSAGE 'The field FIELD is not empty' TYPE 'I'.
ENDMODULE.

The code in this module is performed each time in the PAI. But it has to be performed only if the FIELD is not empty! What is my problem?

Declaration of the FIELD:

DATA field TYPE string

Regards,

Pavel Aleshko

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,624

Module on_change:

MODULE on_change INPUT.

<b>if field NE space.</b>

MESSAGE 'The field FIELD is not empty' TYPE 'I'.

<b>endif.</b>

ENDMODULE.

6 REPLIES 6
Read only

Former Member
0 Likes
1,625

Module on_change:

MODULE on_change INPUT.

<b>if field NE space.</b>

MESSAGE 'The field FIELD is not empty' TYPE 'I'.

<b>endif.</b>

ENDMODULE.

Read only

0 Likes
1,624

Thanks for the answer.

But I don't understand this quote from the help then.

<i>"Addition 1 ... ON INPUT

Effect: With this condition, module mod is called only if the screen field dynp_field is not empty."</i>

So this module hasn't to be performed cause field is empty! What is wrong?

Regards,

Pavel Aleshko

Read only

Former Member
0 Likes
1,624

yes on input only fires if you give any input to the field. i.e. not empty.

on request you can use it will fire when you are changing any entry .

if you dont want that just ommit that on input or on request from your

FIELD field MODULE on_change ON INPUT

i.e

FIELD field MODULE on_change.

it will fire for the field every time in pai for that field

regards

shiba dutta

Read only

0 Likes
1,624

> yes on input only fires if you give any input to the

> field. i.e. not empty.

Hi shiba dutta.

That is the problem. If you write this code it will always perform the module <b>on_change</b> even if <b>field</b> is empty.

Code in the program:

DATA field TYPE string
MODULE on_change INPUT.
  MESSAGE 'The field FIELD is not empty' TYPE 'I'.
ENDMODULE.

Code in the screen flow logic:

FIELD field MODULE on_change ON INPUT.

Do you have any idea why this module is always performed?

Points will be awarded!

Regards,

Pavel Aleshko

Read only

0 Likes
1,624

Can I know how you create ->

DATA field TYPE string

in screen painter?

Do you use Input/Output Fields(Textbox)?

Read only

Former Member
1,624

Hi,

Field <field name> module <module name> is triggered when ever the field has non initial value. To trigger only when its value is changed, you have to write field <fieldname> module <module name> on request.

You write in the pai of flow logic

field <fieldname> module <module name> on request.

In se38 in the module block

if not <fieldname> is initial.

error message.

endif.

Then this is triggered only when it is changed and is non initial.

warm regards,

kamala.