Skip to Content

question on performance issue with AFRU table

Hi Experts,

I need to get the posting date ( BUDAT) from AFRU table, based on production order nos (AUFNR) field . If I fetch data from AFRU table based on AUFNR ( prod order nos) its taking a lot of time as the we are fetching data based on non key fields.

I know we can use index , but is there any other way that we can get RUECK (completion confirmation number from any table ) and then get the data from AFRU table based on RUECK and AUFNR .

please suggest.

Thanks,

RG

Add comment
10|10000 characters needed characters exceeded

  • Need Some clarification.You said.

    its taking a lot of time as the we are fetching data based on non key fields.

    A row contains Non key fields. and Key fields also.

    Instead of using non key fields. use key fields.

    Example:

    key1 key2 Nonkey

    1 a s1

    2 b s12

    3 c s13

    May be you written the query like

    select from table where nonkey field eq 's12'

    I am suggesting that

    select from table where key field eq '2'

    Hope you understood.If you use key field also some time data is very slow.

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 19, 2016 at 09:17 AM

    Hi Ramya,

    As general rule, you can check where the data element is used and investigate a bit the DB tables

    To find any possible link.

    Sometimes is easy and intuitive, sometimes not so easy but it's always the best way.

    Other option: check if your DB table is used in any view :)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 19, 2016 at 09:29 AM

    Hi RG,

    You can take the field RUECK from AFKO along with AUFNR. Also, you can try FM "CO_OCM_FA_AFRU_DATA_GET".

    Regards

    Raj

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 19, 2016 at 09:58 AM

    Did you try a JOIN like

    SELECT * INTO CORRESPONDING FIELDS OF TABLE itab
    FROM afko
    JOIN afvc ON afvc~aufpl EQ afko~aufpl JOIN afru ON afru~rueck EQ afvc~rueck AND afru~rmzhl EQ afvc~rmzhl WHERE afko~aufnr IN range_aufnr.

    Regards,
    Raymond


    Add comment
    10|10000 characters needed characters exceeded

    • If you want to get the feeling of reading AFRU, try this syntax:

      SELECT * INTO CORRESPONDING FIELDS OF TABLE itab
        FROM afru
        WHERE EXISTS (
          SELECT *
          FROM  afvc
          JOIN  afko
            ON  afko~aufpl EQ afvc~aufpl
          WHERE afvc~rueck EQ afru~rueck
            AND afvc~rmzhl EQ afru~rmzhl
            AND afko~aufnr IN range_aufnr ).

      Regards,
      Raymond