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

Select Options Error

Former Member
0 Likes
626

Hi,

I have one requirement with select options.

I am trying to read the select option values in one Subroutine, but it is giving error

" No structure found with S_KUNNR and no value LOW'.

code is like this.

*********************************

selection-screen S_KUNNR FOR VBPA-KUNNR.

INCLUDE FORM.

PERFORM SUB_DISPLAY.

"

"

"

FORM SUB_DISPLAY.

KUNNRLOW = S_KUNNR-LOW.

KUNNRHIGH = S_KUNNR-HIGH.

ENDFORM.

i am not getting data from S_KUNNR-LOW TO KUNNRLOW.

Please answer asap..

Thanks in Advance.

Kumar A.

6 REPLIES 6
Read only

Clemenss
Active Contributor
0 Likes
567

Hi anil,

if you have a requirement with select-options then you should use select-options.

selection-screen S_KUNNR FOR VBPA-KUNNR

does not look like syntactically correct.

select-options S_KUNNR FOR VBPA-KUNNR.

is better.

And you must make sure that somethng has been entered.


FORM SUB_DISPLAY.
read table S_KUNNR[] index 1.
check sy-subrc = 0-
KUNNRLOW = S_KUNNR-LOW.
KUNNRHIGH = S_KUNNR-HIGH.

Regards,

Clemens

Read only

Former Member
0 Likes
567

Hi,

It should be SELECT-OPTIONS and not selection screen.

Sri

Read only

Former Member
0 Likes
567

Hi,

First of all as mentioned in the earlier replies, it should select-options, not selection-screen.

As far as reading data is concerned, the event where you are trying to read data is important.

If you are trying to retrieve value in the event "AT SELECTION-SCREEN", definitely you will get the value.

If you are trying in the events such as "ON VALUE-REQUEST", you have to use DYNPREAD to retrieve data from the selection screen fields, otherwise the values will be initial.

Regards,

Hema

Read only

Former Member
0 Likes
567

Hi Anil,

Check the below code.

data v_num(3) type n.

select-options: s_num for v_num.

if s_num-low is initial and

s_num-high is initial.

s_num-low = 1.

s_num-high = 5.

elseif s_num-high is initial.

s_num-high = s_num-low.

elseif s_num-low is initial.

s_num-low = s_num-high.

endif.

while s_num-low le s_num-high.

perform my_num using s_num-low.

s_num-low = s_num-low + 1.

endwhile.

form my_num using p_num.

write:/ p_num.

endform.

Message was edited by:

Velangini Showry Maria Kumar Bandanadham

Read only

kanthimathikris
Advisor
Advisor
0 Likes
567

It should be,

data : v_kunnr type VBPA-KUNNR.

select-options S_KUNNR FOR v_kunnr .

Read only

Clemenss
Active Contributor
0 Likes
567

Hi anil,

I'm convinced you already found the solution. Everybody will be delighted if you mark this question as solved and let people know the solution.

Regards,

Clemens