‎2006 Oct 31 11:58 AM
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
‎2006 Oct 31 12:07 PM
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
‎2006 Oct 31 12:02 PM
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.
‎2006 Oct 31 12:02 PM
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
‎2006 Oct 31 12:07 PM
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
‎2006 Oct 31 12:09 PM
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