‎2009 Mar 12 1:04 PM
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
‎2009 Mar 12 1:11 PM
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.
‎2009 Mar 12 1:11 PM
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.
‎2009 Mar 12 1:20 PM
‎2009 Mar 12 1:24 PM
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
‎2009 Mar 12 1:24 PM
go for SELECT..END SELECT and sue upto 1 rows clause in selct, it will work.
‎2009 Mar 12 1:25 PM
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.
‎2009 Mar 12 1:33 PM
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