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 condition

Former Member
0 Likes
611

hi experts,

plz help me these select statement

SELECT likp~vbeln

likp~vstel

likp~lfart

likp~erdat

likp~wadat

likp~kunnr

lips~matnr

lips~matkl

lips~charg

lips~lfimg

lips~meins

INTO TABLE t_lost FROM likp

INNER JOIN lips ON lipsvbeln = likpvbeln

WHERE likp~erdat IN s_erdat OR

likp~vstel = p_vstel OR

likp~lfart = p_lfart.

this select statement all the data will be display. but some condition is there

ok

i will given to condition :

With respect to input fields get all the delivery’s from the tables LIKP and LIPS where the delivery are not fully invoiced ( VBUK-FKSTK NE C ).

i will write condtion but not working . so plz anybody help these select statement

advance thanking every body.

4 REPLIES 4
Read only

Former Member
0 Likes
577

chk the table entries. that kind if sample data in db.

after finished this select query read itab comapre the field VBUK-FKSTK NE C ).

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
577

i.m not sure just try this.

i guess p_vstel , p_lfart are parameters.

try deslcaring it as select options

select-options:p_vstel for <table field> no-extension no intervals.

select-options:p_lfart for <table field> no-extension no intervals.

and write u r query as below

.

SELECT likp~vbeln

likp~vstel

likp~lfart

likp~erdat

likp~wadat

likp~kunnr

lips~matnr

lips~matkl

lips~charg

lips~lfimg

lips~meins

INTO TABLE t_lost FROM likp

INNER JOIN lips ON (lipsvbeln = likpvbeln)

inner join vbuk on (likpvbeln = vbukvbeln)

WHERE likp~erdat IN s_erdat

and likp~vstel in p_vstel

and likp~lfart in p_lfart

and vbuk~fkstk ne 'C'.

do reward if useful.

Read only

0 Likes
577

if the fetch takes much time.

just remove the vbuk from query and do like this.

loop at t_lost.

select single fkstk into vbuk-fksk from vbuk client specified

where mandt = sy-mandt and vbeln = t_lost-vbeln and fkstk <> 'C'.

if sy-subrc <> 0.

delete t_lost where vbeln = t_lost-vbeln.

endif.

endloop.

Read only

former_member386202
Active Contributor
0 Likes
577

Hi,

SELECT likp~vbeln

likp~vstel

likp~lfart

likp~erdat

likp~wadat

likp~kunnr

lips~matnr

lips~matkl

lips~charg

lips~lfimg

lips~meins

INTO TABLE t_lost FROM likp

INNER JOIN lips ON lipsvbeln = likpvbeln

WHERE likp~erdat IN s_erdat OR

likp~vstel = p_vstel OR

likp~lfart = p_lfart.

Select data from vbuk . Loop on t_lost read table vbuk with key and then compare

VBUK-FKSTK NE C.

Regards,

Prashant