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?
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
postedA
: status goods movement "open". No quantity has been posted yetB
: 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