Application Development 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: 

problem with the logic to retrieve the data based on what user enters

Former Member
0 Kudos
81

Hi all,

I have an internal table with the below fields:

Name

number

City

I did a select statement from the database table and filled my table with the data for the above fields. Now the user can also enter all the above fields using a selection screen and based on the user input I need to fetch the data and for this I have written the below code:

Loop at it_table into wa_table.

if wa_table-number = v_number and wa_table-name = v_name and wa_data-city = v_city.

write: v_number, v_name, v_city

endif.

endloop.

Now if user enters all these fields on the selection my logic works fine and it shows the correct data but let's say if user enters only name and no number and city then my logic is not working fine, ideally it should look into the internal table for all the entries with the name user entered, instead it doesn't find anything.

Can you please let me know what I am doing wrong here?

1 REPLY 1

Former Member
0 Kudos
53

Rahul Goel wrote:

Can you please let me know what I am doing wrong here?

You really didn't look at your logic closely enough.

Basic question locked.

Rob