Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help..Urgent.....

Status
Not open for further replies.

pran09

Technical User
Nov 24, 2007
2
US
hi can any body explain..tis query and how to use it for crystal enterprise..can we write sql code or we need to use stored procedures...pls give me reply as soon as possible

OPENVCORD
RUN VCORDTRANS
SAVE DATA AS VCORDC1 (CONFIRM = NO
RUN VCORDREC10
SAVE DATA AS VCORDC2 (CONFIRM = NO
RUN VCORDTRANS2
SAVE DATA AS VCORDC3 (CONFIRM = NO
RUN VCINSERT1 (CONFIRM = NO
RUN VCORDSUM2
SAVE DATA AS VCORD C3 (CONFIRM = NO
RUN VCORDCONFQ (FORM = VCF

VCORDTRANS
SELECT DISTINCT
A.PART_NO,
B.ORD_NO

FROM GOD41D00 A,
GOD40D00 B,
GODE2D00 C

WHERE
A.PART_NO IN (SELECT PART_NO FROM MN05849.VCDATA)
AND C.ORD_NO = B.ORD_NO
AND C.PART_NO = A.PART_NO
AND C.SUPP_CD = B.SUPP_CD
AND C.SUPP_LOC = B.SUPP_LOC
AND A.PO_STATUS = ‘03’
AND A.ORD_NO = B.ORD_NO
AND A.REQ_NO = B.REQ_NO
AND A.PO_STATUS = B.PO_STATUS
AND B.PO_RSN_CD = ‘o’

GROUP BY
A.PART_NO,
B.ORD_NO,
B.DELV_SCDL_DT,
B.IMP_ORD_NO

VCORDREC10
SELECT
A.PART_NO,
-SUM(PART_UNLD_QTY) AS REC_QTY,
B.ORD_NO

FROM GIV72D00 A,
MN14987.VCORDC1 B

WHERE
A.PART_NO = B.PART_NO
AND A.ORD_NO = B.ORD_NO
AND SUPP_CD IN (‘JN9999’, ‘JNHPPM’, ‘JNHPMC’)
AND A.PART-NO IN (SELECT PART_NO FROM MN05849.VCDATA)
AND RVD_STATUS IN (‘02’, ‘03’)
AND A.ORD_NO > 0

GROUP BY
A.PART_NO
B.ORD_NO

VCORDTRANS2
SELECT
A.PART_NO,
SUM(CONFIRMED_QTY) AS ORDER_QTY,
C.ORD_NO

FROM GOD41D00 A,
GOD40D00 B,
GODE2D00 C

WHERE
A.PART_NO IN (SELECT PART_NO FROM MN05849.VCDATA)
AND C.ORD_NO = B.ORD_NNO
AND C.PART_NO = A.PART_NO
AND C.SUPP_CD = B.SUPP_CD
AND C.SUPP_LOC = B.SUPP_LOC
AND A.PO_STATUS = ‘03’
AND A.ORD_NO = B.ORD_NO
AND A.REQ_NO = B.REQ_NO
AND A.PO_STATUS = B.PO_STATUS
AND B.PO_RSN_CD = ‘0’

GROUP BY
A.PART_NO,
C.ORD_NO

VCINSERT1
INSERT INTO VCORDC3
SELECT * FROM VCORDC2

VCORDSUM2
SELECT
PART_NO,
SUM(ORD_QTY) AS ORDER_QTY,
ORD_NO

FROM
MN14987.VCORDC3

GROUP BY
PART_NO,
ORD_NO

VCORDCONFQ
SELECT
B.PART_NO,
ITEM_CD_DESC,
ORDER_QTY,
DELV_SCDL_DT,
B.ORD_NO
IMP_ORD_NO

FROM GODE2D00 A
MN14987.VCORDC3 B
MN05849.ICGITEM9D C

WHERE
A.PART_NO = B.PART_NO
AND A.ORD_NO = B.ORD_NO
AND ITEM_CD = B.PART_NO
AND ORDER_QTY > 0

ORDER BY
B.PART_NO


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top