Skip to Content
author's profile photo
Former Member

Read intead of select for query ?

Hi,

I am using the following select statement inside the loop. But I asked to replace the select statement using Read instead of select. How can I write the following query using read ?

SELECT SINGLE CRHD~ARBPL

FROM AFKO

INNER JOIN V_QAPO ON V_QAPOAUFPL = AFKOAUFPL

INNER JOIN CRHD ON CRHDOBJID = V_QAPOARBID

INTO XARBPL

WHERE AFKO~AUFNR = CAUFVD_TAB-AUFNR

AND V_QAPO~VORNR = IAFVC-VORNR.

Points will be surely awarded.

Thanks,

Tushar.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Sep 28, 2005 at 06:18 PM

    Tushar - why do you want to do this? From the help for "READ":

    READ - Read a database table

    Basic form

    READ TABLE dbtab.

    Additions:

    1. ... SEARCH FKEQ

    2. ... SEARCH FKGE

    3. ... SEARCH GKEQ

    4. ... SEARCH GKGE

    5. ... WITH KEY key

    6. ... VERSION vers

    <b>Note

    This variant is no longer maintained and should therefore not be used (see also obsolete statements ). Please use a SELECT (SINGLE) statement instead.

    See READ TABLE not allowed.</b>

    I doubt if you could do the join with "READ".

    I think they want you to use FM READ_TEXT to get the text elements rather than a SELECT. It's documented.

    Rob

    Message was edited by: Rob Burbank

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      try with for all entries

      SELECT SINGLE CRHD~ARBPL

      FROM AFKO

      INNER JOIN V_QAPO ON V_QAPOAUFPL = AFKOAUFPL

      INNER JOIN CRHD ON CRHDOBJID = V_QAPOARBID

      INTO XARBPL for all entries in IAFVC

      WHERE AFKO~AUFNR = CAUFVD_TAB-AUFNR

      AND V_QAPO~VORNR = IAFVC-VORNR.

      cheers,

      sasi

  • author's profile photo
    Former Member
    Sep 28, 2005 at 07:39 PM

    Tushar,

    I am not sure how big are the tables. I am presuming that if the internal table is too large then the select even with single will be a performance killer.

    In that case it is better to take out that select statment inside the loop and keep that out, then read that internal table inside the loop.

    As per my knowledge, if the internal table is large, a select single is also an expensive statement in side a loop.

    Thanks,

    Naren

    Add comment
    10|10000 characters needed characters exceeded