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

how to remove endselect ??

Former Member
0 Likes
2,318

select belnr into (itab1-l_belnr) up to 1 rows

from BKPF .

append itab1.

endselect.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,785

Hi Mansi

As you are appending internally you can try using INTO TABLE in select to remove ENDSELECT.

Try this:

select belnr into <b>table itab1</b> up to 1 rows

from BKPF .

*append itab1.

*endselect.

Make sure that belnr is the first field in internal table itab1.

If belnr is not the first field, then you have to use INTO CORRESPONDING FIELDS OF TABLE <itab>.

Regards

Eswar

select belnr into (itab1-l_belnr) up to 1 rows

from BKPF .

append itab1.

endselect.

12 REPLIES 12
Read only

former_member188829
Active Contributor
0 Likes
1,785

use into table statement

Read only

Former Member
0 Likes
1,785

Use the following statement.

select belnr from bkpf into corresponding fields of table itab1.

Manoj

Read only

Former Member
0 Likes
1,786

Hi Mansi

As you are appending internally you can try using INTO TABLE in select to remove ENDSELECT.

Try this:

select belnr into <b>table itab1</b> up to 1 rows

from BKPF .

*append itab1.

*endselect.

Make sure that belnr is the first field in internal table itab1.

If belnr is not the first field, then you have to use INTO CORRESPONDING FIELDS OF TABLE <itab>.

Regards

Eswar

Read only

Former Member
0 Likes
1,785

demo code -

tables :pa0006.

data begin of itab occurs 0.

include structure pa0006.

data end of itab.

Select * from Pa0006 up to 20 rows into table itab.

loop at itab.

write:/itab-pernr.

endloop.

Read only

Former Member
0 Likes
1,785

select belnr into corresponding fields of table itab1 from bkpf up to 1 rows.

or use select single if you can define the condition in where clause.

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Message was edited by:

SHIBA DUTTA

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
1,785

i thin ur requirtement is to add one filked in the internal table.

u dont want to use select-endselect.

types: begin of Ty_bkpf,

belnr type bkpf-belnr,

end of ty_bkpf.

data: it_bkpf type table of ty_bkpf.

select belnr from bkpf into table it_bkpf.

      • i created types, and internal table.

u can follow the same logic to include other fields,

also to filter the values from BKPF u can use appropriate conditions in the where clause of the select statement.

reward if useful.

Read only

Former Member
0 Likes
1,785

Hi

Use the following:

SELECT SINGLE belnr

FROM bkpf

INTO CORRESPONDING FIELDS OF TABLE itab1.

PLZ REWARD POINTS

Read only

Former Member
0 Likes
1,785

select belnr into table itab1 up to 1 rows

from BKPF .

append itab1.

Read only

0 Likes
1,785

hi

soory

dont use

append itab1.

Read only

Former Member
0 Likes
1,785

hi mansi,

declare one more internal table like

data: itab2 type bkpf-belnr occurs 0.

then write the select statement

select belnr into table itab2 up to 1 rows from bkpf.

in this way also u can avoid endselect...

~~Guduri

Read only

Former Member
0 Likes
1,785

if ur table is like this ..

data: begin of itab occurs 0,

belnr like bkpf-belnr,

end of itab.

select belnr from BKPF into table itab.

if ur table is like this (contains other than belnr fied..)

data: begin of itab occurs 0,

belnr like bkpf-belnr,

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

end of itab.

if u want to selct only belnr field...

select belnr from BKPF into corresponding of table itab.

Regards.

Ramesh.

if u want to specific recored use <b>up to N rows</b>

if u r useing any condition add WHERE <field name > = <pass condition value>

ok

Read only

Former Member
0 Likes
1,785

select belnr from bkpf into table itab.

if u want to restrict with condition, u can do it with where clause in select statement.

Regards,

Sujatha.