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

At Selection -screen problem

Former Member
0 Likes
881

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

8 REPLIES 8
Read only

Former Member
0 Likes
854

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.

Read only

0 Likes
854

Hi Naveed,

it is nt working any other alternative , please suggest .

regards,

Ry

Read only

0 Likes
854

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,

Read only

0 Likes
854

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.

.

Read only

Former Member
0 Likes
854

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.

Read only

0 Likes
854

Hi Vijay,

this solution is not working . any alternative .

Read only

Former Member
0 Likes
854

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

Read only

0 Likes
854

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.

.