Application Development 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: 

How to throw error in Module pool

vikash_pathak
Participant
0 Kudos

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

himanshu_gupta13
Employee
Employee
0 Kudos

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

former_member289261
Active Contributor
0 Kudos

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

venuarun
Active Participant
0 Kudos

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

0 Kudos

@ARUN VS

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

0 Kudos

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.???

venuarun
Active Participant
0 Kudos

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

VenkatRamesh_V
Active Contributor
0 Kudos

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.