‎2009 Jan 12 4:44 PM
Hi,
I have created simple report and in start-of-selection i have writen select statement with bukrs and lifnr as parameters. But i am unable to execute the query.
find the code
start-of-selection.
select bukrs
lifnr
name1
name2
name3
from zapv_names
into table it_zapv
where bukrs = p_bukrs
and lifnr = p_lifnr.
I am not under stand why it is not working. The code is correct. I have taken names as zname field and others are standered data elements.
Thanks,
RamuV
‎2009 Jan 12 4:47 PM
Hi
Try to check if your query can be done succeffully by trx SE16
Max
‎2009 Jan 12 4:47 PM
What is not working?
1. Don't you get any data at all?
2. Do you get a short dump?
3. etc?
‎2009 Jan 12 4:50 PM
Hi,
As a precaution instead of INTO TABLE IT... Use INTO CORRESPONDING FIELDS OF TABLE..
Please tell what the error is if it still does not help.
Also cross check if p_bukrs and p_lifnr are with valid values or not and that for the combination data exists..
Since you ae using parameters with '=' ensure you are passing some values in these two.
Edited by: Ankesh on Jan 12, 2009 10:22 PM
‎2009 Jan 12 4:51 PM
Hi,
check wheter you passing the P_bukrs & p_lifnr values to the select statment & the dat should exist in the table with conbination of values passed.
‎2009 Jan 12 4:53 PM
> start-of-selection.
>
> select bukrs
> lifnr
> name1
> name2
> name3
> from zapv_names
> into table it_zapv
> where bukrs = p_bukrs
> and lifnr = p_lifnr.
First of all does ur table have data in the client ur executing ur report?
secondly it_zapv contains onlly field tht u have mentioned in it_zapv or it contains more if it contains more then use "into corresponding fields of table"
put a break point above the select and then check what point the execution is stopping at the select and are the params already been populated at tht time.
‎2009 Jan 12 5:01 PM
hi,
check wether the fields ur using in the select statement is in the order u have defined in the internal table...
‎2009 Jan 12 5:22 PM
I'm going to take a wild guess that since you show this to be the first statement
after the START-OF-SELECTION line, that is is coming from a report program
where the two field you are testing for are actually RANGEs on the selection screen.
select bukrs
lifnr
name1
name2
name3
from zapv_names
into table it_zapv
where bukrs = p_bukrs " This is likely a RANGE
and lifnr = p_lifnr. " This is likely a RANGE
Change them to this
select bukrs
lifnr
name1
name2
name3
from zapv_names
into table it_zapv
where bukrs IN p_bukrs " This is likely a RANGE
and lifnr IN p_lifnr. " This is likely a RANGE
Ranges would be tables and have value like 'IEQ0101' where with the = sign would never be equal.
Edited by: Paul Chapman on Jan 12, 2009 12:23 PM
‎2009 Jan 12 5:26 PM
Hi,
1) first check whether the order you are fetching the fields in the same order you are declared fields in the internal table or else you can use into corresponding fileds of table instead of into table.
2) in the where condition you had used some like p_bukrs whether they are parameters or select-options
i don't know if they are select-options you should use in instead of ' =' after where in your select query like
ex :
select f1
f2
f3
from tab1
into table itab
where bukrs in p_bukrs.
Thanks & Regards,
Sateesh.
‎2009 Jan 13 7:20 AM
Hi ,
Write your query like this :
tables : zapv_names . "declare by tables statement .
select bukrs
lifnr
name1
name2
name3
from zapv_names
into corresponding fields of table it_zapv
where bukrs = p_bukrs
and lifnr = p_lifnr.
if again not work than check the data is available in database for the given company code and vendor .
it wil work definately .
Regards ,
Nilesh Jain .
‎2009 Jan 13 7:29 AM
Hi,
First check the table zapv_names whether the datas are there for the given input or not.
I think this will solve ur problem.
Thanks.