Skip to Content
author's profile photo Former Member
Former Member

select statement condition

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 05: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 ).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 06: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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • Posted on Dec 04, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.