0
Former Member
Jan 25, 2007 at 04:26 AM

# i got the time out error in production system how can i rectity

17 Views

SELECT FMATNR FAUFNR FPSMNG GXMNGA GPERNR GBUDAT GARBID GAPLZL GGRUND GVORNR GAUFPL GIEDD INTO CORRESPONDING FIELDS OF TABLE IT_AFPO_IDEL

FROM AFPO AS F

INNER JOIN AFRU AS G ON FAUFNR = GAUFNR

• INNER JOIN TRUGT AS H ON GGRUND = HGRUND

• LEFT OUTER JOIN TRUGT AS H ON GGRUND = HGRUND H~GRDTX

WHERE F~MATNR IN S_MATNR AND

F~AUFNR IN S_AUFNR AND

• G~ISDD IN S_ISDD AND

G~IEDD IN S_IEDD AND

G~WERKS IN S_WERKS AND

G~XMNGA <> 0.

IF SY-SUBRC <> 0.

MESSAGE E006(ZIN01_RDPR).

ENDIF.

IF SY-SUBRC = 0.

SELECT GRUND GRDTX INTO CORRESPONDING FIELDS OF TABLE IT_TRUGT_IDEL FROM TRUGT

FOR ALL ENTRIES IN IT_AFPO_IDEL

WHERE GRUND = IT_AFPO_IDEL-GRUND AND

SPRAS = 'EN' AND WERKS IN S_WERKS .

ENDIF.

SELECT HARBPL HOBJID IAUFPL IARBID IVORNR IVORGLFNR INTO CORRESPONDING FIELDS OF TABLE IT_CRHD_IDEL

FROM CRHD AS H

INNER JOIN V_QAPO AS I ON HOBJID = IARBID

FOR ALL ENTRIES IN IT_AFPO_IDEL

WHERE VORGLFNR = IT_AFPO_IDEL-APLZL AND

ARBID = IT_AFPO_IDEL-ARBID AND

OBJID = IT_AFPO_IDEL-ARBID AND

VORNR = IT_AFPO_IDEL-VORNR.

IF SY-SUBRC = 0.

SELECT AMATNR BMAKTX BSPRAS CMENGE D~STPRS

INTO CORRESPONDING FIELDS OF TABLE IT_MARA_IDEL

FROM MARA AS A

INNER JOIN MAKT AS B ON AMATNR = BMATNR

INNER JOIN MSEG AS C ON AMATNR = CMATNR

INNER JOIN MBEW AS D ON AMATNR = DMATNR

• INNER JOIN EKPO AS E ON AMATNR = EMATNR E~NETPR

FOR ALL ENTRIES IN IT_AFPO_IDEL

WHERE AMATNR = IT_AFPO_IDEL-MATNR AND BSPRAS = 'EN'

AND A~MATKL IN S_MATKL.

ENDIF.

LOOP AT IT_AFPO_IDEL.

CONCATENATE IT_AFPO_IDEL-IEDD6(2) IT_AFPO_IDEL-IEDD4(2) IT_AFPO_IDEL-IEDD+0(4)

INTO PEDATE SEPARATED BY '.'.

• IT_FINAL_IDEL-IEDD = IT_AFPO_IDEL-IEDD.

IT_FINAL_IDEL-IEDD = PEDATE.

CONCATENATE IT_AFPO_IDEL-BUDAT6(2) IT_AFPO_IDEL-BUDAT4(2) IT_AFPO_IDEL-BUDAT+0(4)

INTO POSDATE SEPARATED BY '.'.

IT_FINAL_IDEL-BUDAT = POSDATE.

IT_FINAL_IDEL-PERNR = IT_AFPO_IDEL-PERNR.

IT_FINAL_IDEL-MATNR = IT_AFPO_IDEL-MATNR.

IT_FINAL_IDEL-AUFNR = IT_AFPO_IDEL-AUFNR.

IT_FINAL_IDEL-PSMNG = IT_AFPO_IDEL-PSMNG.

• IT_FINAL_IDEL-PSAMG = IT_AFPO_IDEL-PSAMG.

IT_FINAL_IDEL-XMNGA = IT_AFPO_IDEL-XMNGA.

IT_FINAL_IDEL-GRUND = IT_AFPO_IDEL-GRUND.

READ TABLE IT_TRUGT_IDEL WITH KEY GRUND = IT_AFPO_IDEL-GRUND.

IT_FINAL_IDEL-GRDTX = IT_TRUGT_IDEL-GRDTX.

• IT_FINAL_IDEL-GRDTX = IT_AFPO_IDEL-GRDTX.

**

• READ TABLE IT_CRHD_IDEL WITH KEY AUFPL = IT_AFPO_IDEL-AUFPL.

• READ TABLE IT_CRHD_IDEL WITH KEY VORNR = IT_AFPO_IDEL-VORNR.

READ TABLE IT_CRHD_IDEL WITH KEY VORGLFNR = IT_AFPO_IDEL-APLZL AUFPL = IT_AFPO_IDEL-AUFPL.

IT_FINAL_IDEL-ARBPL = IT_CRHD_IDEL-ARBPL.

*

READ TABLE IT_MARA_IDEL WITH KEY MATNR = IT_AFPO_IDEL-MATNR.

IF SY-SUBRC = 0.

IT_FINAL_IDEL-MAKTX = IT_MARA_IDEL-MAKTX.

• IT_FINAL_IDEL-MENGE = IT_MARA_IDEL-MENGE.

IT_FINAL_IDEL-STPRS = IT_MARA_IDEL-STPRS.

IT_FINAL_IDEL-NETPR = IT_MARA_IDEL-NETPR.

IT_FINAL_IDEL-TC = IT_AFPO_IDEL-XMNGA * IT_MARA_IDEL-STPRS.

ENDIF.

APPEND IT_FINAL_IDEL.

• CLEAR : IT_FINAL_IDEL,IT_AFPO_IDEL,IT_MARA_IDEL,IT_CRHD_IDEL.

CLEAR : IT_TRUGT_IDEL-GRDTX,IT_FINAL_IDEL-TC,IT_FINAL_IDEL-MATNR,IT_FINAL_IDEL-MAKTX, IT_FINAL_IDEL-PSMNG, IT_FINAL_IDEL-STPRS.

ENDLOOP.

CLEAR : IT_FINAL_IDEL,IT_AFPO_IDEL,IT_MARA_IDEL,IT_CRHD_IDEL.

ENDFORM.

very urgent , Thanks in advance

Regards

ds