cancel
Showing results for 
Search instead for 
Did you mean: 

Select Option dump

Former Member
0 Kudos

Hi,

I was following the blog /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application

It works find when the values are entered in the fields of select options. But when these fields are empty

I get dump in the select statement as "Field Symbols has not yet been assigned".

select * into corresponding fields of table isflight from sflight

where carrid in <fs_carrid>

and connid in <fs_connid>.

Is there any procedure to use the select statement other than passing it to field symbols.?

Thanks in advance,

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

I was going through the this article [select options and alv|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60811d03-b69e-2b10-cd86-ad2790e44ecc] and I noticed that if we don't give any value in the select options, still we are getting the output. Infact all the data is being fetched. I think you should go through this article and look for the method named GET_DATA.

I hope it helps.

Regards

Arjun

Answers (2)

Answers (2)

Former Member
0 Kudos

Resolved on my own

Former Member
0 Kudos

Hello,

This occurs because in the blog the field-symbols retrieves the related range tables. If these tables are empty (the user don't enter any value in the field) these tables doesn't can be referenced.

As this blog is a tutorial I suggest you to try to "optimize" it doing some verifications as the following:


if <fs_carrid> is assigned and <fs_connid> is assigned.
  select * into corresponding fields of table isflight from sflight
    where carrid in <fs_carrid>
    and connid in <fs_connid>.
else.
* JUST FOR TEST PURPOSES!
  select * into corresponding fields of table isflight from sflight.
endif.

The best approach is that when nothing is entered in the select-options, the user should be alerted with a message and have choice to select all records or none (a simple pop up with an yes/no option), for example.

You can get help on how to show a pop up in the following article [Quick tips and tricks on Web Dynpro for ABAP u2013 How to use ALV and Pop ups|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4].

Regards.

Former Member
0 Kudos

thanks David.

In my case I have 8 fields for the selection criteria. all of them are optional. As per your suggestion i need to check field symbol is assigned or not. Yes i did it. But my question is that does not solve my issue because user can fill any of the 8 fields. So my select statement should change based on the field he has entered?

Do i need to create dynamic where clause??

Thanks in advance

Former Member
0 Kudos

Hello

Edited by: David Pietroniro on Mar 6, 2009 9:09 AM