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 PROBLEM

Former Member
0 Likes
818

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

5 REPLIES 5
Read only

Former Member
0 Likes
720

fkart -> Billing Type

chk condition for = ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2'

if sy-subr = 0 "record finf else not match record.

Read only

Former Member
0 Likes
720

hi,

in table VBRK

field FKART

there should be values only 'ZUF2','ZUIN','ZUVF','ZUS2','ZC23','ZC24','ZC26','ZUL2','ZUG2'

the select statement will select data where values for FKART are given there only.

Regards,

Sandeep Kaushik

Read only

Former Member
0 Likes
720

Hi,

ur select statement will fetch the records with fkart = 'ZUF2' or 'ZUIN' or 'ZUVF' or 'ZUS2' or 'ZC23' or 'ZC24' or 'ZC26' or 'ZUL2' or 'ZUG2'.

rgds,

bharat.

Read only

Former Member
0 Likes
720

HI

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

this means it acts like on OR condition

it will check for all the values in that condition

Read only

meikandan_krishnan2
Participant
0 Likes
720

Hi ,

This select statement fetches records from the table, only for the values where

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

above is the simplification of the below mentioned condition

.......and ( fkart = ZUF2 or

fkart = ZUIN or

fkart = ZUVF or

fkart = ZUS2 or ...........)

and ......

Regards

Meikandan