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

getting data from afru taking long time

Former Member
0 Likes
698

I have perform a select statement it takes a long time.

SELECT SINGLE * FROM afru
          WHERE werks = i_aufm2-werks
            and wablnr EQ i_aufm2-mblnr
            and aufnr eq i_aufm2-aufnr
            AND stokz = 'X'.

is any way to select easily,

or on key field select from another table.

pl. help.

I have perform a select statement it takes a long time.

SELECT SINGLE * FROM afru
          WHERE werks = i_aufm2-werks
            and wablnr EQ i_aufm2-mblnr
            and aufnr eq i_aufm2-aufnr
            AND stokz = 'X'.

is any way to select easily,

or on key field select from another table.

pl. help.

4 REPLIES 4
Read only

Former Member
0 Likes
674

Helllo ,

whats the need of doing this step ?, based on the requirement we can suggest .

regards

Prabhu

Read only

Former Member
0 Likes
674

Try to provide BUDAT in the WHERE condition.

Read only

Former Member
0 Likes
674

Hi!

Try to create secondary index for fields in WHERE clause.

Read only

Former Member
0 Likes
674

hey, i got the solution using below code,

thanks,

SELECT  mblnr aufnr rspos menge werks aufpl aplzl
        FROM  aufm
        INTO TABLE i_aufm2
       WHERE matnr EQ matnr_261-matnr AND charg EQ matnr_261-charg AND bwart = '261'
         AND mblnr > '4900000000'
         AND mjahr >= '2008'.
        sort i_aufm2 by werks mblnr aufnr.
      LOOP AT i_aufm2.
        select single * from afvc
          where aufpl = i_aufm2-aufpl
            and aplzl = i_aufm2-aplzl.
          if sy-subrc = 0.
            select single * from afru
              where rueck = afvc-rueck
                and rmzhl = afvc-rmzhl
                and stokz = 'X'.