SAP Document flow in SAP SD: This post will introduce a BAPI to read all the SAP Document flow for a SAP SD document. ( For example, read the delivery and Billing Document for Sales Order in SAP SD Sales and distribution).
Table of Contents
SAP Document flow Overview
SAP Doc. Flow Tables and Tcodes
Get the most important list of SAP tcodes and SAP tables for documents flow in this post: ?Document Flow SAP SD and SAP MM with Tables and Tcodes
SAP Document flow BAPI
Read the SAP Doc. flow can be done by the function module?RV_ORDER_FLOW_INFORMATION.
Read SAP Document Flow using BAPI sample code
The following part is a sample ABAP code to read the SAP Document Flow for SAP SD sales Order.
The input is the SAP Order Number ( VBCO6-VBELN ) and the output LT_VBFA for the Document flow information.
DATA: lt_VBFA TYPE TABLE OF VBFA. DATA: LS_vbco6 TYPE vbco6. PARAMETERS: p_vbeln type VBELN_D. START-OF-SELECTION. " Initialize SAP Order ls_vbco6-vbeln = p_vbeln. ls_vbco6-posnr = '000000'. " Read SAP Doc. Flow for an Order CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION' EXPORTING comwa = ls_vbco6 TABLES vbfa_tab = lt_vbfa " SAP Doc. flow EXCEPTIONS no_vbfa = 1 no_vbuk_found = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
Main SAP SD Document Category
When dealing with SAP Doc. Flow, it is important to understand the category of each documents in the flow. here the list of the most used SAP SD Document:
SD Doc. Category | Description |
---|---|
A | Inquiry |
B | Quotation |
C | Order |
D | Item proposal |
E | Scheduling agreement |
F | Scheduling agreement with external service agent |
G | Contract |
H | Returns |
I | Order w/o charge |
J | Delivery |
K | Credit memo request |
L | Debit memo request |
M | Invoice |
N | Invoice cancellation |
O | Credit memo |
P | Debit memo |
Q | WMS transfer order |
R | Goods movement |
S | Credit memo cancellation |
T | Returns delivery for order |
U | Pro forma invoice |
V | Purchase Order |
W | Independent reqts plan |
X | Handling unit |
0 | Master contract |
1 | Sales activities (CAS) |
2 | External transaction |
3 | Invoice list |
4 | Credit memo list |
5 | Intercompany invoice |
6 | Intercompany credit memo |
7 | Delivery/shipping notification |
8 | Shipment |
a | Shipment costs |
b | CRM Opportunity |
c | Unverified delivery |
d | Trading Contract |
e | Allocation table |
g | Rough Goods Receipt (only IS-Retail) |
h | Cancel goods issue |
i | Goods receipt |
j | JIT call |
p | Goods Movement (Documentation) |
r | TD Transport (only IS-Oil) |
s | Load confirmation reposting (only IS-Oil) |
t | Gain / loss (only IS-Oil) |
u | Reentry into storage (only IS-Oil) |
v | Data Collation (only IS-Oil) |
w | Reservation (only IS-Oil) |
x | Load confirmation goods receipt (only IS-Oil) |
: | Service Order |
. | Service Notification |
* | Pick Order |