55
Document flow in SD a Techno functional Look Document flow is flow of documents created in a Sales and Distribution (SD) process in SAP. In sales process we create separate documents in each of the steps, like Sales order, Delivery Document, Transfer Order, Goods issue Document, Billing Document, Accounting Document etc. From one document created in a previous step we can create another document in next step. The chain of preceding document and subsequent document is called the document flow which can be displayed by pressing the document flow button. The Document flow provides us the overview of the development of the sales process by the history and current status. Here is a simple example of a document flow. The example below shows the preceding and subsequent documents at header level. This is shown from the sales order document flow screen. Page 1 of 55 Pijush Ranjan Ghosh

Document Flow

Embed Size (px)

DESCRIPTION

SD flow

Citation preview

Page 1: Document Flow

Document flow in SD

a Techno functional Look

Document flow is flow of documents created in a Sales and Distribution (SD) process in SAP. In sales process we create separate documents in each of the steps, like Sales order, Delivery Document, Transfer Order, Goods issue Document, Billing Document, Accounting Document etc. From one document created in a previous step we can create another document in next step. The chain of preceding document and subsequent document is called the document flow which can be displayed by pressing the document flow button.The Document flow provides us the overview of the development of the sales process by the history and current status.

Here is a simple example of a document flow. The example below shows the preceding and subsequent documents at header level. This is shown from the sales order document flow screen.

Page 1 of 48 Pijush Ranjan Ghosh

Page 2: Document Flow

Document flow in SD

Like header level, document flow happens in item level also. This is not always like the header, because, there may be some special business cases where the creation of the subsequent document can differ. For an example in the following example, Line item 2 in Sales Order has created two line items in the delivery documents as it has two schedule lines. Schedule lines are list of delivery dates and partial quantities for that line item.

Here is an example shown in R3.

Creation of a Sales order (VA01) & Change Sales Order (VA02)

Page 2 of 48 Pijush Ranjan Ghosh

Page 3: Document Flow

Document flow in SD

Sales Order 157 is created. Once that has been created, we can create delivery document for the ordered quantity on the material availability date (this is called selection date in delivery). To create the delivery document go to VA02 (Change Sales Order) and follow the path in menu bar Sales Document Deliver or by using transaction VL01n.

The Shipping point and Selection date is defaulted automatically from the Sales Order. User can change these values. Shipping point is the point from where the Goods issue will be done. One delivery document can belong to only one shipping point. That’s why this is the header attribute of any Delivery Document.

After creation of the Delivery Document, the materials are picked from Warehouse. This is called picking process. In this process Transfer Order is created by LT03 which track and monitor the movements of goods inside the Warehouse.

Once the full quantity of the delivery document is picked (and if needed confirmed & Packed), it is ready for Goods Issue, which can be done by pressing Post Goods Issue button in the delivery document. That means the materials are sent to customer.

Once PGI is done, billing document can be created by VF01. Then the delivery document is complete. For each billing document, one accounting document is created in FI which ensures account posting. When Customer pays the billing amount, the accounting document is cleared.Creation of an Outbound Delivery Document (VL01n)

Page 3 of 48 Pijush Ranjan Ghosh

Page 4: Document Flow

Document flow in SD

Creation of Transfer Order LT03 or By Subsequent Function Create TO

Page 4 of 48 Pijush Ranjan Ghosh

Page 5: Document Flow

Document flow in SD

The Document Flow from Sales Order Line Item 10

Page 5 of 48 Pijush Ranjan Ghosh

Page 6: Document Flow

Document flow in SD

The Following document flow shows the delivery is created and TO is created in second next step from that sales order. One DOT before the Delivery document means it is the very next step. The Overall status is also shown in the right side. To display the detailed status press Status Overview Button. Choosing one Document if the Display Document button is pressed, that particular document is displayed.

Here the Document flow of header and line item is same as this is a simple case where the Sales Order contains one line item and there is no Split or merge of documents.

For getting the document flow you must have to refer that document. That means the documents have to be created by Create with Reference. This can be done from the initial screen, of at the time of processing, even from a line item. Each line item of one document can be created from different preceding documents. Thus the status of different line item can differ. In the Outbound Delivery there are number of steps to be performed before billing document is generated. For that there is a status overview screen in the delivery itself. This gives the current status of each step.

Page 6 of 48 Pijush Ranjan Ghosh

Page 7: Document Flow

Document flow in SD

The following screen in delivery shows the status of an outbound delivery and its line items. The Picking Status, Packing Status, Warehouse Management status, Picking Confirmation Status, Goods Movement Status, Billing Status, Proof of Delivery status etc.A is not processed that means open, B is being processed, C is complete.

Page 7 of 48 Pijush Ranjan Ghosh

Page 8: Document Flow

Document flow in SD

Copy control in sales order: Transaction SPRO and press SAP Reference IMG Button

Follow the path Sales and Distribution Sales Maintain copy control for Sales Documents

Page 8 of 48 Pijush Ranjan Ghosh

Page 9: Document Flow

Document flow in SD

Enter destination document type & source document type after clicking the Position button. This is an example from Quotation (QT) Sales order (OR).

The copy control details at sales order is maintained in 3 levels. Header, Item and Schedule line.

Choose Header and press the Details button.

This is the header copy control which contains only Data transfer routines for general header data (VBAK), header business data (VBKD) and partner details (VBPA).In addition there is one copying requirements.

Page 9 of 48 Pijush Ranjan Ghosh

Page 10: Document Flow

Document flow in SD

Checking the Copy Item Number checkbox copies the line number from Quotation to Order. Complete reference works to refer the quotation completely while creating the sales order.

Select the Item folder for Item details and choose the Item category for the Quotation (Source document line item category) and then press the details button.

Page 10 of 48 Pijush Ranjan Ghosh

Page 11: Document Flow

Document flow in SD

This is the Sales Order copy control at item level, containing Data transfer routines for General item data (VBAP), Business data (VBKD), and Partner item (VBPA), Billing Plan Conditions (FPLA).Copying requirements is there (Here 301 checks the line item of the preceding document is not fully complete or rejected).

Some check boxes are there like Copy schedule lines and Update Document Flow.

Copy schedule lines

Indicates whether the system automatically copies schedule lines from the source sales document into the target sales document.

Page 11 of 48 Pijush Ranjan Ghosh

Page 12: Document Flow

Document flow in SD

Update indicator for sales document document flow

Specifies whether the system creates document flow records when you create a sales document item with reference or an item in a subsequent document.The system copies the indicator from copying control for the sales documents item (Customizing for Sales) to the target document item.

Copy configuration

This field controls the copy logic for configuring an item.

Quantity is calculated positively, negatively or not at all

Indicates whether, during copying, the quantity or value in the target document has a negative effect, positive effect, or no effect at all on the quantity still to be completed in the source document.

Use

Page 12 of 48 Pijush Ranjan Ghosh

Page 13: Document Flow

Document flow in SD

The system uses this indicator to determine how the quantity in the source document is affected. For example, if you

Create a quotation item for 100 pieces, Copy the quotation into a sales order, and Create a sales order item for 80 pieces,

The copying has a positive effect on the quotation. In effect, you have added 80 pieces to the quotation quantity that is now considered complete. 20 pieces in the quotation remain to be completed.If you do not make an entry in this field, or set indicator 0, the source document is not blocked, which allows you to create several target documents at once (for example, when using EDI and frequent contract releases).While the source document (such as quotation or quantity contract) is being processed, it is blocked. For instance, if you are working on a quantity contract, no one can create a release order for that contract).

Example

In sales documents, for example, you can expect the following results: Quotation   -> Sales order: positive Contract    -> Return: negative Sales order -> Sales order: no effect

In billing documents, for example, you can expect the following results: Delivery    -> Invoice: positive Delivery    -> Cancellation: negative Delivery    -> Pro-forma invoice: no effect

Copy quantity

Defines the quantity that is copied to the target document.DependenciesIf you leave this blank,  the system tries to copy the best possible quantity depending on the situation. For example, the system would copy the open quotation quantity if you were copying from a quotation to an order, and if you were creating a credit memo, it would copy the billed quantity.

Page 13 of 48 Pijush Ranjan Ghosh

Page 14: Document Flow

Document flow in SD

When choosing any other values, the system always uses the quantity related to that value.

Pricing type

Specifies how the system treats pricing data when copying documents.

Page 14 of 48 Pijush Ranjan Ghosh

Page 15: Document Flow

Document flow in SD

Copy mode for material in value contract item

This indicator specifies how the material in a value contract item may be copied.This only has an effect if the value contract item should be selected for copying into a new document.

Copy result of product selection

Specifies whether the system automatically copies the results of product selection from a source sales document to a target sales document.

Page 15 of 48 Pijush Ranjan Ghosh

Page 16: Document Flow

Document flow in SD

Copy control in Delivery

Page 16 of 48 Pijush Ranjan Ghosh

Page 17: Document Flow

Document flow in SD

Page 17 of 48 Pijush Ranjan Ghosh

Page 18: Document Flow

Document flow in SD

Page 18 of 48 Pijush Ranjan Ghosh

Page 19: Document Flow

Document flow in SD

Copy control in Invoice

Page 19 of 48 Pijush Ranjan Ghosh

Page 20: Document Flow

Document flow in SD

Page 20 of 48 Pijush Ranjan Ghosh

Page 21: Document Flow

Document flow in SD

Page 21 of 48 Pijush Ranjan Ghosh

Page 22: Document Flow

Document flow in SD

Copy Control Routines(Requirements)

Transaction VOFM

For Document flow this is very important technical aspect which controls the flow of data and validations before creating subsequent documents from the preceding documents.

The copying Requirements contain the validations and checks in the flow. If a Sales Order is being created from Quotation, then the system can keep some check that the Sold to party customer is same for Quotation and Order. For that standard routine 1 (Number 1) is used.

This is the screen for the Sales Order requirements. Routines source code can be displayed by pressing the Source Text button.

SAP has created some standard requirements. If there is some specific need of the customer, ABAPers can create separate custom routines starting from 900. Like here 903 is a custom requirement.

To use it in any of the copy control, that specific routine needs to be mentioned in customizing and the Active check box should be checked.

Page 22 of 48 Pijush Ranjan Ghosh

Page 23: Document Flow

Document flow in SD

The following screen shows the Routine 1. It displays the structures in which the data are available. This routine not only checks whether the Sold to party value in structure HVBPA and VBPA is same, but also checks the reference and status. If the checks and validations are not successful then Sy-subrc contains Non Zero value, which stops the creation of subsequent document.

If there is some special business needs along with the existing requirement, then we need to Copy this routine and do the necessary coding for that additional requirement. This custom routine will have number 9xx and will replace routine 1in the copy control of QTOR, in the header Requirement.

Page 23 of 48 Pijush Ranjan Ghosh

Page 24: Document Flow

Document flow in SD

In the following page two more routines are displayed, 301(Standard Item Requirement) and 501(Standard Schedule line requirement).

301 Routine checks the line item of the preceding document is not fully complete or rejected. If not then only it can be copied and the value of BP_subrc is zero. Else it is set to value greater than zero and that can not be copied.

501 Routine checks the quantity is greater than Zero. If not the schedule line will not be created in the subsequent document.

There are more standard routines than can be used for different purposes. But if none of the standard routine fulfills the business need, we have to write custom routines merging the codes of various routines or writing additional codes. The values needed for validations are compared from the structures available in the

Page 24 of 48 Pijush Ranjan Ghosh

Page 25: Document Flow

Document flow in SD

Page 25 of 48 Pijush Ranjan Ghosh

Page 26: Document Flow

Document flow in SD

Data Transfer Routines

The Data Transfer routines can also be seen and changed from VOFM transaction.

These routines contain the flow of data from preceding documents to subsequent documents. The values are defaulted in the system and user can change it depending on whether additions checks are kept in the copy control routines.

If separate business needs are requested, custom Data Transfer Routines can be created which will have numbers starting from 900. Like in the following example the data transfer routine for item data is 905.However the standard routine 2 has been used for Business data.

Page 26 of 48 Pijush Ranjan Ghosh

Page 27: Document Flow

Document flow in SD

Page 27 of 48 Pijush Ranjan Ghosh

Page 28: Document Flow

Document flow in SD

Page 28 of 48 Pijush Ranjan Ghosh

Page 29: Document Flow

Document flow in SD

The Tables and fields

TABLE VBFA.

This is the Sales Document Flow table which contains the flow details. This contains the preceding document and subsequent document number and there items and Document category of the subsequent document as its primary key.

Since this table contains all data of flow, this is a very huge table. Thus it is recommended not to hit a select in this table. If needed do a select using full primary key and do minimum number of selection.

Page 29 of 48 Pijush Ranjan Ghosh

Page 30: Document Flow

Document flow in SD

Sales Order table VBAK contains the header data.

Table VBAP (Sales Order Line Item) and only relevant fields for document flow is shown above.

Page 30 of 48 Pijush Ranjan Ghosh

Page 31: Document Flow

Document flow in SD

Reference from Invoice :

Technical Field names from the tableVGBEL: Reference document from where the document has been createdVGPOS: Reference document line item numberAUBEL: Sales Order numberAUPOS: Sales Order line item

The complete flow is captured in VBFA table

Page 31 of 48 Pijush Ranjan Ghosh

Page 32: Document Flow

Document flow in SD

But it is recommended not to use VBFA table as this is a huge table. From performance point of view it is much better, to use VBAP or VBRP table and read the reference fieilds

Inquiry Quotation Sales Order Outbound Delivery Picking (Transfer Order) Post Goods issue Invoice (Billing Document)

This is the complete flow in Sales Order, starting from Inquiry to Billing. The Billing Document is the interface between SD and FI. The account posting happens in FI.

The Document flow happens only if the parent document is referred (create with reference). The Create with Reference gives the following options. From Inquiry we can create Quotation, from quotations Sales Order can be created. But the perquisite is to maintain Copy control in IMG from source Sales Doc type to destination Doc type. In the copy control the checkbox Update Document Flow should be checked in order to update the flow of the preceding document.

Page 32 of 48 Pijush Ranjan Ghosh

Page 33: Document Flow

Document flow in SD

Inquiry

Page 33 of 48 Pijush Ranjan Ghosh

Page 34: Document Flow

Document flow in SD

Page 34 of 48 Pijush Ranjan Ghosh

Page 35: Document Flow

Document flow in SD

Page 35 of 48 Pijush Ranjan Ghosh

Page 36: Document Flow

Document flow in SD

Page 36 of 48 Pijush Ranjan Ghosh

Page 37: Document Flow

Document flow in SD

Page 37 of 48 Pijush Ranjan Ghosh

Page 38: Document Flow

Document flow in SD

Page 38 of 48 Pijush Ranjan Ghosh

Page 39: Document Flow

Document flow in SD

Page 39 of 48 Pijush Ranjan Ghosh

Page 40: Document Flow

Document flow in SD

Page 40 of 48 Pijush Ranjan Ghosh

Page 41: Document Flow

Document flow in SD

Page 41 of 48 Pijush Ranjan Ghosh

Page 42: Document Flow

Document flow in SD

Page 42 of 48 Pijush Ranjan Ghosh

Page 43: Document Flow

Document flow in SD

Page 43 of 48 Pijush Ranjan Ghosh

Page 44: Document Flow

Document flow in SD

Page 44 of 48 Pijush Ranjan Ghosh

Page 45: Document Flow

Document flow in SD

Page 45 of 48 Pijush Ranjan Ghosh

Page 46: Document Flow

Document flow in SD

Page 46 of 48 Pijush Ranjan Ghosh

Page 47: Document Flow

Document flow in SD

Page 47 of 48 Pijush Ranjan Ghosh

Page 48: Document Flow

Document flow in SD

Page 48 of 48 Pijush Ranjan Ghosh