cancel
Showing results for 
Search instead for 
Did you mean: 

Procudure for GR Data with Batch Detail

Former Member
0 Kudos

Hi Experts ,

I need a query which return the GRPO Data and the Batch no of the item Involved it .

Where parameter will be GRPO Docnum .

Thanks in advance

Gangadhar

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

Try to start with this:

SELECT r.DocNum,r.DocDate,r.CardCode,r.CardName, 
 l.[ItemCode],l.ItemName,bb.DistNumber,  b.[Quantity],
 l.[DocType], l.[DocNum], l.[DocQty], --l.[DocEntry],
'Bt',  b.[Quantity], b.[AllocQty], b.[MdAbsEntry]
FROM OPDN r
 Inner join OITL  l on l.DocType=20 and  l.DocEntry=r.DocEntry 
 inner join ITL1 b ON b.LogEntry = l.LogEntry
 inner join OBTN bb on b.MdAbsEntry=bb.AbsEntry
Where r.DocNum=[%0]

Answers (1)

Answers (1)

Former Member
0 Kudos

HI

Check this:(Please add your needed field in next to the select statement)

SELECT T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T2.[DistNumber] FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OBTN T2 ON t1.[ItemCode] = T2.[ItemCode] WHERE T0.[DocNum] = [%0]

It will help you.....