Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Question on function module for SD document flow

Former Member
0 Likes
1,202

Hello,

I have a question with regard to SD document flow. I am creating a delivery w/o order reference (using transaction code: VL01NO). The follow up invoice document for this needs to be a manual invoice document (customer invoice, invoice type DR) created using transaction code F-22.

As it is a manual invoice, I am using the function RV_DOCUMENT_FLOW_UPDATE_U to update the document flow of the delivery with this invoice number (just for record purposes). However, when I execute the function, the invoice shows up above the picking and goods issue. For e.g.

Delivery w/o Ref. 80154622

. Invoice 18006198

. Picking request 20100720

. GD goods issue:delvy 490030123

Is it possible to have the invoice show up after the goods issue? i.e.

Delivery w/o Ref. 80154622

. Picking request 20100720

. GD goods issue:delvy 490030123

. Invoice 18006198

Please let me know how I can do this.

Thanks,

Rugmani

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
895

I'm guessing document flow is displayed by DISPLAY_DOCUMENT_FLOW_ALV FM. You can debug it and see how the hierarchy is determined for deliveries.

4 REPLIES 4
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
895

I have a theory that the documents are displayed in the order of VBTYP_N field. If you look at the list of possible values for this field then you'll notice that it resembles the natural document flow in SD. Invoice is listed there before TR and GI, so that's how it's displayed.

If you use another value for this field, it might help. Try 'U' (Proforma invoice), for example, and see if it helps. Unfortunately, I don't have a system with deliveries to verify this.

Read only

0 Likes
895

Hi Jelena,

Thanks for your suggestions. There are 2 issues with this:

1. The invoice I am creating is not a pro-forma invoice. So I need to use 'M'.

2. However, just for experimenting purposes, I tried using 'U'. Unfortunatey, even that did not help. The Pro forma invoice is listed just below the delivery in the document flow.

Thanks,

Rugmani

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
896

I'm guessing document flow is displayed by DISPLAY_DOCUMENT_FLOW_ALV FM. You can debug it and see how the hierarchy is determined for deliveries.

Read only

0 Likes
895

Thanks for the hint Jelena. I degugged the document flow program and found that in the function module RV_ORDER_FLOW_INFORMATION if all the documents are created on the same day, the system uses the time to sort the document flow table before display.

So in my call to the function module RV_DOCUMENT_FLOW_UPDATE_U I used sy-datum and sy-uzeit for creation date and time and now it is working fine.

Thanks,

Rugmani