Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with internal table

Former Member
0 Likes
1,320

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
818

You want FOR ALL ENTRIES in inbkpf.

And also include BUKRS and GJAHR.

Rob

Message was edited by:

Rob Burbank

5 REPLIES 5
Read only

Former Member
0 Likes
819

You want FOR ALL ENTRIES in inbkpf.

And also include BUKRS and GJAHR.

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
818

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

Read only

ferry_lianto
Active Contributor
0 Likes
818

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

Read only

Former Member
0 Likes
818

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

Read only

Former Member
0 Likes
818

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.