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

screens

Former Member
0 Likes
1,087

I am new for dialog programming...

In a screen I need to do a validation that the value to be filled in should be between a range ex. 20 to 40.How do I do it?Please even tell me where should I do this coding in PBO or PAI?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,006

Hi,

Create a ranges..

RANGES: r_value for int4.

r_value-sign = 'I'.

r_value-option = 'BT'.

r_value-low = '20'.

r_value-high = '40'.

append r_value.

if not v_value in r_value.

message e000.

endif.

OR

IF v_value between 20 AND 40.

DO NOTHING..

ELSE.

MESSAGE E000.

ENDIF.

Thanks,

Naren

Hi,

Create a ranges..

RANGES: r_value for int4.

r_value-sign = 'I'.

r_value-option = 'BT'.

r_value-low = '20'.

r_value-high = '40'.

append r_value.

if not v_value in r_value.

message e000.

endif.

OR

IF v_value between 20 AND 40.

DO NOTHING..

ELSE.

MESSAGE E000.

ENDIF.

Thanks,

Naren

9 REPLIES 9
Read only

Former Member
0 Likes
1,006

In PAI module

Read only

0 Likes
1,006

Can you please help me with the code?

Read only

0 Likes
1,006
  • PAI Module

Module CheckValue.

  • In main program

Form CheckValue.

if ScrVal < 20

or ScrVal > 40.

  • message with value out of range

endif.

EndForm.

Read only

0 Likes
1,006

In your PAI module Flow logic

FIELD S_VAL module validate_sval.

in your PAI module pool.

module validate_sval.

if s_val < 20 or s_val > 40.

--error message.

endif.

endmodule.

Read only

Former Member
0 Likes
1,007

Hi,

Create a ranges..

RANGES: r_value for int4.

r_value-sign = 'I'.

r_value-option = 'BT'.

r_value-low = '20'.

r_value-high = '40'.

append r_value.

if not v_value in r_value.

message e000.

endif.

OR

IF v_value between 20 AND 40.

DO NOTHING..

ELSE.

MESSAGE E000.

ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
1,006

You should do in the PAI module..

Also please check my previous reply for a sample code..

Thanks,

Naren

Read only

Former Member
0 Likes
1,006

You can do it understanding this:

PAI: Process After input

PBO: Process Before output

Take a look

Read only

venkata_ramisetti
Active Contributor
0 Likes
1,006

Hi,

You have to code this in PAI.

PROCESS AFTER INPUT.

FIELD FIELD1 MODULE VALIDATE_FIELD1 ON INPUT.

Write your logic in the program to validate the FIELD1 like below.

MODULE MODULE VALIDATE_FIELD1 INPUT.

IF NOT FIELD1 BETWEEN 20 AND 40.

MESSAGE E398(00) WITH 'ERROR'.

ENDIF.

ENDMODULE.

Thanks,

ramakrishna

Read only

Former Member
0 Likes
1,006

under PAI event.

FIELD <fieldname>: VALUES (20,21...30).