11-07-2008 10:44 PM
Hi All,
I am facing a problem in retrieving a field value from a table.
I am getting matnr and lifnr from a flat file and through conversion_exit_alpha_input i am converting the fields in to sap input format and based upon the both the fields i hava to retrieve the INFNR field from EINA table. andi have coded like this.
select single infnr
from eina
into lv_infnr
where matnr eq l_matnr and
lifnr eq l_lifnr.
.
if i placed the same values in the through se11 in table EINA i am able to retrieve the values.
Can any one throiw some light on this???
Thanks
11-07-2008 10:53 PM
For the material, you should use FM CONVERSION_EXIT_MATN1_INPUT not conversion_exit_alpha_input
Rob
11-07-2008 10:52 PM
Here is my values for my Matnr = 160-0448-01_NEW_01 and
lifnr = 34407.
I have used conversion_exit_alpha_input befor passing this fields to my select query.
Thanks
11-07-2008 11:08 PM
Hi,
You are using the wrong conversion exit routine. Remember as a thumb rule, you should always use the conversion exit that is attached to the data element of the table field.
regards,
Advait
11-07-2008 11:17 PM
Hi
I Have done like this.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = l_matnr
IMPORTING
output = l_matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_LIFNR
IMPORTING
output = l_LIFNR.
SELECT SINGLE INFNR
FROM EINA
INTO LV_INFNR
WHERE MATNR EQ L_MATNR AND
LIFNR EQ L_LIFNR.
If i give the same values in the table through se11 i am able to c the output.
But even through the above code i am unable to get the infnr value from eina.
Any more suggestions plz.
Thanks.
11-07-2008 11:19 PM
That should work. Are you sure you haven't confused the hyphens and underscores (_) in the material?
Rob
11-07-2008 11:25 PM
I just copy and paste the values which is coming in the debugging screeen,,and i am able to c the output in the field lv_infnr.
Any more suggestions please.
Thanks
11-07-2008 11:35 PM
I tested this code and it works:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
TABLES: eina.
PARAMETERS: l_matnr LIKE eina-matnr DEFAULT 'MMMMMMM',
l_lifnr LIKE eina-lifnr DEFAULT '111111'.
DATA lv_infnr TYPE eina-infnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = l_matnr
IMPORTING
output = l_matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_lifnr
IMPORTING
output = l_lifnr.
SELECT SINGLE infnr
FROM eina
INTO lv_infnr
WHERE matnr EQ l_matnr AND
lifnr EQ l_lifnr.
The error must be elsewhere. Are you sure you haven't swapped the values for vendor and material.
Rob
11-07-2008 11:38 PM
I just copy and paste the values which is coming in the debugging screeen,,and i am able to c the output in the field lv_infnr.
I hope you mean you are not able to see output in field lv_infnr. if not then where is the problem ?
What are the values in lv_matnr and lv_lifnr after you run the conversion exits ? Check if those are correct.
regards,
Advait
11-08-2008 12:01 AM
Hi
Intially before running the conversion routine its like this matnr :160-0448-01_New_02 and after that its like matnr:160-0448-01_New_02. and in case of lifnr :404038 and after that its like 0000404038.
select single infnr
from eina
into lv_infnr
where matnr = p_l_matnr and
lifnr = p_l_lifnr.
After this i am not getting any values in lv_infnr.
but through se11 i am able to c the values like 5300004896.
Any suggestions please.
11-08-2008 12:10 AM
Hi Rob
I executed the same report with my default values here its is
13 TABLES: eina.
14
15 PARAMETERS: l_matnr LIKE eina-matnr DEFAULT '160-0448-01_New_02',
16 l_lifnr LIKE eina-lifnr DEFAULT '404038'.
17
18 DATA lv_infnr TYPE eina-infnr.
19
20 CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
21 EXPORTING
22 input = l_matnr
23 IMPORTING
24 output = l_matnr.
25
26 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
27 EXPORTING
28 input = l_lifnr
29 IMPORTING
30 output = l_lifnr.
31
32 SELECT SINGLE infnr
33 FROM eina
34 INTO lv_infnr
35 WHERE matnr EQ l_matnr AND
36 lifnr EQ l_lifnr.
37
38
39 WRITE :LV_INFNR.
and the lv_infnr value is blank.
Any more ideas please.
Thanks
11-08-2008 12:22 AM
11-08-2008 2:55 AM
first check in table eina wheather lifnr is having leading zeros are not...
other wise is debugging mode change the lifnr value(remove leading zeros before passing it to select query)
SELECT SINGLE infnr
33 FROM eina
34 INTO lv_infnr
35 WHERE matnr EQ l_matnr AND
36 lifnr EQ l_lifnr.
11-08-2008 4:51 AM
TABLES: eina.
PARAMETERS: l_matnr LIKE eina-matnr DEFAULT '160-0448-01_New_02',
l_lifnr LIKE eina-lifnr DEFAULT '404038'.
DATA lv_infnr TYPE eina-infnr.
DATA : LV_MATNR(18),
LV_LIFNR(10).
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = l_matnr
IMPORTING
output = LV_MATNR.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_lifnr
IMPORTING
output = LV_LIFNR.
SELECT SINGLE infnr
FROM eina
INTO lv_infnr
WHERE matnr EQ LV_MATNR AND
lifnr EQ LV_LIFNR.
WRITE :LV_INFNR.
11-09-2008 7:23 PM
As I said before, the code is correct. You have a problem with case-sensitivity. Rather than '160-0448-01_New_02', use '160-0448-01_NEW_02'.
Rob
11-10-2008 3:33 AM
11-10-2008 7:55 PM
Hi Rob,
I tried as u said,But still its not working.Actually i am creating the inforecord through BDC and i am able to see it in the data base through se11 and after that only i am trying it through select query.
CALL FUNCTION 'ZM_CREATE_PURCHASE_INFOREC'
EXPORTING
matnr = p_l_matnr
lifnr = p_l_lifnr
ekorg = p_l_ekorg
werks = p_l_plant
netpr = p_l_netpr
idnlf = p_l_idnlf
wglif = p_l_wglif
TABLES
error_tab = it_return.
WAIT UP TO 5 SECONDS.
translate p_l_matnr to upper case.
select single infnr
from eina
into lv_fname
where matnr eq p_l_matnr and
infnr eq p_l_lifnr.
But after this also my lv_fname is null..
Any thing i have consider about the buffer??
Any more suggestions please??
11-10-2008 8:35 PM
11-07-2008 10:53 PM
For the material, you should use FM CONVERSION_EXIT_MATN1_INPUT not conversion_exit_alpha_input
Rob