‎2008 Aug 18 11:30 PM
HI,
I have five fields on the selction -screen.
ex : A1
A2
A3
A4
A5.
when i enter an invalid entry in A3 it is displaying error message and the cursor is placed in A1.
but if i enter an invalid entry on A4 the cursor stays in A4 itself .
why is this happening , why doesn't the cursor stay in A3 . Please suggest . Thanks in advance .
Regards,
Ry
‎2008 Aug 19 12:31 AM
just try with this
hope ur taking the field from check table in the select query when ur validating (selection screen validation).
also check with at selection on field.
‎2008 Aug 19 2:11 AM
Hi Naveed,
it is nt working any other alternative , please suggest .
regards,
Ry
‎2008 Aug 19 3:29 AM
Try like this,
create the select-options in selection-blocks, and validate them in AT SELECTION-SCREEN on BLOCK event.
Can u paste ur selection screen code,
‎2008 Aug 19 3:56 AM
Hi,
Here is the code : please suggest
selection-screen begin of block XYZ with frame title -001.
select-options : p_org for eban-ekorg , " POrg
p_lnt for t001w-werks , " Plant
d_typ for eban-bsart, " Purch Document Type
e_grp for eban-ekgrp , " Purch Grp
d_ipo for t024d-dispo. MRP controller
selection-screen end of block XYZ.
at selection-screen on p_org.
perform p_org.
at selection-screen on d_typ.
perform d_type.
at selection-screen on e_grp.
perform p_grp.
at selection-screen on p_lnt.
perform p_lnt.
at selection-screen on d_ipo.
perform d_ipo.
form p_org.
data : ekorg type t024e-ekorg.
if p_org-low is not initial and p_org-high is initial.
select single ekorg from t024e into ekorg where ekorg = p_org-low.
if sy-subrc ne 0.
message e000 .
endif.
endif.
endform.
form d_typ.
data : bsart type t161-bsart.
if d_typ-low is not initial and d_typ-high is initial.
select single bsart from t161 into bsart where bsart = d_typ-low.
if sy-subrc ne 0.
message e000.
endif.
endif.
ENDFORM.
form p_grp.
data : ekgrp type t024-ekgrp.
if e_grp-low is not initial and e_grp-high is initial.
select single ekgrp from t024 into ekgrp where ekgrp = e_grp-low.
if sy-subrc ne 0.
message e000 with e_grp-low .
endif.
endif.
ENDFORM.
form p_lnt.
data : werks type t001w-werks,
ekorg type t024e_ekorg.
if p_lnt-low is not initial and p_lnt-high is initial.
select single werks from t001w into werks where werks in p_lnt.
if sy-subrc ne 0.
message e000.
endif.
endif.
ENDFORM.
FORM d_ipo .
data : werks type t024d-werks,
dispo type t024d-dispo.
if d_ipo-low is not initial and d_ipo-high is initial.
select single dispo from t024d into dispo where dispo = d_ipo-low.
if sy-subrc ne 0.
message e000 .
endif.
endif.
ENDFORM.
.
‎2008 Aug 19 4:30 AM
if you use SET CURSOR , your problem will be solved.
check it once.
REPORT ZTEST_VALID.
parameters: p1(10),
p2(10),
p3(10).
at selection-screen.
if p1 ne '1234'.
set cursor field 'P1'.
message 'Enter 1234' type 'E'.
endif.
if p2 ne '1234'.
set cursor field 'P2'.
message 'Enter 1234' type 'E'.
endif.
if p3 ne '1234'.
set cursor field 'P3'.
message 'Enter 1234' type 'E'.
endif.
‎2008 Aug 19 4:44 AM
‎2008 Aug 19 5:10 AM
> when i enter an invalid entry in A3 it is displaying error message and the cursor is placed in A1.
> but if i enter an invalid entry on A4 the cursor stays in A4 itself .
>
> why is this happening , why doesn't the cursor stay in A3 . Please suggest .
i made small modification,
this is exactly doing what you want...check it once.
REPORT ZTEST_VALID
parameters: p1(10),
p2(10),
p3(10).
at selection-screen.
if p1 is not initial.
if p1 ne '1234'.
set cursor field 'P1'.
message 'Enter 1234' type 'E'.
endif.
endif.
if p2 is not initial.
if p2 ne '1234'.
set cursor field 'P2'.
message 'Enter 1234' type 'E'.
endif.
endif.
if p3 is not initial.
if p3 ne '1234'.
set cursor field 'P3'.
message 'Enter 1234' type 'E'.
endif.
endif.
‎2008 Aug 19 4:08 PM
Hi Vijay,
Thanks for that , your code works . but with the set cursor concept you suggested , if i go with my type of code , it is not working .
can you please look at it and suggest . thanks in advance .
selection-screen begin of block XYZ with frame title -001.
select-options : p_org for eban-ekorg , " POrg
p_lnt for t001w-werks , " Plant
d_typ for eban-bsart, " Purch Document Type
e_grp for eban-ekgrp , " Purch Grp
d_ipo for t024d-dispo. MRP controller
selection-screen end of block XYZ.
at selection-screen on p_org.
perform p_org.
at selection-screen on d_typ.
perform d_type.
at selection-screen on e_grp.
perform p_grp.
at selection-screen on p_lnt.
perform p_lnt.
at selection-screen on d_ipo.
perform d_ipo.
form p_org.
data : ekorg type t024e-ekorg.
if p_org-low is not initial and p_org-high is initial.
select single ekorg from t024e into ekorg where ekorg = p_org-low.
if sy-subrc ne 0.
message e000 .
endif.
endif.
endform.
form d_typ.
data : bsart type t161-bsart.
if d_typ-low is not initial and d_typ-high is initial.
select single bsart from t161 into bsart where bsart = d_typ-low.
if sy-subrc ne 0.
message e000.
endif.
endif.
ENDFORM.
form p_grp.
data : ekgrp type t024-ekgrp.
if e_grp-low is not initial and e_grp-high is initial.
select single ekgrp from t024 into ekgrp where ekgrp = e_grp-low.
if sy-subrc ne 0.
message e000 with e_grp-low .
endif.
endif.
ENDFORM.
form p_lnt.
data : werks type t001w-werks,
ekorg type t024e_ekorg.
if p_lnt-low is not initial and p_lnt-high is initial.
select single werks from t001w into werks where werks in p_lnt.
if sy-subrc ne 0.
message e000.
endif.
endif.
ENDFORM.
FORM d_ipo .
data : werks type t024d-werks,
dispo type t024d-dispo.
if d_ipo-low is not initial and d_ipo-high is initial.
select single dispo from t024d into dispo where dispo = d_ipo-low.
if sy-subrc ne 0.
message e000 .
endif.
endif.
ENDFORM.
.