cancel
Showing results for 
Search instead for 
Did you mean: 

how to avoid sales order creation for expired contract

Former Member
0 Kudos

Hello,

Is there any way to prevent creation of sale order reference to expired contract?

Please suggest.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fariba,

I think SAP has a standard way to meet this requirement. Once the contract validity expires - it would not allow you to create a reference order. Just incase it does, you can add a piece of abap code to the copy control at header level between Contract to Order ( VTAA) checking the validity of contract before allowing to create a sales order.

Regards

Sadhu Kishore

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I understand that it has be my abap code in requirement.

But I think the field has to be checked is VBAK-GUEEN ( not VBAK-ANGDT = Quotation valid from )

Thanks anyway it was helpfull.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

As Shadu says, create your own VOFM subroutine using '001' as a model and set it in VTAA. You can see in this subroutine this coding:


* Check the validity period of the reference document
  if vbak-angdt > 0 and
     vbak-angdt > sy-datlo.
    write vbak-angdt to bp_datum_ausgabe.
    message w008 with bp_datum_ausgabe.
  endif.

Replace the warning message (it's hardcoded) by other and use the field of date that you need.

If you need something else, dont hesitate to tell us.

Regards,

Eduardo

reazuddin_md
Active Contributor
0 Kudos

Message No: V1 448 is a std messge.

I dont think you can change this from Warning to Error.

Tx:OVAH - check for SD Variable messages, where you can change the type of Message from W to E.

Through development you can restrict this.

Regards,

Reazuddin MD