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 throw error in Module pool

vikash_pathak
Participant
0 Likes
2,551

Hi Experts,

I have one probelum in Module pool Programm and i need you solution,

i have 10 input fields in  module pool, and the first field is land1,

when i will give input in land1 as "US" so it should throw error "not allowed"

and all the field should be enable. should not be disable

please help me out.

thanks

Vikash

Hi Experts,

I have one probelum in Module pool Programm and i need you solution,

i have 10 input fields in  module pool, and the first field is land1,

when i will give input in land1 as "US" so it should throw error "not allowed"

and all the field should be enable. should not be disable

please help me out.

thanks

Vikash

7 REPLIES 7
Read only

himanshu_gupta13
Product and Topic Expert
Product and Topic Expert
0 Likes
1,767

Hi,

You can show message in PAI whenever field finds US.

if land1 = 'US'.

     Message 'Invalid Input' Type 'I'.

     leave to screen 100 .

endif.

Many Thanks / Himanshu Gupta

Read only

Former Member
0 Likes
1,767

Hi,

In your PAI, do this :

CHAIN.

     FIELD 1,
     FIELD 2,

     ..

     ..

     FIELD 10

     MODULE VALIDATE.

ENDCHAIN.

Now, in module VALIDATE write code :

IF LAND1 = 'US'

     MESSAGE 'ERROR' TYPE 'E'.

ENDIF.

This will throw error message while all the 10 fields will remain enabled.

Regards,
Ashish

Read only

venuarun
Active Participant
0 Likes
1,767

Hi Vikash,

In PAI ,

Chain

field1

Field2

Field3

......

Module Validate

Endchain.

In this module you give your condition

IF Field1 = 'AB'

MESSAGE 'ERROR' TYPE 'E'.

Endif.

Regards

Arun VS

Read only

Former Member
0 Likes
1,767

@ARUN VS

Please go through the thread before posting solutions and avoid posting the same solution which is posted already.

Read only

0 Likes
1,767

Thanks for your reply, i got the solution.

and one more thing is that suppose in case if i would like to disable all the the field in same condition just opposite of the this. so how could we achieve it.???

Read only

venuarun
Active Participant
0 Likes
1,767

Hi Vikash,

In  PBO you should give your code for disabling ,

In  PBO

Loop at screen

Screen Name = 'field1'

screen name = 'field2'

screen active = 0

modify screen

Endscreen

Regards

Arun VS

Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,767

Hi Vikas,

try this,

if  LAND1 EQ 'US'.
MESSAGE 'No Data can be found!' TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING
endif.


Regards,

Venkat.