|
|
发表于 2007/5/7 10:14:52
|
显示全部楼层
在网上给你找了一个SQL,希望对你有帮助?- --请购单清单SQL(初学者可参考)
- SELECT H.SEGMENT1,
- H.CREATION_DATE,
- H.INTERFACE_SOURCE_CODE,
- L.LINE_NUM,
- L.ITEM_DESCRIPTION,
- L.UNIT_MEAS_LOOKUP_CODE,
- L.QUANTITY,
- L.NEED_BY_DATE,
- FU.DESCRIPTION USER_NAME
- FROM PO_REQUISITION_HEADERS_ALL H,
- PO_REQUISITION_LINES_ALL L,
- FND_USER FU,
- MTL_SYSTEM_ITEMS_B MSIB
- WHERE 1 = 1
- AND H.AUTHORIZATION_STATUS = 'APPROVED'
- AND H.CANCEL_FLAG IS NULL
- AND H.REQUISITION_HEADER_ID = L.REQUISITION_HEADER_ID
- AND L.CANCEL_FLAG <> 'Y'
- --AND H.INTERFACE_SOURCE_CODE = 'MRP' --È¡MRPÉú³ÉµÄ²¿·Ö
- AND H.CREATED_BY = FU.USER_ID
- AND L.ITEM_ID = MSIB.INVENTORY_ITEM_ID
- AND H.ORG_ID = MSIB.ORGANIZATION_ID
- AND Trunc(H.CREATION_DATE) >= TO_DATE('20060801', 'YYYYMMDD')
- AND Trunc(H.CREATION_DATE) <= TO_DATE('20060814', 'YYYYMMDD')
- AND H.ORG_ID = 81
复制代码 |
|