‎2007 Dec 04 5:11 AM
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 deliverys 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.
‎2007 Dec 04 5:18 AM
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 ).
‎2007 Dec 04 6:09 AM
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.
‎2007 Dec 04 6:19 AM
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.
‎2007 Dec 04 6:15 AM
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