Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8545

Find Bin location in OBIN table Use Stock transfer Request(WTQ1 Table)

$
0
0

I use SAP BUSINESS ONE 9.0

 

in Stock transfer request screen, I save data with select Batch number.

Then I see started bin location.

I can't find started bin location using WTQ1 Table DATA

So I've written the QUERY

 

SELECT H.docentry AS docentry, --문서번호

  L.linenum AS linenum, --줄번호

  CONVERT(CHAR(10),H.docduedate,120) AS docduedate, --이전요청일

  ISNULL(B5.attr1val,'') AS attr1val, --담당자(피킹담당자)

  ISNULL(B5.bincode,'') AS bincode, --출고빈위치(랙위치)

  L.dscription AS dscription, --품목명(품목)

  L.unitmsr AS unitmsr, --단위

  ISNULL(L.quantity, 0) AS quantity1, --총요청수량

  ISNULL(L.u_oboxqty, 0) AS quantity2, -- Obox기준수량

  ISNULL(L.u_palqty, 0) AS quantity3, -- Pal기준수량

  ISNULL(B1.batchnum,'') AS batchnum, --배치번호

  ISNULL(CONVERT(CHAR(10),B2.expdate,120),'') AS expdate, --유통기한

  ISNULL(B1.quantity, 0) AS quantity4, ---할당수량

  C.whsname AS whsname, --입고창고(납품처-이름)

  ISNULL(H.address,'') AS address --납품처-주소

FROM WTQ1 L

  --조회조건이 헤더의 docduedate로 검색해서 나온 docentry로 헤더랑 라인 이너 조인

  INNER JOIN OWTQ H ON L.docentry = H.docentry

  --할당된 품목에 대하여 출고빈위치와 담당자와 배치번호와 유통기한과 할당수량을 찾기위한 레프트 조인

  LEFT JOIN IBT1 B1 ON L.objtype = B1.basetype AND L.docentry = B1.baseentry AND L.linenum = B1.baselinnum

  LEFT JOIN OIBT B2 ON B1.itemcode = B2.itemcode AND B1.whscode = B2.whscode AND B1.batchnum = B2.batchnum

  LEFT JOIN OBTN B3 ON B2.batchnum = B3.distnumber AND B1.itemcode = B3.itemcode AND B2.sysnumber = B3.sysnumber

  LEFT JOIN OBBQ B4 ON B1.itemcode = B4.itemcode AND B1.whscode = B4.whscode AND B3.absentry = B4.snbmdabs

  LEFT JOIN OBIN B5 ON B1.whscode = B5.whscode AND B4.binabs = B5.absentry

  --입고창고명 찾기위한 레프트 조인

  LEFT JOIN OWHS C ON L.whscode = C.whscode

WHERE H.docentry = 2 and L.linenum = 0

ORDER BY H.docentry, L.linenum

 

Please help mefind out.Thanks for reading



Viewing all articles
Browse latest Browse all 8545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>