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 PROBLEM

Former Member
0 Likes
1,229

Hi gurus,

I jst want some clarification regarding this sample code. I jst wnt to ask on whats the use or purpose of this part of the select statement.....

a~fkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2') in the sample code below???

select afkart aknumv arfbsk bVKGRP from vbrk as a

inner join knvv as b on akunag = bkunnr into table doc

where rfbsk = 'C'

and a~fkdat in fkdat

and a~erdat in erdat

and a~fkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2')

and b~VKGRP in VKGRP.

helpful answers would be given points,thanks in advance.

gerald

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,183

Hi Jose,

This a~fkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2') means, only mentioned fkart type in the brackets will fetch.

based on the inner join statement, aprt from all corresponding parameters the given select query will execute.

Suku

9 REPLIES 9
Read only

Former Member
0 Likes
1,183

it will check all value for where condition.

select afkart aknumv arfbsk bVKGRP from vbrk as a

inner join knvv as b on akunag = bkunnr into table doc

where rfbsk = 'C'

and a~fkdat in fkdat

and a~erdat in erdat

and afkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2') <b>chk condition</b>and bVKGRP in VKGRP.

Read only

Former Member
0 Likes
1,183

hi,

if the vlaue in the field fkart = 'ZUF2' or fkart = 'ZUIN' OR ...

like that for that purpose its better to keep

statement select * from table name where field in ( 'ZUF2','ZUIN',....).

REGARDS

SIVA

Read only

Former Member
0 Likes
1,183

Hi,

Basically to select the data where the billing types is either one of them which is given in the list..

'ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2'

You can also use a OR for the billing type like this..

where afkart = 'ZUF2' OR afkart = 'ZUIN'....

Thanks

Naren

Read only

Former Member
0 Likes
1,184

Hi Jose,

This a~fkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2') means, only mentioned fkart type in the brackets will fetch.

based on the inner join statement, aprt from all corresponding parameters the given select query will execute.

Suku

Read only

former_member404244
Active Contributor
0 Likes
1,183

Hi,

THe field fkart have lot of values ,but we are filtering out some values..thats why it has given the values which we require..Please check the table vbrk and field fkart..

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,183

THE STATEMENT SELECTS THE RECORDS THAT CONTAINS THE VALUES OF THE FIELD FKART IN GIVEN RANGE ONLY. (................................................................................)

Read only

Former Member
0 Likes
1,183

HI

a~fkart in ('ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2')

means that filed value may be any one from that group of values

Read only

Former Member
0 Likes
1,183

hi guys,

i have another question, whats the use of this field .....kinak = ' '......in the below sample code??what does this refer to??

select kschl sakn1 kwert from konv into table con

for all entries in doc

where knumv = doc-knumv

and kinak = ' '

and kschl in ('ZU01','R100','ZC25','ZDTR','ZDTL','ZDTP','ZDDA','ZRET','ZD06','ZDMI','ZDNP','ZDNE','ZDTD',

'ZC20','ZC01','ZC02','ZC03','ZC04','ZC05','ZC06','ZC07','ZC10','ZC14','ZC18','ZM09','ZC19',

'ZC27').

thanks in advance,

gerald

Read only

Former Member
0 Likes
1,183

Hi,

If the condition type is inactive then KINAK will be not initial..

In your case KINAK = ' ' means condition is active

Thanks

Naren