cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order Output and subsequent order document restrictions

Former Member
0 Kudos

Dear Experts,

I need your expert advice. I have a requirement from a customer as below.

Requirement-1. Restrict (Block) the issue of output to customer when a custom field in additional data tab A at header level is equal to specific value (eg. Confirm sales order). If the custom field XZOUTP is not equal to 01-confirm sales order, then output can not be issued.

I have considered to create new requirement routine and assign it to the output type for this purpose. However, this will impact all other sales orders types which are using the same output type. This requirement is only required for one sales order document type.

Requirement-2. Restrict the sales order to create subsequent document until the custom field (XZOUTP) is equal to specific value (01-confirm sales order).

I am not sure the requirement-2 can be handled using incompletion log or user exit. I believe, incompletion log is not the right one to use as we can only restrict at field level but not at field value level.

Could you please share your advice on how best I can achieve these requirement without impacting other sales order document types?

Thank you,

Krishna.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For Requirement no 2 : Can you explain whether you donot want a subsequent document to be created from the particular sales order or you donot want that sales order which does not fulfill the Z field logic to get saved.

For the former you can write this in the requirement routine for copy control settings. for the latter use the user exit save_document_prepare.Let me know in case you need any further help.

Former Member
0 Kudos

Hi Anupa and Mehatamanas,

Thanks for your views. There requirement is very clear,

1. The sales order is only allowed to create subsequent document when the zfield value = 01- order confirmed (this has separate WF build in the system). I am not sure using status profile or incompletion log will help to resolve this.

2. By using the userexit_save_document_prepare I might arrive at solution. However, my concern is creation of any subsequent document, the system will check the status of document based on the incompletion log. Now the new zfield or this requirement is not captured in incompletion log. But How this works against the standard process..

kindly share your views.

Thanks.

Former Member
0 Kudos

Hi

If the idea is to stop creation of any subsequent document. It would be advisable to create a new requirement routine for your copy control setting. This requirement will check the contents of Zfield. If found otherwise the subsequent document creation would not be allowed. Let me know if you need further inputs. This is how a standard process should look like.

Former Member
0 Kudos

Hi Mehtamanas,

Thanks. the idea is to check the zfield value. Below are the conditions.

If zfield value = 01, then allow creation of subsequent document.

If zfield value # 01, then subsequent document creation should not be allowed.

Moreover, these conditions should only be applicable to few document types and in few sales areas.

If I change the copy control requirement routine, then it will impact the other documents where its been used.

Kindly advice.

Thanks.

former_member217082
Active Contributor
0 Kudos

Hi

In the given logic include another comment

If zfield value = 01, then allow creation of subsequent document.

If zfield value # 01, then subsequent document creation should not be allowed.

If AUART = Z sales document types then allow creation of subsequent document

If VKORG (Sales organisation) =1000 then allow creation of subsequent document

If VTWEG (Distribution channel) = 01then allow creation of subsequent document

If SPART (Division) = 01then allow creation of subsequent document

It wont affect if you change the copy control requirement routine,but instead of changing the copy control requirement routine

use the user exit at sales order level only.

Regards

Srinath

Former Member
0 Kudos

Thank you Srinath. but I a have doubt about using the userexit_save_document_prepare. How can this userexit will prevent the subsequent document creation with reference sales order?

Because, when we create delivery (VL01n) with reference to sales order (VBAK-VBELN), the system will first verifies the sales order number and check the copy requirement (default requirement is document status (Incompletion log) = complete). at what stage during the delivery creation with reference to sales order will check our userexit (Save_document_prepare) to restrict the subsequent document creation?

Thanks for your support.

former_member217082
Active Contributor
0 Kudos

Hi

Firstly,you have to include the Zfeild in the incompletion log at delivery level also.Secondly you have to include the same user exit logic in VL01N programme also.

Regards

Srinath

Former Member
0 Kudos

Hi srinath, Thanks for your prompt response.

But If I include this in incompletion log, it will not check for the field value. By default, this zfield will have the value (different statuses). The complete requirement is to check for specific value is present or not. I believe, I am very near to the solution. But not sure to use which userexit i can use in both the sales order and in delivery creation and at what stage?

your valuable inputs really helpful.

Thanks.

Former Member
0 Kudos

HI

If you would check for only your doc type in the routine it will not affect any other doc type. For this you can also create a new requirement routine and assign it to only your copy control setting or include the logic in the existing one(whatever suits you).

Logic can be

if auart = "doc type".

if zfield value = 01.

sy-subrc = 0.(means creation allowed).

else.

sy-subrc =4.(creation fails).

else.

sy-subrc =0.(creation allowed for other doc types)

SAP created requirement routines in copy control to stop the creation of subsequent docs till the requirements are met. I think using/creating a copy control (requirement routine) would be the best fit. Let me know if you need any further inputs.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

For your requirement 1 -> Include the specific order type in to your requirement routine. Eg:: If order type = OR and the field value = X, let the system print the document.

For the requirement 2 -> What exactly the business process behind that. Is it like a release strategy for sales orders? Then try using "Status Profile: functionality. It is a standard release strategy for sales orders.

If you really want to go with a custom field, you will have to go for a user exit.

Best regards,

Anupa

former_member217082
Active Contributor
0 Kudos

HI Krishna

For Requirement 1, as you have already created the logic and it has to be restricted only for one sales document type then you have to include another logic that the output should check only for (V_VTAK - AUART) document type.Then system wont check the other output types.

For Requirement 2,you have to go with the user exit only

Regards

Srinath

Former Member
0 Kudos

Hi Srinath,

Thank you for your quick reply.

For Requirement-2, I am not which userexit to use in MV45AFZZ. Can you help me.

Thank you.

former_member217082
Active Contributor
0 Kudos

Hi Murali

For Requirement 2, use the user exit USEREXIT_SAVE_DOCUMENT_PREPARE in the program MV45AFZZ. In the program you have to include the logic that To restrict the sales order to create subsequent document until the custom field (XZOUTP) is equal to specific value (01-confirm sales order).So you have to give the provided inputs to your ABAP Team

Regards

Srinath