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

Former Member
0 Likes
553

hi,

what is wrong with this select structure is nos load.

parameters: p_vbeln type vbrp-vbeln,

p_posnr type vbrp-posnr.

start-of-selection.

select * from vbrp into ls_vb." where vbeln = p_vbeln.

append ls_vb to lt_vb.

endselect.

but this similar is ok!!!!

parameters: S_kunnr type kna1-kunnr.

start-of-selection.

break-point.

select * from kna1 into ws_kna1 where kunnr in s_kunnr.

append ws_kna1 to it_kna1.

endselect

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
532

Hi ,

In Case 1 , You are checking for the exact value of your input.The <b>'='</b> symbol will check equality of the input value and checks the data base is there any value with the given input.

parameters: p_vbeln type vbrp-vbeln,

p_posnr type vbrp-posnr.

start-of-selection.

select * from vbrp into ls_vb." where <b>vbeln <u>=</u> p_vbeln</b>.

append ls_vb to lt_vb.

endselect.

In Case 2 , you are querying database for any value as, how we go se12-Kna1 and display all values without giving any input criteria.

parameters: S_kunnr type kna1-kunnr.

start-of-selection.

break-point.

select * from kna1 into ws_kna1 <b>where kunnr <u>in</u> s_kunnr</b>.

append ws_kna1 to it_kna1.

endselect

In both case operator will plays important role.

Regards,

Raghav

4 REPLIES 4
Read only

Former Member
0 Likes
532
parameters: p_vbeln like vbrp-vbeln,
p_posnr type vbrp-posnr.

start-of-selection.

select * from vbrp into table it_vb where vbeln = p_vbeln.

Read only

Former Member
0 Likes
532

Hi,

the difference is only one

that is parameter and select option.

in second case even if there is nothing s_kunnr select will succeeded.

Regards

vijay

Read only

Former Member
0 Likes
533

Hi ,

In Case 1 , You are checking for the exact value of your input.The <b>'='</b> symbol will check equality of the input value and checks the data base is there any value with the given input.

parameters: p_vbeln type vbrp-vbeln,

p_posnr type vbrp-posnr.

start-of-selection.

select * from vbrp into ls_vb." where <b>vbeln <u>=</u> p_vbeln</b>.

append ls_vb to lt_vb.

endselect.

In Case 2 , you are querying database for any value as, how we go se12-Kna1 and display all values without giving any input criteria.

parameters: S_kunnr type kna1-kunnr.

start-of-selection.

break-point.

select * from kna1 into ws_kna1 <b>where kunnr <u>in</u> s_kunnr</b>.

append ws_kna1 to it_kna1.

endselect

In both case operator will plays important role.

Regards,

Raghav

Read only

Former Member
0 Likes
532

Hi,

in the second select you have to give '=' instead if 'IN'.

since it is a parameter you have to give '='

if it is a aselect-option you will give 'IN' in where condition.

Regards,

Sowjanya