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

Selection-screen problems

former_member797394
Participant
0 Likes
1,074

Hello everyone.

I need to add a field in a selection-screen, so that users would be able to search data with the help of market. Markets are classified as K001, K002, K003 ... Kn. So, if a user enters K001, information only on that particular market should be displayed.

I have written all neccessary code, but I do not why it does not work. I will provide screenshots and some peace of code. If anything else needed, I will therefor provide.

SELECT wlk1~* INTO TABLE @i_wlk1 FROM wlk1 JOIN wrsz ON wlk1~filia EQ wrsz~asort
WHERE filia EQ @wlk1-filia
AND wlk1~datbi GE @datum_rc
AND wlk1~datbi LE @max_datum
AND quell EQ '3'
AND wrsz~locnr IN @p_locnr
AND wlk1~artnr IN @p_artnr.

SELECT SINGLE locnr INTO <fs_output>-locnr FROM wrsz WHERE asort EQ <fs_output>-filia AND datbi GE sy-datum.

wrsz~locnr is the table~field that keeps neccessary data.

Hope I was clear.

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
991

Your code does not guarantee that the same assortment record is checked in the first and second select statements:

  • wrsz~datbi is not checked in the first selection
  • wrsz~locnr is not checked in the second selection

Could you consider using a single select statement to build the displayed internal table

Read only

0 Likes
991

I got your point. How can I write all this in one select? can you help me with this? if you need more of my code, I will provide it.

Thank you before-hand.

Read only

0 Likes
991

Either move fields of both joined table into the internal table, or adapt the second select to use same where criteria thant in the first join.