‎2007 Jun 11 4:46 PM
hello friends the following is my requirement:
data: begin of inbkpf occurs 0,
belnr type bkpf-belnr,
end of inbkpf,
wa_bkpf type bkpf.
data: incsks type standard table of csks,
wa_csks type csks.
select bukrs belnr gjahr buzei saknr shkzg
from bseg
into table innonbonus
where belnr in inbkpf and
kostl in incsks and
saknr like 'S8%' and
saknr in nonbonus.
when i run the above code it gives error:
The line structure of the table "INBKPF" is incorrect.
can some plz tell the way i can check for an entry in the internal table
with out looping all the internal tables.
can some one help plz.
‎2007 Jun 11 4:50 PM
You want FOR ALL ENTRIES in inbkpf.
And also include BUKRS and GJAHR.
Rob
Message was edited by:
Rob Burbank
‎2007 Jun 11 4:50 PM
You want FOR ALL ENTRIES in inbkpf.
And also include BUKRS and GJAHR.
Rob
Message was edited by:
Rob Burbank
‎2007 Jun 11 5:00 PM
Try:
SELECT bukrs belnr gjahr buzei saknr shkzg
FROM bseg
INTO TABLE innonbonus
FOR ALL ENTRIES IN inbkpf
WHERE bukrs EQ inbkpf-bukrs AND
belnr EQ inbkpf-belnr AND
gjahr EQ inbkpf-gjahr AND
kostl IN incsks AND
saknr LIKE 'S8%' AND
saknr IN nonbonus.
Rob
‎2007 Jun 11 4:51 PM
Hi,
Please try this.
data: begin of inbkpf occurs 0,
belnr type bkpf-belnr,
end of inbkpf,
wa_bkpf type bkpf.
data: incsks type standard table of csks,
wa_csks type csks.
ranges: r_kostl.
loop at incsks.
r_kostl-sign = 'I'.
r_kostl-option = 'EQ'.
r_kostl-low = incsks-kostl.
append r_kostl.
endloop.
sort r_kostl.
delete adjacent duplicate from r_kostl.
select bukrs belnr gjahr buzei saknr shkzg
from bseg
into table innonbonus
for all entries in inbkpf
where belnr in inbkpf-belnr and
kostl in r_kostl and
saknr like 'S8%' and
saknr in nonbonus.
Regards,
Ferry Lianto
‎2007 Jun 11 4:55 PM
Hello,
The problem in the select statement.
DO like this.
data: ra_belnr type range of belnr occurs 0 with header line.
loop at inbkpf.
ra_belnr-sign = 'I'.
ra_belnr-option = 'EQ'.
ra_belnr-low = 'inbkpf-belnr.
append ra_belnr
endloop.
select bukrs belnr gjahr buzei saknr shkzg
from bseg
into table innonbonus
where belnr in ra_belnr and " Check here.
kostl in incsks and
saknr like 'S8%' and
saknr in nonbonus.
or use like this.
select bukrs belnr gjahr buzei saknr shkzg
from bseg
into table innonbonus
for all entries in inbkpf " check here
where belnr in inbkpf-belnr and " Check here
kostl in incsks and
saknr like 'S8%' and
saknr in nonbonus.
Vasanth
‎2007 Jun 11 4:55 PM
Hi
Check ur internal table inbkpf structure with ur select select statement. Its should be in same format or else use corresponding option.
Regards
Ravi.