This website is not affiliated with, sponsored by, or approved by SAP AG.

Join AFRU AFVC CRHD to get ARBPL from CHRD

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Join AFRU AFVC CRHD to get ARBPL from CHRD

Postby surenekr » Fri Mar 28, 2014 6:24 am

Hi

I have made query in the abap program to get arbpl field from CHRD by joining AFRU with AFVC fields AUFPL and APLZL. and AFRU join with CRHD ARBID = OBJID WHERE ltxa1 = 'Confirmation Text' AND ktsch = Std text key and STOKZ eq space.


Even I tried the same join made as a view and fetching the details with the where condition in the abap program.

Both the cases the data correctly fetches. But it takes huge time to execute this query.

Any one has any suggestion to improve the performance of this query or view.

CREATE VIEW "ZVIEW_OPRN_DET" ("RUECK", "RMZHL", "BUDAT", "ARBID", "LTXA1", "AUFNR", "VORNR", "KTSCH", "OBJID", "ARBPL",
"WERKS", "STEUS", "AUFPL", "APLZL", "STOKZ", "STZHL") AS SELECT T1."RUECK", T1."RMZHL", T1."BUDAT", T1."ARBID", T1."LTXA1",
T1."AUFNR", T1."VORNR", T2."KTSCH", T3."OBJID", T3."ARBPL", T3."WERKS", T3."STEUS", T2."AUFPL", T2."APLZL", T1."STOKZ",
T1."STZHL" FROM "AFRU" T1, "AFVC" T2, "CRHD" T3 WHERE T1."MANDT" = T2."MANDT" AND T1."AUFPL" = T2."AUFPL" AND T1."APLZL" = T2."APLZL" AND T1."MANDT" = T3."MANDT" AND T1."ARBID" = T3."OBJID".

Regards,
Suren
surenekr
 
Posts: 2
Joined: Fri Mar 28, 2014 6:08 am

Re: Join AFRU AFVC CRHD to get ARBPL from CHRD

Postby Gothmog » Fri Mar 28, 2014 7:57 am

Neither AFRU-LTXA1, AFRU-STOKZ nor CRHD-KTSCH are part of an index on these tables.
You will always do a full table scan with this selection.
Considering the usual size of these tables, no wonder it's very slow.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Join AFRU AFVC CRHD to get ARBPL from CHRD

Postby surenekr » Sat Mar 29, 2014 12:23 am

Hi,

Agree with you. Is there any alternative way to improve the performance. AFRU-LTXA1 caries a barcode number as reference to reach the crhd to find out the arbpl field.

Regards,
Suren
surenekr
 
Posts: 2
Joined: Fri Mar 28, 2014 6:08 am

Re: Join AFRU AFVC CRHD to get ARBPL from CHRD

Postby Sharpshooter » Sun Mar 30, 2014 8:46 pm

Sounds like a bad process - at confirmation, a workcenter value is input into a text field for later processing? Why not input the workcenter into the workcenter field?

Sometimes even the best code cannot fix a bad process!

Dave
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark


Return to ABAP

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.