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: 

Select is not working

Former Member
0 Kudos

Hi Experts,

I am trying to fetch the data with select options, data is not getting fetched because the table column space in the end so even in the standard ALV selection of the table I need to put the star in the end of the selection.

Same I tried here with CP and adding star in the end of the range but no luck can you try and suggest it.

code is like below.

TYPES: BEGIN OF ls_range,

           SIGN(1),

           OPTION(2),

           LOW(30) TYPE C,

           HIGH(30) TYPE C,

         END OF ls_range.

  DATA:  ls_r_group_value TYPE TABLE OF ls_range,

         ls_wa_group_value LIKE LINE OF ls_r_group_value.

LOOP AT p_it_conversion ASSIGNING <fs_conversion>.

      ls_wa_group_value-sign   = gc_rng_sign_include.

      ls_wa_group_value-option = gc_rng_opt_equal.  here I tried equal and CP both

      CONCATENATE <fs_conversion>-old_value '*' INTO <fs_conversion>-old_value.

      SHIFT <fs_conversion>-old_value RIGHT DELETING TRAILING ''.

      SHIFT <fs_conversion>-old_value LEFT DELETING LEADING ''.

      ls_wa_group_value-low = <fs_conversion>-old_value.

      ls_wa_group_value-high = ''.

      APPEND ls_wa_group_value TO ls_r_group_value.

    ENDLOOP.

    SELECT dashboard_id period kpi_id group1_value group2_value group3_value SUM( DATA_1 ) SUM( DATA_2 ) SUM( DATA_3 ) SUM( DATA_4 )

      FROM /kpi

      INTO TABLE lt_t_/kpi

      WHERE dashboard_id  = p_iv_dashboard_id AND hier_node IN ls_r_group_value

      GROUP BY dashboard_id period kpi_id group1_value group2_value group3_value.

32 REPLIES 32

brice_lagaly
Participant
0 Kudos

Hello Mangilal,

When using wildcard character you must use option = CP anyway.

Could you please send a screenshot of ls_r_group_value variable content (in debug mode) at select statement and a screenshot of the lines (in SE16) you expect to get in table /kpi ?

Are you sure there is not conversion exit to execute (what you see in table is not what you get, matter of internal and external value). In SE16 you can't activate and deactivate conversion exits to check.

Regards

0 Kudos

Hi Brice,

Please find the attached screenshots.

There is no conversion routine, its a direct FM to update the table data.

0 Kudos

Hello Mangilal,

You have an issue with lower case characters.

Your range must be based on data element that allows lower case.

You must also check the field from which you copy the value.

"Development" <> "DEVELOPMENT"

Regards

0 Kudos

Hi Brice,

Values are same as in table because I copied and pasted and also this same range is working for 3 other columns.

In debugging only its showing in capitals, but same working fine for other select only column in where is different rest all is same.

I think there is some issue with column value, because while i even display the value by SE16 i need to keep * in the end of the hierarchy data column filter, else no values are displayed.

0 Kudos

Spaces in front of values ?

0 Kudos

no space as used right and left both functions to remove it.

ipravir
Active Contributor
0 Kudos

Hi Mangilal,

Can you declare the range table using RANGES data type.

Like:

Ranges: ls_r_group_value FOR /kpi-hier_node.

And then try.

Regards,

Praveer.

Former Member
0 Kudos

Hi Praveer,

Unfortunately this is not working

Former Member
0 Kudos

Hi Mangilal,

Try to declare your range like this:

DATA: ls_r_group_value TYPE RANGE OF /kpi-hier_node WITH HEADER LINE.

Best Regards.

Benjamin

matt
Active Contributor
0 Kudos

Header lines are obsolete and bad practice programming. Define separate work areas instead.

matt
Active Contributor
0 Kudos

Even so, you should use this form rather than defining the structure yourself.

0 Kudos

RANGES is obsolete now, use


DATA:  ls_r_group_value TYPE RANGE OF char30. " or text30 if lowercase

Did you check for conversion-exit associated with field domain?

Regards,

Raymond

matt
Active Contributor
0 Kudos

What is the domain of the field in the table?

Former Member
0 Kudos

Raymond,

its not working

0 Kudos

and for the second question?

Also another question, did some not-standard program insert some records in the database table.

Hint: In case of not respected conversion-exit and use of open SQL insert/update/modify statement, some program(-er )s are able to mess the database table, e.g. writing '1234____' (_ for space) in a character field doesn't trigger any database error, but if the field carry an ALPHA conversion exit you will never be able to select it from database with some correct input criteria that will be converted to  '00001234'

Regards,

Raymond

Former Member
0 Kudos

Hi Raymond,

Yes, there is a customized program which pickup the excel file values and insert into database table.

Is that can be reason for this?

Former Member
0 Kudos

Option "CP" is fine for wildcard characters. "EQ" will not work

Did you check what value you are passing in p_iv_dashboard_id WHERE dashboard_id  = p_iv_dashboard_id?

0 Kudos

This message was moderated.

Former Member
0 Kudos

guys,

Let me explain one more thing, This is something with data of that column I mean how system is interpreting...because if I select from normal SE16 even need to keep * in the end of the filter value.

Please share if someone faced such strange issue.

matt
Active Contributor
0 Kudos

When you run in debug, what does the range table contain?

Former Member
0 Kudos

HI Mathew,

see my attached screenshot, I attached the range table values.

Former Member
0 Kudos

Hi All,

Please see the attached screenshots for normal SE16 selection screen where I need to put *, then suggest it accordingly. I think this is the reason why data is not getting selected.

selection screen with column value.

No Data

Put * in the end of selection value

Values are displayed.

0 Kudos

This message was moderated.

0 Kudos

This message was moderated.

Jelena
Active Contributor
0 Kudos

Mangilal, as a first step try adding this as selection option. Then in the debugger you'll see the exact content of the selection table - this will help you understand how the range table should be filled in.

Then (if it can't be selection criteria), add a definition for range table (look up RANGE in ABAP Help, it even has an example). Fill it in based on your previous research with the selection option. Naturally, you'll need to use WHERE ... IN ... not  WHERE ... = ... with range table, just as with the selection option.

If it still does not get the desired result, post the exact code (including all definitions) and debugger screenshot showing the range table values.

Overall this is not a rocket science - just see how it works with selection options and do the same with range, pretty much. I don't know what's the deal with the values in SE16, but whichever way they're stored that's how they also need to be retrieved. Try running SE16 with conversion exit off, maybe there is some conversion routine and "what you see is not what you get".

matt
Active Contributor
0 Kudos

This is my guess. However, he still hasn't answered the basic question: what is the domain of the field in the table?

Former Member
0 Kudos

Hi Matthew,

I checked through se11 table definition for this field there is no domain, its showing as predefined type char 30..

Please let me know if i am looking at wrong place.

Former Member
0 Kudos

Hi Jelena,

Same range is working for same select just this column is not added in where.....so problem with column values somewhere.

Former Member
0 Kudos

Dear Mangilal,

Can you give the type of <fs_conversion>-old_value and the content of the field ?

Regards,

Hans

Former Member
0 Kudos

Hi all,

Just for information the same range is working for other three columns, I am using other three select with same range same selection, just in where the one column name is change, So this is something not correct with column....

I am suspecting the Raymond one issue...

Juwin
Active Contributor
0 Kudos

First of all, check if the domain you have used for the table field can accept lowercase letters. If lowercase letters are not allowed in domain, then the database table field shouldn't be stored with lowercase values.

Secondly, ranges are case sensitive. So, if your database field has lowercase values, then your range also should have lowercase values.

If you checked both of these and still you are facing issues with select, then....

I had faced similar issues before and the issue was with the whitespace character inside the field.

White space is just not just one character that you normally get when you hit spacebar on the keyboard. There are many more whitespace characters used in many applications.

Normal spacebar is U+0020. With that at the end of "ABC", the text looks like "ABC ".

Another whitespace is U+00A0. With that at the end of "ABC", the text looks like "ABC ".


To try it yourself, goto link, and paste the following code

<!DOCTYPE html><html><body>

<p>I will display &#x00A0;<p>

<p>I will display &#x0020;<p>

</body></html>


As you can see, both these texts look alike, but they are not equal. This is what is happening when you use I EQ condition in your range. When you build your range with I EQ ABC as value, the texts with special whitespace character at the end, doesn't get selected. But, when you build your range with I CP ABC* as value, those texts with special characters also get selected.


To check if the text inside the database table has any special characters at the end, you will have to view that text in hexadecimal format, which is possible through ABAP debugger.


Thanks,

Juwin Thomas

pranay570708
Active Contributor
0 Kudos

Hi Mangilal,

Try this.

SHIFT <fs_conversion>-old_value LEFT DELETING LEADING  space.


use space instead of  ".