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

Module pool problem!!

Former Member
0 Likes
1,236

Hi,

Ther is a field on screen which whenever is lesser than 0 , i need to clear the field on the screen and throw the error message , that the quantity field is lesser than 0.

but it works fine in debugging mode but in real time it throw the message but clearing of field is not happening....

Regards

Gunjan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,210

hi,

u are clearing the screen field in the PAI module of the program, but this cleared field value is passed to the screen only after the PBO. As error message is executed immediately after the CLEAR statement program execution stops there itself without executing the PBO module. So old value is displayed on the screen.

11 REPLIES 11
Read only

Former Member
0 Likes
1,210

Hi,

U clear this in PAI event.

Thanks

Giridhar

Read only

Former Member
0 Likes
1,210

hi

u might have used

if sy-subrc ne 0

error message

before giving error message write <b>clear <field name>.</b>

and to make that field editable incase it gets disabled, in the PAI of that screen

write

<b>field <field name > module <module name > on request</b>

inside this module write ur validation code

regards

ravish

<b>

plz reward points if helpful</b>

Read only

Former Member
0 Likes
1,210

Hi,

Before thorowing the error, just clear the field.

before the MESSAGE statement write the CLEAR stament

Regards

Sudheer

Read only

Former Member
0 Likes
1,210

Are you moving the 0 value to the screen field before issuing the error message?

Read only

Former Member
0 Likes
1,210

You can put the field & the module in which ur checking the field

in chain endchain in PAI module

Sandeep

Reward if helpful

Read only

0 Likes
1,210

 CHAIN.
    FIELD v_new_qty.
    MODULE f_message.
  ENDCHAIN.

CLEAR : v_syucomm.

  v_syucomm = sy-ucomm.
  v_qty = v_new_qty.
  IF v_syucomm EQ 'ENTER'.
    IF v_qty < 0.
      PERFORM f_clear.
      MESSAGE e001(z2c_gdmvt).
    ELSEIF v_qty > v_vmng.
      PERFORM f_clear.
      MESSAGE e002(z2c_gdmvt).
    ENDIF.
  ENDIF.

pls check the code for ur reference..

Regards

Gunjan

Read only

0 Likes
1,210

Hi Sankar

I guess u hav got the problem...

what shall i do to overcome this situation?

Regards

Gunjan

Read only

0 Likes
1,210

or set one global flag

<b>in PAI</b>

If screen-field LT 0.

clear screen-field.

v_flag = 'X'.

message ..............

endif.

<b>in PBO</b>

if v_flag eq 'X'.

clear screen-field.

clear flag.

endif.

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

0 Likes
1,210

hi chandrasekar,

it works fine in debugging mode but doesn't work in normal transaction ....

Regards

Gunjan

Read only

Former Member
0 Likes
1,211

hi,

u are clearing the screen field in the PAI module of the program, but this cleared field value is passed to the screen only after the PBO. As error message is executed immediately after the CLEAR statement program execution stops there itself without executing the PBO module. So old value is displayed on the screen.

Read only

Former Member
0 Likes
1,210

try this..

If screen-field LT 0.
  clear screen-field.
  message ..............
endif.