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
In general you can get the delivery (or delivery items) status from tables
VBUK(header status)VBUP(items status)for example:
LS_VBUP-WBSTAis 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:LT_VBFAtable contains the GR/GI posted for your delivery