2007 Aug 29 7:20 PM
Hi,
Lets take two fields as field A and Field B.
Based on the input given to field A, field B will be mandatory. So if Field B is not entered then it should show error message. Its working fine. but after displaying error message, the cursor should be in field B. but the cursor is in field A.
So how should i code it to set the cursor in Field B?
the order of the fields in screen is First field A then Field B.
can someone help me in this...
Regards,
Amal
2007 Aug 29 7:26 PM
2007 Aug 29 7:34 PM
But im doing validation in PAI. the actual senario is,
<b>if the value for field A = 'NJ' then field B should be mandatory. and if the value for Field A = 'CA' then field C should be mandatory.</b>
<b>below is the code :</b>
*Set Company or CA License as mandatory based on ZSATATE
chain.
field vbap-zcomp.
field vbap-zstate module ZZCOMP_MANDATORY on input.
endchain.
chain.
field vbap-zcalic.
field vbap-zstate module ZZCALIC_MANDATORY on input.
endchain.
&----
*& Module ZZCOMP_MANDATORY INPUT
&----
Set Company field as mandatory if state is NJ *
----
module ZZCOMP_MANDATORY input.
if vbap-zstate = 'NJ'.
if vbap-zcomp is initial.
message e111(ZMOD).
endif.
endif.
endmodule. " ZZCOMP_MANDATORY INPUT
*} INSERT
*{ INSERT DEVK938515 5
&----
*& Module ZZCALIC_MANDATORY INPUT
&----
Set CA License as mandatory if state is CA *
----
module ZZCALIC_MANDATORY input.
if vbap-zstate = 'CA'.
if vbap-zcalic is initial.
message e112(ZMOD).
endif.
endif.
endmodule. " ZZCALIC_MANDATORY INPUT
now the curosr is at ZSTATE but it should be in ZCOMP or ZCALIC based on the input given to ZSTATE.
Plz help me its very urgent.
Regards,
Amal.
2007 Aug 29 7:30 PM
Hi Amal,
In the PAI, check for the value of field 'A' and set a flag if 'B' is to be made mandatory and the curspor to be put there.
In the PBO, check for this flag..
If flag is checked, LOOP AT SCREEN.
IF screen-name = 'B' (Field name).
screen-mandatory(required) = 1.
MODIFY screen.
ENDIF.
ENDLOOP.
SET SURSOR field 'B'.
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |