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

select statement

Former Member
0 Likes
696

hi all,

iam writing my select statement as follows :

select * from vbap into corresponding fields of itab where vbeln = zorder.

append itab.

the sales order has two line items but in itab 3 line items are getting appended the last item has all zero value.

can anyone tell me why is it happening & how shuld it be corrected.

rgds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

Hi,

do like this

select * from vbap into corresponding fields of table itab where vbeln = zorder.

or

data declaration

data : itab type table of vbap,

w_itab like line of itab.

select * from vbap into corresponding fields of w_itab where vbeln = zorder.

append itab from w_itab.

endselect.

however the first option is better from the performance point of view.

regards,

Advait

6 REPLIES 6
Read only

Former Member
0 Likes
679

Hi,

do like this

select * from vbap into corresponding fields of table itab where vbeln = zorder.

or

data declaration

data : itab type table of vbap,

w_itab like line of itab.

select * from vbap into corresponding fields of w_itab where vbeln = zorder.

append itab from w_itab.

endselect.

however the first option is better from the performance point of view.

regards,

Advait

Read only

Former Member
0 Likes
678

Hi,

you don`t need the append coding. The select-statement automaticly includes the append.

Regards

Nicole

Read only

Former Member
0 Likes
678

write the select as ..

select * from vbap into corresponding fields of

table itab where vbeln = zorder.

Read only

Former Member
0 Likes
678

Hi,

Try like this.

Use the refresh command before using select query.

REFRESH ITAB.

Then use select query to retrieve values.

Read only

Former Member
0 Likes
678

hi,

select * from vbap into corresponding fields of where vbeln = zorder.

if sy-subrc = 0.

append itab.

endif.

clear itab.

if record found then it will append otherwise it will ot append.

reward me if helpful.

Read only

Former Member
0 Likes
678

hi friend

use the select command like this,

that will definatly works

and use clear after appending the fields.

select * from vbap into corresponding fields of table itab where vbeln = zorder.

rewards are expected

vivek srivastava