0

What tables to look at to check whether the outbound delivery item is posted in a GR?

Or is there any BADI that can provide this information?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Adham Enaya
  • 780
  • 1
  • 11
  • 29

1 Answers1

2

In general you can get the delivery (or delivery items) status from tables

  • VBUK (header status)
  • VBUP (items status)

for example:

DATA: ls_vbup type vbup.

SELECT SINGLE * FROM VBUP 
 WHERE VBELN = <delivery no> 
   AND POSNR = <delivery item> 
  INTO ls_vbup.

LS_VBUP-WBSTA is the Goods movement status for the delivery. It can contain:

  • C: status goods movement "completed". All the quantity has been posted
  • A: status goods movement "open". No quantity has been posted yet
  • B: status goods moviment "partial".

Otherwise if you also want to know which GR/GI has been posted for your delivery you could check the SD document flow table VBFA:

DATA: lt_vbfa TYPE TABLE OF vbfa.

SELECT * FROM VBFA
 WHERE VBELV = <delivery no>
   AND POSNV = <delivery item>
   AND VBTYP_V = 'J'  " J means Delivery
   AND VBTYP_N = 'R'  " R means Goods movement
 INTO TABLE lt_vbfa.

LT_VBFA table contains the GR/GI posted for your delivery

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
manuel_b
  • 1,646
  • 3
  • 20
  • 29
  • Hi @manuel_b could you please advise what is the difference between LFSTA and WBSTA in the table VBUP? – Adham Enaya Jun 22 '20 at 07:48
  • Useful informations about a field meaning can be found in the documentation of the data element. In particular: LFSTA=The status line tells you if the item is not yet delivered, is partly delivered, is completely delivered, or is not relevant for delivery, WBSTA=The status shows if a goods issue or receipt has taken place for a delivery item. VBUP/VBUK tables contain the status off several kind of SD documents; LFSTA is relevant for sales order for example (a SO has been delivered or not), while WBSTA is relevant for deliveries (a delivery has been GI/GR posted or not) – manuel_b Jun 23 '20 at 08:10