Application Development 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: 

Select Statements

Former Member
0 Kudos

Hi,

How can I fetch values for parameters...is the select statements right....how can i use ?

select-options : s_vbeln for vbak-vbeln.

Parameters : s_vkorg(10),

s_vtweg(10),

s_spart(10).

Initialization.

start-of-selection.

select avbeln aauart anetwr awaerk bzmeng bzieme bposnr bmatnr

into table itab from vbak as a inner join vbap as b on b~vbeln =

avbeln where avbeln in s_vbeln.

select vbeln auart netwr waerk from vbak into table itab where

vkorg = s_vkorg and

vtweg = s_vtweg.

select zmeng zieme posnr matnr from vbap into table itab where

spart = s_spart.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi


select a~vbeln  a~auart a~netwr a~waerk b~zmeng 
          b~zieme b~posnr b~matnr
            into table itab 
           from vbak as a inner join vbap as b on b~vbeln = a~vbeln 
                 where a~vbeln in s_vbeln 
                    and a~vkorg = s_vkorg
                    and a~vtweg = s_vtweg
                    and a~spart  = s_spart

Max

5 REPLIES 5

Former Member
0 Kudos

put in where condition

where vblen in s_vbeln

thnkx

Former Member
0 Kudos

Hi


select a~vbeln  a~auart a~netwr a~waerk b~zmeng 
          b~zieme b~posnr b~matnr
            into table itab 
           from vbak as a inner join vbap as b on b~vbeln = a~vbeln 
                 where a~vbeln in s_vbeln 
                    and a~vkorg = s_vkorg
                    and a~vtweg = s_vtweg
                    and a~spart  = s_spart

Max

0 Kudos

Hi,

I coulnt get the syntax clear coz spart is from vbap table and the other fields are from vbak...

I have tried using OR instead of AND..it shows the error like this ' the column name spart has two meanings..abap/4 open sql statement.'.

what to do.

Stalin.

0 Kudos

Hi


select a~vbeln  a~auart a~netwr a~waerk b~zmeng 
          b~zieme b~posnr b~matnr
            into table itab 
           from vbak as a inner join vbap as b on b~vbeln = a~vbeln 
                 where a~vbeln in s_vbeln 
                    and a~vkorg = s_vkorg
                    and a~vtweg = s_vtweg
                    and b~spart  = s_spart<--------

Max

Former Member
0 Kudos

ya ur select statement is right .