‎2007 Aug 07 8:01 PM
hello guyz,
In module pool programmming, I need to vaildate entries made by the user in the PAI block. Once the entry is valid, I need to move the cursor to the next input field.
Is it possible to set the cursor field in the PAI block. Could you please help me out in this issue because as for as I know the set cursor field works only in PBO.
thanks,
karthikeyan
‎2007 Aug 07 8:06 PM
Hi,
Write it in the PBO module of the next screen.. For Each an Every Action on the Screen... first PAI and PBO is triggered.. So it is approprite to do it in PBO Only..
Thanks,
Mahesh
Message was edited by:
I Can Solve It
‎2007 Aug 07 8:27 PM
thanks for your replies..
I'm not able to understand ur solution...I've only one screen...do I've to create a similar second screen to wrtie it in the PBO..
‎2007 Aug 07 8:35 PM
No dont create another screen..
For validation you might be using chain .. endchain..
let us say i have a material field and quantity field... i want to validate materil and set the cursor in quantity field.
chain
field : material module validate_material
endchain.
module validate_material.
select single * from mara where matnr = material
if sy-subrc eq 0.
set cursor field quantity.
endif.
endmodule.
‎2007 Aug 07 9:10 PM
thanks a lot...
as u suggested i wrote it in the PBO...
it works fine..but my cursor is already in the quantity field when the screen is displayed...
What can I do to have the cursor in the material field initally and then based on validation has to move to quantity field..
I appreciate ur help..
‎2007 Aug 07 9:53 PM
HI,
Take a flag filed initially it will be empty.. when validating.. if value is correct then set the flag to X and in ur PBO check for this flag variable and set the cursor accordingly.
if v_flag eq 'X'.
set cursor field ..
endif.
Thansk
Mahesh
‎2007 Aug 07 9:55 PM
You can also use set cursor in PAI. Make sure you input the field in quotes as follows.
SET CURSOR FIELD 'T_TEST-NAME'