2014 Feb 07 1:38 PM
Hi guys,
trying to write select query on database view ( COAS) to fetch the "objnr" value which is existing. But i'm failing to get it.
sharing my code below
SELECT SINGLE objnr FROM coas INTO lv_objnr WHERE aufnr = "lv_aufnr. " lv_aufnr is having value
I've tried like following also
SELECT * FROM coas INTO CORRESPONDING FIELDS OF TABLE it_coas WHERE aufnr = lv_aufnr.
can anybody please help me out in this.
Thanks in Advance.
Regards
satish
2014 Feb 07 1:48 PM
Hi,
How you have declared lv_aufnr and what value you are pass into it. It might be some leading zeros missing.
Ex:- For 1000, try to provide '000000001000'.
Thanks & Regards
Bala Krishna
2014 Feb 07 2:22 PM
Hi bala krishna,
I've declared lv_aufnr as data: lv_aufnr TYPE aufnr. (order no)
lv_aufnr is having the value like 500020. there are no leading zero's and all.
thanks & Regards
satish
2014 Feb 07 2:26 PM
Hi,
It seems you have hard coded the value, just pass this value and see '000000500020'. Just check what is value shown in AUFK table, as COAS is database view on AUFY table.
You have to add leading zeros into lv_aufnr using conversion exits.
Thanks & Regards
Bala Krishna
2014 Feb 07 2:41 PM
Hi bala krishna,
Thanks a lot . My problem has been solved. I've concatenated zeros to aufnr value. now it's working.
Regards,
satish
2014 Feb 07 1:52 PM
Hi,
Try this function module.
'VIEW_GET_DATA'
Or try to use conversion exit for leading zeros in your select statement
Regards,
Karthik
2014 Feb 07 2:11 PM
Satish.
I don't think we can write a select query on a VIEW.
K.Kiran.
2014 Feb 07 2:14 PM
Hi Kiran,
It is a database view, so you can write select query on it.
Thanks & Regards
Bala Krishna
2014 Feb 07 2:20 PM
Hi Sathish,
its an conversion exit problem. we have to add leading zeros in front..
please use below function module it will resolve your problem.
let me know if facing same problem again.
Regards,
Thangam.P
2014 Feb 07 2:33 PM
hi thangam perumal,
in my case there are no leading zero's, i'm having the value straight away. like lv_aufnr = 500020.
same matching aufnr value is there in COAS . but data is not picking up.
Thanks & Regards
satish
2014 Feb 07 2:43 PM
Hi thangam p,
Your right,
Thanks a lot I've concatenated zeros to aufnr value. now it's working.
Thanks & Regards,
satish
2014 Feb 07 2:51 PM
Hi Sathish,
if you got solution for your query please mark it has correct answer or helpful answer because it will helps to someone who facing same problem. I hope you got what am saying .
Regards,
Thangam.P
2014 Feb 07 2:58 PM
hi satish,
kindly provide the exact coding and value of the field store in data base table so
that we help you in better way.
regards,
vikas
2014 Feb 07 3:09 PM
Hi guys,
Thanks a lot for your help and ideas. My issue has been resolved.
Regards
satish
2014 Feb 08 7:51 PM
Hi,
You can write exaclty the same kind of SQLs on a view that you can for a table.
BR,
Nathan