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 Query : Weird Issue

Former Member
0 Likes
1,076

Hi Experts,

I am getting one weird issue.

The problem is that I'm trying to fetch the data from one table based on non-primary key. I wanted only to select single field from that table.

In frontend if I try to see the data in table say T1. But in debugging mode I'm getting sy-subrc as 4.

The sample query is as follows:

TABLE: T1,

Required Field: F1

Local variable: lv_var

Non-primary key = Fn.

For value : seg_value-f2. This field is same as type of T1-Fn.

select F1 from T1 into lv_var where Fn = seg_value-f2.

Let me suggest.

Regards,

Neha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
968

Please use conversion routine to convert the value of field "seg_value-f2' .

You can refer to table definition of T1-> Field Fn-> Data Element->Domain->Conversion Routine.

There is data type mismatch so row is not selected.

6 REPLIES 6
Read only

Former Member
0 Likes
969

Please use conversion routine to convert the value of field "seg_value-f2' .

You can refer to table definition of T1-> Field Fn-> Data Element->Domain->Conversion Routine.

There is data type mismatch so row is not selected.

Read only

Former Member
0 Likes
968

Hi,

is lv_var is of type F1 of the table T1.

Regards,

Siddarth

Read only

Former Member
0 Likes
968

It has to be internal converison problem , an example to this is the partners in SAP.

If you look at the table VBPA for different partners like sold to , ship to etc ...SH, WE , RE etc becomes different values internally.

This difference you can notice in SE11 itself, while displaying the table entries you notice the value and when you double click on one record ,in the next screen you will see the internal value

If you mention the fieldname you are having problems , then you will get the converison function modules also.

Mathews

Read only

Former Member
0 Likes
968

go for SELECT..END SELECT and sue upto 1 rows clause in selct, it will work.

Read only

vishal_sharda2
Participant
0 Likes
968

Hi Neha,

Use converiosn routine for non-primary key Fn.

You can check the conversion routine by checkind the domain of field Fn in table T1.

Regards,

Vishal.

Read only

Former Member
0 Likes
968

Use conversion routine for that field 'seg_value-f2' before writing it into where clause.

Go to domain of the field 'seg_value-f2'. And you can seeconv routine. Double click on it. And use the listed FM to convert the 'seg_value-f2' field to acceptable format.

e.g. for material (MATNR), we use conv routine as CONVERSION_EXIT_MATN1_INPUT. Here we pass matnr as input and get conerted matnr as output and then we can use it ion select query.

Regards,

Sachin