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

Regarding ECC 6.0

Former Member
0 Likes
827

Hi Experts,

Program is exeuting syntatically fine, but, when executing its show, time exceed error in ECC 6.0 , initially it is developed in 4.6c. Please, can any one suggest this same code to incorporate in Forall entries.

SELECT abukrs aebeln bebelp aaedat alifnr aernam

bknttp bbednr b~banfn

cbelnr cwrbtr cgjahr cshkzg clfbnr clfgja

dbldat dbudat d~kursf

e~dir_indir

INTO CORRESPONDING FIELDS OF TABLE it_output

FROM ekko AS a

JOIN ekpo AS b ON bebeln = aebeln

JOIN rseg AS c ON cebeln = bebeln

AND cebelp = bebelp

AND cbukrs = abukrs

JOIN rbkp AS d ON dbelnr = cbelnr

AND dgjahr = cgjahr

LEFT JOIN zpo_dirindir AS e ON eknttp = bknttp

WHERE a~bukrs = p_bukrs

AND a~lifnr IN s_vendor

AND a~ebeln IN s_purcdo

AND a~bsart IN s_doctyp

AND a~ekorg IN s_purorg

AND a~aedat IN s_credat

AND b~knttp IN s_knttp

AND b~werks IN s_plant

AND b~bednr IN s_trcnum.

7 REPLIES 7
Read only

Former Member
0 Likes
800

well even in SAP documentation it says that joins over more than 3 tables are tending to be NOT performant.

so why dop you wonder that a JOIN like that with 5 tables runs into a timeout.

Read only

Former Member
0 Likes
800

I can suggest you to create one or two views. This would enhace the performance.

This is what I did also.

Thanks

Kiran

Read only

0 Likes
800

hi kiran, could u incorporate this code in forall entries.

Read only

Former Member
0 Likes
800

Hi Venu,

Let us have different internal tables,

1) T_PURC (with fields BUKRS, EBELN, AEDAT, LIFNR, ERNAM, EBELP, BELNR, BEDNR, BANFN in the same order).

2) T_RSEG (with fields EBELN, EBELP, BUKRS, BELNR, WRBTR, GJAHR, SHKZG, LFBNR, LFGJA).

3) T_RBKP (with fields BELNR, GJAHR, BLDAT, BUDAT, KURSF)

3) T_ZPO_DIRINDIR (with fields KNTTP, DIR_INDIR)

SELECT abukrs aebeln bebelp aaedat alifnr aernam

bknttp bbednr b~banfn

INTO TABLE T_PURC

FROM ekko AS a

JOIN ekpo AS b ON bebeln = aebeln

WHERE a~bukrs = p_bukrs

AND a~lifnr IN s_vendor

AND a~ebeln IN s_purcdo

AND a~bsart IN s_doctyp

AND a~ekorg IN s_purorg

AND a~aedat IN s_credat

AND b~knttp IN s_knttp

AND b~werks IN s_plant

AND b~bednr IN s_trcnum.

IF NOT T_PURC IS INITIAL.

SELECT ebeln ebelp bukrs belnr wrbtr gjahr shkzg lfbnr lfgja

INTO TABLE T_RSEG

FROM RSEG

FOR ALL ENTRIES OF T_PURC

WHERE ebeln in T_PURC-ebeln

AND ebelp in T_PURC-ebelp

AND bukrs in T_PURC-bukrs.

IF NOT T_RSEG IS INITIAL.

SELECT belnr gjahr bldat budat kursf

INTO TABLE T_RBKP

FROM RBKP

FOR ALL ENTRIES OF T_RSEG

WHERE belnr in T_RSEG-belnr

AND gjahr in T_RSEG-gjahr.

ENDIF.

SELECT knttp dir_indir

INTO TABLE T_ZPO_DIRINDIR

FROM ZPO_DIRINDIR

FOR ALL ENTRIES OF T_PURC

WHERE knttp in T_PURC-knttp.

ENDIF.

Now if you require you can move all the fields of all these tables by reading them into a single internal table or else you can use them seperately.

<b>Saying thanks in SDN is by awarding points.</b>

Kiran

Read only

0 Likes
800

Hi Venu,

there is a small correction needed to be made,

I have wrongly typed FOR ALL ENTRIES <b>OF</b>,

Plz change that to FOR ALL ENTRIES <b>IN</b>

Plz do not forget to reward with points.

Kiran

Read only

0 Likes
800

hi kiran,

i will try to use this logic in my code and will let u know for any clarifications required

regards

venu

Read only

0 Likes
800

hi kiran, could u give me ur personal mail id , so that i can approach u clearly about my issue