Quantcast
Channel: ABAP Development
Viewing all articles
Browse latest Browse all 948

FM to get SD Document Flow

$
0
0

I'm writing this post in order to help others who have difficulties finding the correct SD document flow by accessing directly to standard tables. SAP provides us with a function module called SD_DOCUMENT_FLOW_GET, it's very easy to use and fast enough to look for all the documents in the flow. To give you an example I'll use an Outbound delivery, but you can you any SD document such as Sales Orders, Invoices, etc:

 

1. Let's go to transaction SE37 and in parameter IV_DOCNUM enter the Outbound delivery number:

foto1.png

 

2. We get the list of the SD document flow for the Outbound delivery, for our example there are seven documents:

 

foto2.png

 

3. Let's open the table ET_DOCFLOW to see all documents:

 

foto3.png

 

4. The fields of these table are important:

 

DOCNUM: SD document number.

FOCUS:     Points the document from which the search began.

HLEVEL:    Hierarchy position on the document flow tree.

VBTYP_N: SD document category (type of document for DOCNUM field). In our example we have the following:

 

CategoryDescription
COrder
JDelivery
RGoods movement
MInvoice
8Shipment

 

You can check the complete list of categories by looking the VBTYP domain's values in transaction SE11:

 

foto4.png

 

And that's all we get the SD documents from the order up to the accounting document in FI. As an advice you should order the table by the fields ERDAT and ERZET in descending order to see the documents by the date they were created.

 

I hope this help you with your SD Abap developments.


Viewing all articles
Browse latest Browse all 948

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>