cancel
Showing results for 
Search instead for 
Did you mean: 

How to block a delivery when an A/R Down Payment Invoice is not paid?

Former Member
0 Kudos

1. Create and add a Sales Order

2. Create and add an A/R Down Payment Invoice based on the created Sales Order (set DPM % to 50)

3. Create and add a Delivery based on the created Sales Order

The delivery is not blocked.

Is there an easy workaround/alternative to ensure goods are stopped from being delivered when a customer hasn't paid a certain amount upfront?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member583013
Active Contributor
0 Kudos

Answering you first question, BaseEntry is the DocEntry of the SalesOrder which I checking in my query with DownPayment Rows BaseEntry.

The issue as I described is with SAP picking the BaseEntry in the Delivery document. Unless you highlight a row the value of $[DLN1.BaseEntry] is not available for the Query.

Try this, All the steps can remain the same, but before adding the Delivery highlight one of the Rows and then Click Add, you should see the Approval procedure will get trigerred. This may not be the final solution but I have to check a better way to do this where SAP will automatically get the BaseEntry value in the Delivery rows

I will get back to you on this.

NOTE: After we this work, you could add one more criteria in the Where Clause to be doubly sure <b>AND T1.BaseType = 17</b>. This is to check is the DownPayment was created from a Sales Order.

Suda

Former Member
0 Kudos

Hi Suda,

Did you manage to find a better way to do this where SAP will automatically get the BaseEntry value in the Delivery rows?

Regards,

Petronella

former_member583013
Active Contributor
0 Kudos

Petronella

There is no better way to do this. If you think of other options then please let me also understand it.

Best wishes

Suda

former_member186095
Active Contributor
0 Kudos

Hello,

You could try to use UDF that is defined with query formatted search or you could use approval procedures where on tab terms you select when the following applies, where the terms can be based on available terms or based on query. let me know if you need more detail. I am afraid the UDF can't perform better than approval procedures.

Rgds,

JM

http://groups.yahoo.com/group/SBO_Knowledge_Village

SBO_Knowledge_Village-subscribe@yahoogroups.com

Former Member
0 Kudos

Hi Jimmy,

Thank you for the input.

Not sure how you would apply the UDF to 'block' the delivery. However I am curious in detail how you can apply the approval procedure to only filter out the Sales Order/Deliveries that are connected to a A/R Down Payment Invoice to stop the Delivery till paid.

Regards,

PDP

former_member583013
Active Contributor
0 Kudos

Hello,

You can create a Approval Procedure based on a Query like the one below

<b>SELECT DISTINCT 'TRUE' FROM

[dbo].[ODPI] T0 INNER JOIN [dbo].[DPI1] T1 ON T1.[DocEntry] = T0.[DocEntry]

WHERE T1.[BaseEntry] = $[DLN1.BASEENTRY] AND T0.[DpmPrcnt] < 60</b>

The 60 in my example at the End of Query denotes Percentage of DownPayment Required. You may set it to what you want. If you going to store to the Down payment requirement percent in some field then that field has to be checked in the < than clause.

I have noticed that SAP when looking for the BaseEntry from the Rows in the Delivery sometimes does not get it and the Query fails to Fire.

I am testing a few scenario on which I will come back.

Suda

Former Member
0 Kudos

Hi Suda,

Unfortunately my usage of the sql queries is a bit rusty and am not sure if I am doing this correctly.

Next to that I don't exactly see how it should work (hence my comment being rusty - haven't used this very often). I see that it checks the AR Down Payment Invoice document and lines, but how it checks to which sales order it is connected to stop the delivery.. Plus I always want it to stop any delivery when an AR Down Payment for any percentage hasn't paid in full untill it has been paid/approved by someone to be delivered. If no AR Down Payment has been done, there is no issue.

Anyway I have copied your query to the Query Generator and saved it.

I created an approval procedure based on delivery documents and based it on the saved query.

Added a sales order and created a Down Payment Invoice based on the sales order with 40% that has to be paid upfront. Created a delivery based on the sales order and added the document. I only gotten an internal error (it went so quickly I can't see the actual whole message because I get the created message straight after), but it created the delivery anyway.. (same as you described maybe?)

I'm missing something obviously, let me know what to do.

Regards,

Petronella